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

 
Messages:655
Registered:September 2010
Quote:
Hope this helps clarify a few things, and I will suggest you take a look at the code as well, the comments make it easy enough to understand.
You are of course right, I should have looked into the code before posting, but ATM I don't have the intention to start coding the tactical AI myself, and wished to limit myself to experiences what actually happens in battle.


JMich
How the AI reacts depends on what state the soldier is currently in. If the soldier is on green and hears a noise, he will (usually) move to investigate, if he is on yellow he has a chance (25% to 65%, depending on orders and attitude) of radioing the noise, if on red he will turn towards the noise and go prone. There is also the "Most Important Noise", which I'm not sure if it's the closest, or the loudest, or if it can tell the difference between a footstep, an explosion, a scream and a shot.
This includes some problematic things, I think:

- The AI being required to radio doesn't do it any good: the soldier can either radio or fight (If I see that right radioing costs a lot of APs; at least both enemies and militia often don't do much else than going couched after radioing).

This is a classical dilemma, because whatever he does is wrong. When he radios he can't do anything about the enemies in his sight. So he will be shot the next turn, and whether the guys he radioed will do anything better out of the situation is another question - not to mention that the mercs probably will move on after killing that poor fellow.

When he decides to fight instead he might be able to pin you down, but unless it is a 1:1 situation or other soldiers by chance are close enough to help, he would be left alone and easy prey for your cooperativly working team.

Apart from that, the animation of radioing goes on my nerves.

So this is something I would suggest to skip: When one enemy sees you, all would know of your position (100%). You would either need to shoot him (in this case the enemy would be blind again) or move out of his sight.


Giving the enemy a certain % of what to do next is problematic too: it is difficult to define a suitable behaviour in each situation for the AI at all. Saying that in between 35% to 75% of all cases he wouldn't do even that, do something else or nothing at all means that besides the JA2 enemies already already are dumb AI, they are even coded to behave extra stupied/wrong.



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: Fri Feb 14 10:03:13 GMT+2 2025

Total time taken to generate the page: 0.01015 seconds