top of page
Abstract White Texture
Gladiator Arena_edited.jpg

Gladiator Arena

3D Third-Person Combat Game | Unreal Engine 5 | C++ & Blueprint

A melee combat arena game featuring AI opponents and weapon-based combat. Built to practice C++ programming in Unreal Engine and understand the fundamentals of character systems and AI behavior.

Tech Stack: Unreal Engine 5 | C++17 | AIModule | Blueprint

​

Development Approach

I built this as my first C++ project in Unreal Engine to move beyond Blueprint-only development. The architecture uses a base ArenaCharacter class that both PlayerCharacter and AICharacter inherit from, sharing common functionality like weapon pickup and attack states. This gave me hands-on experience with object-oriented design and inheritance patterns in a game context.

The weapon system uses actor attachment to sockets, where pickable weapons in the world can be equipped by overlapping the player's capsule component. Once attached, a BoxComponent on the weapon handles damage detection during attack animations.

​

Key Technical Systems
  • Weapon Attachment System
    • Weapons are separate actors (APickableWeapon) that spawn in the level. When the player overlaps them, the AttachItemTo() function snaps the weapon to a socket on the character's skeletal mesh ("WeaponPoint" for main hand, "DualWeaponPoint" for shields). I used SnapToTargetNotIncludingScale attachment rules to maintain the weapon's original scale while matching socket position and rotation.

​
  • Collision-Based Combat
    • During attacks, I enable QueryOnly collision on the weapon's BoxComponent for the duration of the attack animation. The collision state is managed in Tick() by checking the bIsAttacking flag - when true, collision is enabled; when false, it's disabled. This prevents hits from registering outside of active attack frames.

    • I ran into an issue where hits would register multiple times during a single swing. Fixed this with a CanDetectCollision boolean that gets set to true when the attack starts and immediately set to false after the first hit registers. This ensures one hit per attack animation.

  • AI Combat Behavior
    • The AI character uses the same weapon collision system as the player. The TriggerAttack() function is called from the AI's animation blueprint via AnimNotifies at specific frames. This keeps the attack timing synchronized with the animation without needing complex behavior tree logic for this prototype.

    • When the AI takes damage, ApplyDamage() reduces health and unpossesses the AIController if health reaches zero, effectively disabling the AI. I initially tried stopping the behavior tree with StopLogic(), but unpossessing was more reliable for this simple implementation.​

mermaid-diagram-2026-01-03T14-47-56.png
mermaid-diagram-2026-01-03T14-47-56.png
​Technical Challenges
  • Multiple Hit Detection: Initially, a single attack would apply damage every frame the weapon overlapped the target. Added the CanDetectCollision flag that gets consumed after the first hit, limiting each attack to one damage instance.

  • Weapon Pickup Logic: First implementation allowed equipping multiple weapons by not checking if a weapon was already equipped. Added null checks on MyWeaponActor before allowing new pickups.

  • Collision Timing: Enabling collision for the entire attack animation caused hits to register too early. Moved collision management to Tick() where it's controlled by the bIsAttacking flag, which is set/unset by animation events for precise timing.

 

What I Learned

This project taught me the fundamentals of C++ in Unreal Engine - managing pointers with raw pointers (before learning about smart pointers), using dynamic_cast for type checking, and binding delegates for overlap events. The weapon attachment system showed me how sockets work for equipping items, which is essential for character customization systems. I also learned that managing state with booleans in Tick() works for simple prototypes but becomes messy at scale, which pushed me toward component-based architecture in later projects.

bottom of page