Research Article

Artificial Intelligence in Video Games: Towards a Unified Framework

Algorithm 9

Conceptual controls used by the AI in Graven. In order, these are used by the conceptual AI to send commands to apply a steering force to a bot, to rotate a bot toward a certain position, to switch the currently equipped weapon of a bot, and to fire a bot's weapon at a given position. Together, these conceptual controls are sufficient to replicate the intricate behavior from the original code.
//Applies a steering force to a bot
void  ApplyForce(int  agent_id, Vector2D force);
//Rotates the facing direction of a bot
void  RotateToward(int  agent_id, Vector2D position);
//Switches the equipped weapon of a bot
void  EquipWeapon(int  agent_id,  int  weapon_type);
//Fires the equipped weapon of a bot
void  ShootAt(int  agent_id, Vector2D position);