Roleplaying Open World Prototype
Gameplay Systems 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
⭐Featured Gameplay Systems⭐
Police Pursuit AI System
System Summary
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.
System Support
On-foot pursuit
Vehicle pursuit transitions
AI vehicle entry and exit
The possession handoff between the officer and the vehicle
Obstacle-aware vehicle driving
Look-ahead steering behavior
State-driven pursuit logic
AI Detects Player
→ Begins On-Foot Chase
→ Evaluates Distance To Player
→ Searches For Available Vehicle
→ Requests Vehicle Entry
→ Transfers Possession To Vehicle
→ Begins Vehicle Pursuit
→ Adjusts Steering Toward Dynamic Aim Point
→ Avoids Obstacles During Chase
→ Returns To On-Foot Pursuit When Necessary
Technical Breakdown
The AI Combat Coordinator acts as a central decision manager for enemies in combat.
When an enemy detects the player and reaches a suspicion threshold, it registers itself with the coordinator. The coordinator evaluates the list of active enemies and grants attack permission to one AI at a time.
Other enemies remain active but are placed in a waiting state, where they circle the player and maintain pressure until the coordinator grants them permission to attack.
This approach prevents enemy overlap while maintaining the illusion of coordinated group combat.
Blueprint Logic
Enemy Registration
When an AI's suspicion meter exceeds a threshold:
AI sends a RequestAttackPermission call to the Combat Coordinator.
The coordinator stores the AI reference in an Active Enemy Array.
If no attacker is currently active, the coordinator selects one.
Attack Selection
The coordinator:
Checks if CurrentAttacker is empty
Selects an AI from the registered enemies
Sets that AI as CurrentAttacker
Updates its CanAttack flag
This flag is read by the AI’s Behavior Tree to enter the attack state.
Behavior Tree Integration
AI behavior trees reference the coordinator through blackboard variables.
Typical flow:
Selector
├── Attack Player (if HasAttackPermission)
├── Circle Player (if WaitingForTurn)
└── Investigate / Chase PlayerThe HasAttackPermission value is controlled by the coordinator.
Circling System
Enemies waiting for their attack turn move around the player instead of standing still.
The circling position is calculated by:
Getting the player location
Generating an offset position around the player
Using vector rotation to distribute enemies around the player
This ensures enemies maintain spacing while remaining threatening.
Challenges & Solutions
Multiple AI Attacking at Once
Initially, enemies would attack simultaneously when they detected the player.
Solution
Implemented a centralized attack permission system that ensures only one AI can enter the attack state at a time.
Idle AI Standing Still
Enemies waiting for their turn felt unnatural when standing still.
Solution
Added a circling behavior that generates dynamic positions around the player, allowing enemies to reposition while waiting.
Combat Flow
Without coordination, combat encounters felt chaotic and overwhelming.
Solution
The coordinator system regulates attack timing and enemy positioning, creating combat that feels intentional and readable for the player.