A development sandbox built in Unreal Engine 5 to architect, implement, and test advanced AI behaviors and core gameplay systems with a C++ first approach. StalkerAI was born from a single objective: to build a robust, reusable, and high-performance foundation for prototyping advanced combat AI in Unreal Engine 5. This project prioritizes a clean C++ architecture for core systems, using Blueprints for high-level logic and data integration. It serves as both a personal learning journey and a technical showcase of core game development principles.
This repository documents the step-by-step process of implementing key features, including:
- A modular character controller using Unreal's Enhanced Input System.
- A reusable Health, Damage, and Combat system built in C++.
- A flexible blockout arena for rapid level design and gameplay testing.
- Foundational AI behaviors designed for dynamic interaction.
The initial development of this project provided one of the most valuable engineering challenges of my career, cementing the importance of a sound architectural foundation.
The project began with an attempt to merge the Third-Person Template features into a Blank C++ project. This seemingly straightforward approach led to immediate and cascading build failures. After resolving an initial AIModule dependency error in the .Build.cs file, the project remained critically unstable. The core "phantom problem" was identified as intermittent compilation failures, often reporting false out of memory errors.
A deep analysis of the full compiler logs revealed that the root cause was not in the project's code, but in a faulty Incredibuild integration that came bundled with the IDE. The unstable project state, caused by the improper template merge, was triggering bugs in this third-party tool, creating an unpredictable and unreliable development environment.
It became clear that continuing to apply point-fixes was inefficient. The foundation itself was compromised.
Faced with this systemic failure, I made the strategic engineering decision to discard the patched-together project and restart with a clean Third-Person C++ template.
This decision was not a step back, but a crucial step forward. It was a deliberate choice to prioritize long-term project health over short-term progress, eliminating technical debt from day one. The goal was to build a foundation that was:
- Solid: Free from unpredictable "phantom" errors and providing a stable, reliable development experience.
- Scalable: Architected to easily accommodate new, complex systems (weapons, advanced AI, UI) without breaking the core.
- Durable: Aligned with Unreal Engine's best practices, ensuring easier maintenance and future engine version migrations.
- Objective: To establish a stable project architecture and implement a fully controllable player character with a professional-grade locomotion system.
- Tasks:
- Project Setup: Establish a stable C++ project, a clean development environment, and a professional version control workflow with Git & Git LFS.
- Arena Blockout: Create a functional level blockout to serve as a testbed for all gameplay mechanics.
- C++ Character Architecture: Architect and create a shared C++ base class (
SltakerAICharacter) and a dedicated child class for the player (StalkerAIPlayerCharacter). - Player Controller Implementation: Implement camera controls and basic Enhanced Input bindings in C++.
- Animation Integration:
- Data Layer: Implement the
Event Graphlogic to provide theAnim Graphwith real-time data (GroundSpeed,Direction,bIsInAir). - Blend Space: Create a 2D Blend Space for fluid, 360-degree movement, blending Idle, Walk, Run, and Strafe animations.
- State Machine: Build a robust State Machine with dedicated states for
Start/Stoptransitions (to add weight) and a fullJump/Fallcycle (Start,Loop,Endstates).
- Data Layer: Implement the
- Health & Damage System: Develop a reusable C++
HealthComponentand attach it to the base character class.
- Objective: To implement a functional combat loop, allowing for interaction between characters through damage.
- Tasks:
- Weapon System: Implement a foundational C++ weapon system (hitscan or projectile based).
- Core Combat Loop: Add logic for shooting, reloading, and ammo management.
- Animation Layering (Combat): Expand the Animation Blueprint with an
Upper Body Slotto allow for aiming and shooting animations to play concurrently with lower-body locomotion. - Target Dummy: Create a simple AI target dummy that utilizes the
HealthComponentto receive damage and be destroyed.
- Objective: To give the player a rich, acrobatic moveset for navigating the environment.
- Tasks:
- Fall Roll System: Implement a roll to negate/reduce fall damage based on landing velocity, driven by a Root Motion animation.
- Obstacle Vaulting System: Develop a system using C++ line/sphere traces to detect and vault over low obstacles.
- Ledge Climbing/Mantle System: Implement logic for detecting and climbing up ledges.
- Animation Integration (Parkour): Expand the State Machine with new states and logic to handle all new traversal animations.
- Objective: To bring the non-player characters to life with distinct, appropriate AI architectures.
- Tasks:
- Common Enemy AI:
- Configure an
AIControllerand a Behavior Tree for standard combat behavior. - Implement tactical repositioning logic (seeking cover) using custom BT Tasks.
- Configure an
- Ally AI:
- Implement foundational support behaviors (follow, engage targets) using a Behavior Tree.
- Develop a data-driven Utility System as a custom BT Service to allow the ally to make intelligent support decisions.
- Common Enemy AI:
- Objective: To build the signature "Boss" enemy, leveraging a high-performance, animation-driven architecture for complex pursuit.
- Tasks:
- Advanced Traversal Implementation (Player): Implement wall running and wall jumping mechanics for the Player to establish the system.
- Boss AI Architecture: Re-architect the animation logic for the Boss using Unreal's modern State Tree system for maximum performance and fluid transitions.
- AI Parkour Navigation: Use
NavLinkProxiesand custom State Tree Tasks to teach the Boss AI to use all parkour mechanics for aggressive pursuit.
- Objective: To implement the final core mechanics and a basic UI, creating a complete gameplay loop.
- Tasks:
- Player "Downed" State: Develop the mechanic where the player enters a downed state at zero health.
- Ally Support Systems: Implement the ally's ability to provide ammo, heal, and revive the player.
- UI/HUD: Create a basic user interface with UMG to display essential information (health, ammo, ally status).
- Character Controller: Fully functional third-person character movement based on Unreal's Enhanced Input System.
- Stable Project Base: A clean and robust C++ architecture ready for feature development.
- Development Arena: A simple blockout level for gameplay testing and iteration.
- Unreal Engine 5
- C++
- Blueprints
- Visual Studio 2022
- Git & Git LFS