share this post:

Combat Systems Engineering • Devlog & Post-Mortem

Action Role-Playing Game (ARPG): Foundational Click-to-Move & Animation-Synced Combat

Role: Solo Gameplay Programmer & Combat Systems Designer • Engine: Unity 3D (C#, NavMesh Pathfinding, Mecanim Animation Events, State Machines) • Inspiration: Classic Isometric ARPGs (Diablo-style responsive click interactivity)
ARPG Click-to-Move Pathfinding
1. Click-to-Move World Navigation: Raycasting mouse clicks onto terrain and calculating real-time pathfinding trajectories.
ARPG Enemy Targeting & Approach
2. Context-Sensitive Click-to-Attack: Distinguishing terrain clicks from enemy targets and automatically closing into weapon range.
ARPG Animation Event Damage Synchronization
3. Animation-Event Combat Sync: Triggering damage calculation and enemy hit reactions on the exact contact frame of the swing animation.

1. The Brief & Task at Hand: Replicating Classic ARPG Interactivity

This project focuses on engineering the foundational combat and movement mechanics of an isometric Action Role-Playing Game (ARPG), inspired by the tactile, responsive combat loops of titles like Diablo.

The primary technical challenge was translating simple mouse-click inputs into fluid, context-aware character actions—where clicking the ground navigates smoothly around obstacles, and clicking an enemy seamlessly paths the hero into melee range and initiates frame-accurate attacks.

2. Core Design Decisions & Implementation Stages

Stage 1 — Click-to-Move Implementation

  • Concept: Detect mouse clicks anywhere on the 3D game world surface via camera raycasting.
  • Pathfinding Logic: Calculate an obstacle-aware navigation path from the player's current position to the clicked coordinate.
  • Execution: Smoothly rotate and move the player character along the calculated path with synchronized run/idle blends.

Stage 2 — Context-Sensitive Click-to-Attack Logic

  • Target Detection: Differentiate via physics layers and tags between clicking walkable terrain versus clicking a hostile enemy collider.
  • Automated Approach & Targeting: When an enemy is clicked outside melee reach, the controller tracks the moving target until entering attack range, then halts movement and initiates the attack sequence.
  • Combat Mechanics: Implemented attack cooldown timers, damage application, health depletion, and enemy hit responses.

Stage 3 — Animation Integration & Animation Events

  • Mecanim State Setup: Integrated full character animation state machines covering Idle, Movement, Attacking, and Taking Damage.
  • Frame-Accurate Animation Events: Utilized Unity Animation Events embedded at the exact impact keyframe of the weapon swing to trigger C# damage application—ensuring enemies react the instant the blade visually connects rather than when the mouse button is first clicked.

Stage 4 — Basic Enemy AI State Machine

  • Proximity & Aggro Engagement: Enemies detect player proximity or incoming attacks within an aggro radius.
  • State Transitions: Cleanly transitions between Idle, Chasing to Attack Range, and Attacking.

3. Playtesting, Friction, Problems Encountered & Hands-On Learnings

  • Problem — Movement Interrupts During Active Attack Swings: In early tests, rapidly clicking the ground mid-swing caused the character to slide while playing the attack animation or fire an Animation Event after the player had already run away.
    Engineering Fix: Locked movement state transitions during the active commitment window of an attack or cleanly aborted pending damage callbacks if movement canceled the swing prior to the impact frame.
  • Hands-On Mastery Gained:
    • Click-and-Move Navigation: Robust raycast input routing and NavMesh character locomotion.
    • Animation State Control: Blending and transitioning multi-state 3D character animations cleanly.
    • Animation Event Synchronization: Bridging visual keyframe cues with deterministic C# gameplay logic.
    • Core Combat Architecture: Modular targeting, range checking, cooldown management, and damage resolution.

4. Outcome & Post-Mortem Reflection

This prototype established a clean, extensible foundation for top-down and isometric combat systems. Synchronizing navigation, target locking, and animation events created a responsive tactile loop ready to scale into deeper skill trees, diverse enemy archetypes, and loot systems in future projects.

← Back to Full Portfolio

Leave a Reply

Your email address will not be published. Required fields are marked *