Which Think() function
by Anthony Cosgrave · in Technical Issues · 09/06/2007 (11:28 am) · 3 replies
Hi,
I've been going through both the C++ and the scripting files for the AI bots that are available (Kork, aiGuard/Patrol and KillerKork). I'm a bit confused on which Think() function is the one that acts as the "main" method / brain for the Kork bot in Stronghold.
There appears to be an AIManager::Think() and then in some cases the bots have their own Think() function too, e.g. AIGuard::Think(). From what I've seen in the forum quite a few people recommend ditching the AIManager.
For example, say I wanted to implement a simple state system to control my bot's behaviour, where do I put the state transition / conditional logic ?
Thanks,
Anthony
I've been going through both the C++ and the scripting files for the AI bots that are available (Kork, aiGuard/Patrol and KillerKork). I'm a bit confused on which Think() function is the one that acts as the "main" method / brain for the Kork bot in Stronghold.
There appears to be an AIManager::Think() and then in some cases the bots have their own Think() function too, e.g. AIGuard::Think(). From what I've seen in the forum quite a few people recommend ditching the AIManager.
For example, say I wanted to implement a simple state system to control my bot's behaviour, where do I put the state transition / conditional logic ?
Thanks,
Anthony
About the author
#2
09/15/2007 (8:47 am)
I'm glad we could all help. ;-)
#3
I've been working on my AI system for a few days now. I've quite happily created an AIManager that does just that -- manages the AI bots. The bots themselves manage their own thinking (through processTick on the engine side).
My AI manager compiles a list of all spawn points (optionally including path nodes as spawn points) then spawns all my AI agents. Part of my spawn point information is respawn delay and max spawn count. When my agent's die they ask the AI manager to respawn them. If they haven't exceeded their spawn limits then they are respawned.
So the AI Manager manages the agents and the agents themselves manage their own thinking.
10/02/2007 (9:23 am)
LOLI've been working on my AI system for a few days now. I've quite happily created an AIManager that does just that -- manages the AI bots. The bots themselves manage their own thinking (through processTick on the engine side).
My AI manager compiles a list of all spawn points (optionally including path nodes as spawn points) then spawns all my AI agents. Part of my spawn point information is respawn delay and max spawn count. When my agent's die they ask the AI manager to respawn them. If they haven't exceeded their spawn limits then they are respawned.
So the AI Manager manages the agents and the agents themselves manage their own thinking.
Torque Owner Anthony Cosgrave
Got rid of the AIManager and it's all grand now.