Just pushed to SVN (3628):
The second of these is actually fairly significant. I noticed in my current game that while I had a large stack sitting on a hill a few tiles away from an AI city (preparing to attack but not yet ready to do so), every now and again the AI would stick hunters or rogues on poor terrain next to it, where they could be easily picked off (and promote my great general up in the process).
It turns out that many (most) AI routines that selected targets for various missions (tiles to patrol to, units to attack) were not assessing the danger in the intermediary tile the unit would wind up on at the end of its first turn on the way to wherever it was going. So, for example, an AI hunter noticed a moose a few tiles past my death stack an considered it to be a good target, but didn't take account of the fact that to get to it, it would leave itself next to my death stack on the turn before it reached said moose (needless to say such hunters never actually got to meet their moose!)
Anyway, I've corrected this situation on all the AI routines it seemed appropriate to adjust (about 25 of them!), so these 'accidental' suicides should no longer occur.
- Minor pathing fix that was causing some AI inefficiency
- Fixed tendency for the AI to put its units in unintended danger
The second of these is actually fairly significant. I noticed in my current game that while I had a large stack sitting on a hill a few tiles away from an AI city (preparing to attack but not yet ready to do so), every now and again the AI would stick hunters or rogues on poor terrain next to it, where they could be easily picked off (and promote my great general up in the process).
It turns out that many (most) AI routines that selected targets for various missions (tiles to patrol to, units to attack) were not assessing the danger in the intermediary tile the unit would wind up on at the end of its first turn on the way to wherever it was going. So, for example, an AI hunter noticed a moose a few tiles past my death stack an considered it to be a good target, but didn't take account of the fact that to get to it, it would leave itself next to my death stack on the turn before it reached said moose (needless to say such hunters never actually got to meet their moose!)
Anyway, I've corrected this situation on all the AI routines it seemed appropriate to adjust (about 25 of them!), so these 'accidental' suicides should no longer occur.