Game AI Labs
Five exercises covering a patrolling guard, A* pathfinding, steering behaviours, behaviour trees and goal-oriented action planning.
Behaviour Tree Guard · Case study
A Unity guard exercise that moves patrol, chase and search choices into explicit tree branches.
GuardSensors handles range, field of view and occlusion. An Update Perception node writes and preserves target and last-seen data on the tree’s blackboard. Sensing does not run a navigation action by itself.
Chase, search and patrol are represented as separate sequences. Changing the guard’s perception changes which sequence can run, rather than hiding all of the behaviour in a single controller loop.
The patrol lab searches the last position tracked while chasing. This tree writes the last observed position through a separate perception node. Explicit branches make that distinction easier to find than a single loop that senses, transitions and updates movement together.
References
Perception feeds NavMesh chase, search and patrol sequences, separating sensing from action selection.