Home » MODDING HQ 1.13 » v1.13 Coding Talk » Learning how the tactical AI works
Re: Learning how the AI works[message #274253] Tue, 22 February 2011 20:03 Go to previous messageGo to previous message
MorgluM is currently offline MorgluM

 
Messages:24
Registered:March 2004
Location: Qu
Here's where I am so far in trying to understand what is going on when someone is supposed to go and take cover..

Question: Is InternalGetNewSoldierPath where the actual moving occurs? I'm at a loss (again)
Cheers!



FIRST:
DecideAction (from DecideAction.CPP) returns an action, but it also sets parameters for that action. Example with AI_ACTION_TAKE_COVER, where sBestCover is probably the coordinate of the best cover available...

pSoldier->aiData.usActionData = sBestCover;
return(AI_ACTION_TAKE_COVER);

SECOND:
ExecuteAction (from AIMain.cpp) tries to execute this action.
All the "movement orders" will call the NewDest method (from AIUtils.cpp) to set a new pSoldier->pathing.sDestination based on pSoldier->aiData.usActionData

THIRD:
NewDest
-sets pSoldier->usUIMovementMode (sometimes using AIUtils's DetermineMovementMode() method)
-calls pSoldier->EVENT_InternalGetNewSoldierPath( usGridNo, pSoldier->usUIMovementMode , FALSE, pSoldier->flags.fNoAPToFinishMove );


SOLDIERTYPE::EVENT_InternalGetNewSoldierPath is located in "Soldier control.cpp"

[Updated on: Tue, 22 February 2011 21:24] by Moderator

Report message to a moderator

Private 1st Class
 
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:12:18 GMT+2 2025

Total time taken to generate the page: 0.01305 seconds