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

 
Messages:546
Registered:January 2011
Location: Greece
Buns
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.
If when any soldier sees you, all have seen you, that means that all raise their alarm level, and sneaking is harder (if not impossible) to do. Think of what would happen in Alma, you kill the first soldier, and since he has seen you, panic button is pushed, and Sergeant Krott is killed. You have to kill the enemy quietly and without letting him notify to be able to save him and get the Rocket Rifle.Buns
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.
If soldier.orders->Guard OR soldier.orders->Stationary
then chance = 50
else chance = 25
If soldier.attitude.defensive chance = chance + 15
If random(100) < chance
then radio
else investigate


P.S. the reason I mention the code is because it is easy to read, and usually understand, even though one may not know C++. I haven't used C in more than 8 years, and the only usage I did was an introductory university course, but I still find the code easy to follow. And after all, the more people reading the code, the more people making suggestions to the code.

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:08:32 GMT+2 2025

Total time taken to generate the page: 0.02369 seconds