Open-World Police Pursuit Prototype
Project Overview
This project is a gameplay systems-focused open world prototype inspired by modern crime sandbox games. The primary focus of the project was designing scalable AI systems that could seamlessly transition between on-foot and vehicle-based pursuit while maintaining responsive gameplay behavior.
The project emphasizes:
AI pursuit systems
Vehicle chase behavior
Multi-state AI decision making
Vehicle possession transitions
Obstacle-aware driving logic
Gameplay system architecture
Debugging and system visualization tools
Video: Gameplay Demonstration β Debug Breakdown
βFeatured Gameplay Systemsβ
Police Pursuit AI System
System Overview
The police pursuit system was designed to create dynamic chases where AI officers can pursue the player both on foot and in vehicles, depending on distance, context, and vehicle availability.
The system supports:
On-foot pursuit
Vehicle pursuit transitions
AI vehicle entry and exit
Possession handoff between the officer and the vehicle
Obstacle-aware vehicle driving
Look-ahead steering behavior
State-driven pursuit logic
Behavior Tree
Responsible for:
Pursuit state selection
Vehicle entry decisions
Vehicle exit decisions
State transitions
AI Character
Responsible for:
On-foot pursuit
Vehicle interaction
Entering and exiting vehicles
State execution
Driving Component
Responsible for:
Steering updates
Aim point generation
Obstacle avoidance
Pursuit calculations
AI Controller
Responsible for:
Decision making
Blackboard updates
Pursuit state evaluation
Behavior Tree execution
Vehicle Pawn
Vehicle Pawn
Responsible for:
Vehicle movement
Steering calculations
Driving behavior
Pursuit Flow
Player Detected
β
On-Foot Pursuit
β
Distance Threshold Reached
β
Locate Available Vehicle
β
Vehicle Entry
β
Controller Possession Transfer
β
Vehicle Pursuit
β
Obstacle Avoidance & Steering Updates
β
Return To On-Foot Pursuit When Necessary
Vehicle Pursuit & Steering System
System Overview
The Vehicle Pursuit System uses predictive steering rather than directly targeting the player's current location.
Instead of steering toward the player, the vehicle calculates a dynamic aim point based on the player's movement direction and steers toward that predicted location.
This creates:
Smoother steering
Better corner handling
Reduced overcorrection
More believable pursuit behavior
Look-Ahead Steering Logic
The vehicle calculates an aim point ahead of the player's movement direction.
Player Location
+
Player Movement Direction Γ LookAheadDistance
=
Aim Point
The vehicle then steers toward the Aim Point instead of directly targeting the player.
Debug Visualization
To aid development and verify AI decision-making, custom debugging tools were implemented throughout the pursuit system.
Debug Features:
Current AI State
Current Controlled Pawn
Distance To Player
Vehicle Entry Conditions
Vehicle Pursuit State
Dynamic Aim Point Visualization
Steering Direction Visualization
Obstacle Detection Debugging
Steering Debug Visualization
These visualizations were used to verify that the AI was steering toward predicted movement locations rather than directly following the player.
π΄ Red Line
Displays the direct line between the police vehicle and the player's current location.
π΄ Red Sphere Traces
Three forward sphere traces project from the front of the vehicle to detect nearby obstacles and vehicles across the pursuit path. These trace results are used to determine avoidance direction and adjust steering while maintaining pursuit behavior.π‘ Yellow Sphere
Displays the current aim point being used by the steering system.
Possession Transition System
System Overview
A major technical challenge was maintaining AI behavior during possession transfers between the police officer and the vehicle.
The system allows AI to:
Enter vehicles
Transfer controller ownership
Continue pursuit behavior
Preserve Blackboard state
Transition back to on-foot pursuit
Possession Flow
Distance Threshold Reached
β
Move To Vehicle
β
Enter Vehicle
β
Controller Possesses Vehicle Pawn
β
Blackboard Updated
β
Vehicle Pursuit Branch Activated
Technical Challenges Solved
Maintaining Behavior Tree Continuity
Possessing a new pawn can interrupt active AI behavior.
To solve this:
Pursuit state information is updated before possession.
Blackboard values are synchronized before transferring control.
State transitions occur in staged steps rather than immediate possession swaps.
Vehicle Pursuit Stalling
Early implementations could cause pursuit behavior to stop updating after entering a vehicle.
This was solved by:
Separating vehicle and on-foot behavior states.
Explicitly controlling pursuit transitions.
Maintaining chase updates after possession transfer.
Steering Stability
Directly steering toward the player created aggressive turns and unstable pursuit behavior.
The solution was to:
Predict movement direction.
Generate dynamic aim points.
Continuously update steering targets.
Debugging & System Visibility
Custom debugging tools were developed to monitor AI decision-making and verify pursuit behavior during development.
These tools were used to validate:
State transitions
Vehicle entry conditions
Possession handoffs
Blackboard synchronization
Steering calculations
Aim point generation
Obstacle avoidance behavior
The debugging system significantly improved iteration speed and allowed pursuit behavior to remain readable throughout development.