wiki:Quagents AINodes

Version 2 (modified by jpawlick, 13 years ago) (diff)

--

Under the hood all behaviors are implemented as AINodes.

Each Bot in Q3A has an active AINode at all times. An AINode is a function that takes a botstate and implements a certain behavior. They basically represent states in a finite state machine, and contain instructions for what to do while the bot is in that state. More information about the default AINodes in Q3A can be found at http://dev.johnstevenson.co.uk/bots/20585341-The-Quake-III-Arena-Bot.pdf, chapter 15.

The built in Q3 AINodes all return qtrue or qfalse (indicating whether to continue running the AINode loop), but Quagents AINodes may return more codes to signal termination behaviors to the command parser. FIXME: This is probably a bad idea - better to pass the socket and write permissions down to the AINodes?

Quagents do not use any of the built-in AINodes, since all these behaviors are tailored to playing Quake. The following is a list and description of Quagents AINodes. Throughout the Quake code, you will find that Quagents AINodes are prefixed with a "G" for quaGent. The source for all these is contained in code/game/ai_quagentsnodes.c. Generally these nodes will have a one-to-one correspondence with commands in ProtocolZero.

In this file, lines prefixed with an "@" are yet to be implemented.

AINode_GDoNothing

Users should not be concerned about GDoNothing - it is used behind-the-scenes only when there are no standing orders. A user seeking to enter GDoNothing should issue a "forget_all_orders" command.

AINode_GWalkForever

This node sends the quagent walking forward at a speed of 400. The agent will stop before it walks off cliffs, into walls, or into slime or lava.

@ When blocked, cancel behavior and report blocked.

AINode_GJumpOnce

This node asks the quagent to make a single forward jump. It still won't jump off cliffs, into walls, or into slime or lava, though.

@ Report complete or report blocked.