I implemented a division by time needed and found out that staying where you are is highly valuable in these conditions, so I changed the divider to (number of ticks per turn + ticks needed). This allows distance to be taken into consideration, but not too much. Without adding the value of intermediary squares, I don't see any change in the ai so I'm not really keen to do more coding on that topic until I have a scenario where we can see an effect of the code.
I also finally implemented the possibility to have different military attitudes for a single ai. Thus Carthago spends 5 task forces on attack and 1 on defense.
The implementation is rough (I commit a number of task forces, but don't care about their actual strength), but should do for now. What this means is essentially that orders of wait, owncity can be removed from offensive attitudes, and the ai will commit units to various attitudes, alwas leaving defenders thanks to those taskforces with stonewall attitude for example.
I will flesh out this a bit more (I must allow a taskforce to specify its attitude through xml so Hannibal always "attacks"). After that, I think it should be worth checking whether to continue on the ai now or to code something else (like saves).
I also finally implemented the possibility to have different military attitudes for a single ai. Thus Carthago spends 5 task forces on attack and 1 on defense.
The implementation is rough (I commit a number of task forces, but don't care about their actual strength), but should do for now. What this means is essentially that orders of wait, owncity can be removed from offensive attitudes, and the ai will commit units to various attitudes, alwas leaving defenders thanks to those taskforces with stonewall attitude for example.
I will flesh out this a bit more (I must allow a taskforce to specify its attitude through xml so Hannibal always "attacks"). After that, I think it should be worth checking whether to continue on the ai now or to code something else (like saves).
) but at least it's purely strategic. If I can express the value of a unit as its ability to take a square, and the value of a square as its ability to allow taking of another square (typically a square is worth what its neighbours are worth + map ai value for chokepoints etc. so it has an "influence"), I'd have the same unit of measure, which would help me a lot. By default 1 square is worth 1 strategically, and 1 unit is worth something only in comparison with other units, so it's probably a ratio: 1 unit stronger than another is worth 1, the weaker is worth 0. Since the winner will suffer losses and can win with only a given probability, its value is probably only 0.8 so the loser is worth 0.2. This value depends on the opponent, so it's very interesting to attack a weak enemy because my military value won't fall, while attacking a strong one is suicide and it's shown by a 0 or almost 0 strategic value... (needs refining)
Comment