Home » MODDING HQ 1.13 » v1.13 Coding Talk » Learning how the tactical AI works
Re: Learning how the AI works[message #274361] Wed, 23 February 2011 21:27 Go to previous messageGo to previous message
JMich is currently offline JMich

 
Messages:546
Registered:January 2011
Location: Greece
the part that says
#Ifdef DEBUGDECISIONS
is false, so anything between that and #endif will not be processed. You will have to
#define DEBUGDECISIONS = 1
for any debugdecisions blocks to be processed.

Also, the Tactical AI is quite complex, and you will see that it is being referenced in many places. In DecideAction.cpp we have 4 routines to decide what action the unit (and it is unit, wheter civilian, monster, bloodcat, soldier or in some cases pcs), 1 for each of the alert status (stati?).

For the part of "do this, and then do that", take a look at the function
INT8 DecideActionSchedule( SOLDIERTYPE * pSoldier )
in decideaction.cpp, the one for going through closed doors.

Since you are using VS, run the game by pressing F5, which is the debug mode of VS, and run the game in window. This will allow you to set breakpoints that will stop the execution when a breakpoint is reached, but before it's calculated. For example, if you set a breakpoint at
INT8 DecideActionGreen(SOLDIERTYPE *pSoldier)
the execution will stop once the function is to be called, which will allow you to see the value of
SOLDIERTYPE *pSoldier
and if you want to see what this soldier will do, you can set more breakpoints.

P.S. in VS, if you hover your mouse over any declarations, it will tell you its definition and whether it has a value defined or not.
P.P.S. I usually lurk in irc if you think I can help you more, but I am not yet that confident of my ability to understand 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:36:36 GMT+2 2025

Total time taken to generate the page: 0.01639 seconds