Doric column
David Pittman
HomePersonal ProjectsTeam ProjectsResume
Doric column

Goal-Oriented Action Planning

GOAP image



Quick facts:
Development time: 6 months
Engine: Unreal Engine 2

For my Master's project at the Guildhall, I implemented Goal-Oriented Action Planning (GOAP) AI in Unreal Tournament 2004. This project demonstrates the benefits (for both development and gameplay) of using a planning system for video game AI. As a secondary focus, I developed a suite of useful diagnostic and debugging tools to improve the process of developing the AI.

GOAP is designed to chain actions together to satisfy a goal. In the context of a video game, the AI selects a goal and uses GOAP to formulate a valid and efficient plan from simple, reusable actions. Goals and actions are represented symbolically. Each goal is defined in term of desired world state properties. Actions are comprised of effects (resulting world state properties) and preconditions (properties which must be true for the action to occur).

Building a plan is analogous to pathfinding. Actions are edges in a graph and world states (such as the goal and each intermediate state) are nodes. With this in mind, the A* algorithm is an obvious choice to formulate the plan.

I implemented the GOAP algorithm in Unreal Tournament 2004, replacing the game's AI entirely with my own system. This included optimizing an A* search to perform efficiently in UnrealScript. This was accomplished by allowing the search to be interrupted and continued on a subsequent frame. Efficient performance was also achieved with a scheduler that adds AI planning requests to a FIFO queue and pops one each frame. This prevents two AIs from planning in the same frame.

Based on my experience at Gearbox, I believe in the need for good AI tools. For this reason, a secondary focus of the GOAP project was a suite of diagnostic tools to debug faulty AI behavior. I implemented a system which displays a range of current data regarding an AI and takes snapshots periodically. These snapshots can be reviewed while playing (like rewinding the game) to catch problems after the fact.

Technical Design Document: DOC 103 KB
Video: WMV 542 KB
This video is from my proof of concept prototype and demonstrates an AI evading the player through use of a single goal (GoalTakeCover) and action (ActionGoToNode).


GOAP image GOAP image