Game Development Community

AI Senses code .

by Alfred CLUMSON · in Technical Issues · 03/27/2005 (11:17 pm) · 6 replies

Hello everyone ,
Has anybody used the AI senses code provided on this site ? Iam trying to figure out how to set up a bot to the code in order to test it .
Please help me I'm eager to do some more advanced AI other than the one provided on codesampler.com and I think the AI senses code is great but I just don't know how to get a character to it .
Thank you .

#1
03/28/2005 (2:14 am)
You can't. You're not an SDK owner.
#2
03/28/2005 (8:42 pm)
Hey Gonzo !
Thank you but is there any way I can get a character do things different than the one in codesampler.com ? I can only get a character to walk around a defined path that's all .I wanna be able to do more. by the way ,I've just read about your "incoming" codes to solve Ai problems .let me know when it's ready . but for now please tell me anything else I can do to perform my basic AI code without owning the SDK.
Thank you very much Gonzo ,you're the man !!
#3
04/02/2005 (12:09 pm)
You can do good enough AI with scripts only. Actually, the AiPlayer class is designed so you should use scripts to handle it, given script code is very flexible and easy to change, and AI is something that requires lots and lots of tweaking to get right.

The AiPlayer class exposes the following methods to script:

stop()
clearAim()
setMoveSpeed( float speed )
setMoveTolerance(float tolerance)
setMoveDestination(Point3F goal, bool slowDown=true)
getMoveDestination()
setAimLocation( Point3F target )
getAimLocation()
setAimObject( GameBase obj )
getAimObject()

You can use the setImageTrigger shapeBase method to set triggers for an AI player. Triggers are used as "buttoms" by the move structure. The Torque demo uses trigger[0] to primary weapon fire, trigger[1] to secondary weapon fire and trigger[2] to jump. That trigger mapping is all coded in C++, so you can't change it without a SDK license, but the weapon "firing" is actually a callback on the imageData mounted to the player's hands (mount0), so it can be used to activate whatever items you mount to the player.

With all those methods, plus console functions for radius search and raycasting for object searching and LOS checking, and the schedule functionality you can script your AiPlayers to do interesting stuff without a single line of C++.
#4
04/04/2005 (1:58 pm)
Thank you Manoel , but I have one more question : where can I find a documentation(link) about the diffrents fields and methods of AiPlayer class.
anyone else can answer please ! Thanks a lot.
#5
04/04/2005 (2:03 pm)
Try doing this, start the demo, go into Mission edit mode and select kork, pay attention to his number.
Exit mission editor and open a console then type "xxxx.dump();" where xxxx is the ObjectId for Kork.
#6
04/04/2005 (4:52 pm)
XXXX.dump(); works better. or...

xxxx.dump();


makes it clearer, gives it a cosole looking format imho...;), never sure with the quotation marks...I keep thinking they're some kind of string....