Twan
Sergeant Knight

I've made this for my Auxilarii variant of Sword of Damocles, but as it may interest other modders to adapt or developp more this system to improve realism, I signal it here.
I've make a script to determine terrain for AI vs AI battles (may need some changes on modded maps with lot of reliefs as my "mountain" terrain is based on the z coordinate and altitude is rather low in Calradia) and return a troop slot number for the appropriate bonus (need of course to add these troops slots in constants, with the good numbers).
Then I've modified the script evaluating strength to make it use this bonus (the bonus being in a troop slot, and the number of this slot being send as a script parameter - also needs to add a call to the determine terrain script and add the terrain parameter to the calls to the "evaluate strength script" in the "event_simulate_battle" one).
The way I've given bonuses to all units isn't perfect as I wanted to make well geared troops as elite in autoresolve as they are in 3d combat, I had to make a long (try_else) script to check each troop id (adapting it need to cut the references to SoD or auxilarii mod specific units), and give a note to their gear myself then formulaes to determine the bonuses on each terrain based on gear. But a more generic system should be easier to do, ie giving the same terrain bonuses to all mounted troops.
--
Other interesting tricks :
- changing AI lords optimism (how they evaluate their own strength, key to make them more or less agressive), for that you need to add a multiplier to "
ur_strength" everywhere it's used in AI calculations scripts (and the process siege simple trigger), but not in the evaluate strength script (as this strength is stored in the cached_strength party slot and used when a lord evaluate the strength of ennemy lords) ;
- an easy to use method for making AI lords troops quality improve other time (need to add factions with different reinforcements templates then you can use a trigger changing the value of the "troop_original_faction" slot of kingdom heroes to make them get better templates at regular intervals).
I've make a script to determine terrain for AI vs AI battles (may need some changes on modded maps with lot of reliefs as my "mountain" terrain is based on the z coordinate and altitude is rather low in Calradia) and return a troop slot number for the appropriate bonus (need of course to add these troops slots in constants, with the good numbers).
Then I've modified the script evaluating strength to make it use this bonus (the bonus being in a troop slot, and the number of this slot being send as a script parameter - also needs to add a call to the determine terrain script and add the terrain parameter to the calls to the "evaluate strength script" in the "event_simulate_battle" one).
The way I've given bonuses to all units isn't perfect as I wanted to make well geared troops as elite in autoresolve as they are in 3d combat, I had to make a long (try_else) script to check each troop id (adapting it need to cut the references to SoD or auxilarii mod specific units), and give a note to their gear myself then formulaes to determine the bonuses on each terrain based on gear. But a more generic system should be easier to do, ie giving the same terrain bonuses to all mounted troops.
--
Other interesting tricks :
- changing AI lords optimism (how they evaluate their own strength, key to make them more or less agressive), for that you need to add a multiplier to "
- an easy to use method for making AI lords troops quality improve other time (need to add factions with different reinforcements templates then you can use a trigger changing the value of the "troop_original_faction" slot of kingdom heroes to make them get better templates at regular intervals).