K-Mod: Far Beyond the Sword

Glad to hear that it works.
Does the integer value represent a percentage, or a bizarre integer weight
For instance, if I set this to 5, and then to 10, what would be the mathematical difference.
They're percentage points that the AI adds to the true combat odds (AI_attackOdds). When deciding whether to attack, the AI will often compare those (biased) odds with a fixed threshold, e.g. in the frequently used function for opportunistic attacks (AI_anyAttack). In that case, the weighted odds function rewritten by K-Mod (AI_weightedOdds) is used, which adjusts the AI_attackOdds further based on the stakes of the battle, i.e. how much each side stands to win and lose. I suspect that that function is the main reason why K-Mod Barbarians are less suicidal than in BtS. The randomization of the odds bias apparently happens once per turn and applies equally to all Barbarian units. Two dice are rolled, each with iAttackOddsChangeRand minus 1 sides (CvPlayerAI::AI_doMilitary).

So it seems that your change will, on average, add 35 points to the true odds, which ... seems like a lot. The odds thresholds are, for the most part, 20% or less, so I'd expect the Barbarians to attack pretty much always if the odds are treated as 35 percentage points greater than they truly are. But I might be missing something here.
 
Glad to hear that it works.They're percentage points that the AI adds to the true combat odds (AI_attackOdds). When deciding whether to attack, the AI will often compare those (biased) odds with a fixed threshold, e.g. in the frequently used function for opportunistic attacks (AI_anyAttack). In that case, the weighted odds function rewritten by K-Mod (AI_weightedOdds) is used, which adjusts the AI_attackOdds further based on the stakes of the battle, i.e. how much each side stands to win and lose. I suspect that that function is the main reason why K-Mod Barbarians are less suicidal than in BtS. The randomization of the odds bias apparently happens once per turn and applies equally to all Barbarian units. Two dice are rolled, each with iAttackOddsChangeRand minus 1 sides (CvPlayerAI::AI_doMilitary).

So it seems that your change will, on average, add 35 points to the true odds, which ... seems like a lot. The odds thresholds are, for the most part, 20% or less, so I'd expect the Barbarians to attack pretty much always if the odds are treated as 35 percentage points greater than they truly are. But I might be missing something here.

They do. When its a huge lakes map, with zero water (on raging barbs) the only way to survive is if they attack immediately. And it's still not easy lol.

Without this change they form multiple doom stacks of 30-40 barbs, pillaging everything, leaving both the player and the AI's in the stone age until 1500 AD.
 
Top Bottom