

AI State
Machine
In order to simplify AI logic and make it manageable for all the states and their tasks, We use a hierarchical state machine to update the AI driver every frame, and after updating the state, we use an Unreal behavior tree to carry out the tasks AI should do for its current state. This decision makes it super easy and straightforward to debug states and tasks for our AI system.
AI Behavior
Tree
Unreal's Behavior Tree editor allows AI tasks and their corresponding execution order under different states to be organized from a more holistic perspective compared to Blueprints.
Encapsulated tasks can also be duplicated and distributed to the sequences of other states as needed when the logic changes, reducing repetitive work and allowing quick identification of insertion points and execution order.


TGP2
turning
perception
Turn Perception is a system I set up in AI to analyze information about splines placed by Level Designers.
By scanning and collecting tangent data from the splines, the system determines entry, mid-turn, and exit points of a curve. Based on the vehicle's orientation and the curve's information, AI drivers will decelerate and move to the outer line when approaching a turn, gradually move to the inner line during the turn, and accelerate when exiting the turn.
This analysis logic helps the AI reduce the time spent turning and enhances its competitiveness against players.

![]() | ![]() | ![]() | ![]() |
---|---|---|---|
![]() | ![]() |