I suppose, this could be useful for many ruleset-mechanism.
For example: battle, huts, plague, disasters, counters, actions, etc.
Let's see ruleset format first:
[function_prob_1]
name="probability_1"
parts = {
"reqs_id", "min_val", "max_val", "probability"
"first_part", "0", "2", "1"
"second_part", "2", "5", "2"
}
first_part = {
"type", "name", "range"
}
second_part = {
"type", "name", "range"
"Veteran_Level", "Elite", "Unit"
}
If unit does not have Elite veteran level, value could be 0, 1, 2. Each with the same probability.
But, if unit is Elite, now:
{
"possible value", "weight"
"0", "1"
"1", "1"
"2", "3"
"4", "2"
"5", "2"
}
So 0, 1 could be with 1/9 probability, 2 could be with 1/3 probability and 4,5 could occur with 2/9 probability.
Simple. Weight acts as att/def unit type attributes, when battle occur, so we sum each weight, select number between 0, sum(weight), substract by each possible value as sun as result is < 1. If result of substraction weight of last element (from sum) is less than 1, we known, current value is our function value.
I think, it could be made AI understood this, but I am not AI expert/developer and I am not good in math.
It could not be only for implementing actions like attacking (battle), probability of promotion, etc. It could be useful to simulate mechanism of victim (for example: city/building) selection, for example to select building to sold.
It is part of implementing some changes to counter and other mechanism, like selection dialog (I known somebody working on this feature already, but maybe it may be useful).
I suppose, this could be useful for many ruleset-mechanism.
For example: battle, huts, plague, disasters, counters, actions, etc.
Let's see ruleset format first:
If unit does not have Elite veteran level, value could be 0, 1, 2. Each with the same probability. But, if unit is Elite, now: So 0, 1 could be with 1/9 probability, 2 could be with 1/3 probability and 4,5 could occur with 2/9 probability.Simple. Weight acts as att/def unit type attributes, when battle occur, so we sum each weight, select number between 0, sum(weight), substract by each possible value as sun as result is < 1. If result of substraction weight of last element (from sum) is less than 1, we known, current value is our function value.
I think, it could be made AI understood this, but I am not AI expert/developer and I am not good in math.
It could not be only for implementing actions like attacking (battle), probability of promotion, etc. It could be useful to simulate mechanism of victim (for example: city/building) selection, for example to select building to sold.
It is part of implementing some changes to counter and other mechanism, like selection dialog (I known somebody working on this feature already, but maybe it may be useful).