Multiple AI Behaviors
by joint heir · in Torque Game Engine · 08/26/2005 (3:01 pm) · 8 replies
HI I need some help on this one. I've developed several types of "AI Logic," for my game. I Have 1) Archers 2) Guards and 3) Pursuit Bots. I can make each category work independently by adding an "AI Manager" to the game.cs file for each logic type.
The problem occurs when I try to run them all together, they all follow only one logic. for example all will act as guards or all will act as pursuit bots... I'm trying to put all the different logic driven bots in the game at the same time so they can interact. What Can I do?
The problem occurs when I try to run them all together, they all follow only one logic. for example all will act as guards or all will act as pursuit bots... I'm trying to put all the different logic driven bots in the game at the same time so they can interact. What Can I do?
About the author
#2
08/26/2005 (4:20 pm)
Make one AIManager that does all three tasks, based on what properties the bots have on them?
#3
Example: Archers - shoot, Pursuit Bots - chase. Furthermore, using the "AI Manager" technique will only allow one datablock to be called in the AI script files. I have different datablocks and models for each logic type of bot.
08/26/2005 (5:00 pm)
Ben, I've thought of doing that, but my goal is to limit each type to their task.Example: Archers - shoot, Pursuit Bots - chase. Furthermore, using the "AI Manager" technique will only allow one datablock to be called in the AI script files. I have different datablocks and models for each logic type of bot.
#4
Then just set properties on the appropriate bot instances. No requirements on datablocks at all.
08/26/2005 (6:35 pm)
You can limit 'em however you want with a single AI Manager.if(%bot.isArcher)
{
// do archer logic.
}
if(%bot.isPursuit)
{
// do pursuit logic.
}Then just set properties on the appropriate bot instances. No requirements on datablocks at all.
#5
08/26/2005 (6:48 pm)
Thanx. I'm on it...and I've got some new ideas too. I'll tell you how the fix goes...
#6
08/27/2005 (2:13 am)
Cool beans!
#7
I have bots that inflict damage via the %bot.applyDamage() function, and once they've killed me off, the engine locks up and I can't respawn. It is fine when they kill each other but once they attack me the game all but freezes on me...
I'll be looking for your reply
thanks again!
08/27/2005 (5:38 pm)
Hey Ben, I got it to work. Lot's of Bots battling each other! The .cs file is HUUUUGE THOUGH! Not too much of a problem, but I do have only one other concern...I have bots that inflict damage via the %bot.applyDamage() function, and once they've killed me off, the engine locks up and I can't respawn. It is fine when they kill each other but once they attack me the game all but freezes on me...
I'll be looking for your reply
thanks again!
#8
_If_I'm_right_, you'll need to change your script to check to see if the player is alive before acting, in whichever way is appropriate. I'm not to big on the details, but there are people around who are.
08/29/2005 (10:17 am)
I'd guess your AI is looking for you, but doesn't react well to your not existing as a live object._If_I'm_right_, you'll need to change your script to check to see if the player is alive before acting, in whichever way is appropriate. I'm not to big on the details, but there are people around who are.
Torque 3D Owner Brandon Maness
Update TGE with the 'Enhanced Debugger' resource, and use Torsion, or TDEV to step through your AI script code during runtime to discover the problem.
B--