Home » MODDING HQ 1.13 » v1.13 Coding Talk » Learning how the tactical AI works
Re: Learning how the AI works[message #275347] Tue, 08 March 2011 17:26 Go to previous messageGo to previous message
Buns is currently offline Buns

 
Messages:655
Registered:September 2010
From observing the AI, including milita, a bit more closer, and without looking into the code, I think I can name some major problems in its behaviour:

Investigating Sounds
The AI is drilled to investigate suspicious sounds. That makes sense when you sneek into a facility at night, but doesn't make much sense in a shoot-out at daylight. The main problems comes from soldiers not being able to differentiate between an unidentified sound (movement, you throwing a rock) and a shot.

While the first one indeed should trigger a "soldier comes looking"-behaviour, the second one would mean a "contact" that should trigger a different behaviour. The AI is able to identify the tile the sound originated from. This means in case of a shot the AI would be able to identify the tile where an opponent would be sitting and should be acting accordingly.

Latest Sound Rules
It seems the AI only reacts to the latest sound, when having heard a couple of them. When you have several mercs placed all over the map, the AI during its turn will approach the last one of them who had been shooting during your turn. In case another mercs gets an interrupt and shoots, all soldiers with APs left will change direction and move to that tile.

It would make more sense if the AI would be able to "remember" all shots you had fired during your turn, and then each soldier would approach the closest of those contacts assuming an opponent who had just been shooting out of a tile to still be there.

We are no Borg
It doesn't seem that all soldiers are able to see what one soldier sees. Even when one AI soldier has visible contact to an opponent others behave as if they don't know the opponent is there. A typical example is when one soldier is shooting at an opponent from the corner of a building, and a second soldier is around the corner without seeing the opponent. That second soldier during his turn will round the corner, run past his comrad (to investigate the sound he heard, of course), then he sees the opponent and tries to get back to the corner.

This dramatically dumbs down the AI; just imagine one of your mercs would see an enemy but you would be moving the others as if you wouldn't know of that enemy! No chance. When calculating orders and pathfinding during the AI turn, all opponents sighted by that side should be taken into account.

No Blind Shooting
I had once claimed that the AI never is shooting blindly (means on "greyed out enemies"). This is not correct: I had closely observed this during my ongoing campaign and there indeed had been two occasions (in 35 battles!) when the AI had been shooting "surpressive fire" - once of that on my vehicles. OK, in my mod most enemies are armed with bolt-action or semi-automatic rifles, but in larger armies there are usually four or five with SMGs and two or three with LMGs. And there also is no reason to limit blind shooting to autofire.

This basically is the same problem as described above: the AI should take all sightings of that side into account when creating orders for a soldiers. If there is a sighting within range, and the soldier is in a suitable position he might start shooting, even when not having visible contact himself. This would also solve the scope-problem: when the soldier has a scope on his rifle he would then see the enemy while raising the weapon for blind-shooting.

Randomized Movement
It seems large parts of AI movement is by random. You can see it very clearly with militia in tactical combat, because it shows you all their movements, not only that of the ones you see yourself, and not only those that are somewhat involved into combat.

For example, you have militias that move couched despite being far away from anything dangerous, others suddenly get up and start walking around even though in line of fire of the enemy. Most notably is the "running of 8s", which can happen within range of the enemy, but also far away from the frontline. It seems this random behaviour can kick in anytime an AI enters a tile, which can result in the AI wasting all APs for running fore and back between two tiles indentically in coverage and line of fire.

When you have your next defensive battle with militias, just leave the last three or so enemies to them and don't shoot them yourself. You would be surprised how long it can take for 32 militias to kill 3 enemies they know of. After that you wouldn't be surprised why the AI usually has no chance of killing one of your mercs with 32 soldiers.

Report message to a moderator

First Sergeant
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Doubling image size
Next Topic: RII - Resolution Independent Interface [UPDATE :RII v4f]
Goto Forum:
  


Current Time: Tue Feb 11 12:09:33 GMT+2 2025

Total time taken to generate the page: 0.02127 seconds