The Original Problem
Our incoming-hit detection was too general. Agents knew an attack was approaching, but not exactly where it would land, so their safest response was to dash completely away from the player and leave the active combat space.
Gameplay Engineer
Unity • C# • C++
Precise weapon-path simulation and exact hit-location prediction allowed enemies to evade individual strikes without abandoning the player's threat area.
Our incoming-hit detection was too general. Agents knew an attack was approaching, but not exactly where it would land, so their safest response was to dash completely away from the player and leave the active combat space.
I employed a nuanced simulation of the player's upcoming weapon path to predict when the swing would contact an agent and the exact location of that impact. That precision gave the AI enough information to react to the threatened body area instead of treating every attack as a full-body danger.
The predicted hit location was then submitted to agents, where I had them select and blend a contextual response such as a backward head tilt, left or right head dodge, chest evade, or short step backward. Enemies could avoid the strike while staying close enough to keep combat active.
Iteration resolved late animation playback and improved how the dodges blended into the agent's current state. We also marked selected AI states as non-interruptible so the player still had readable moments when an enemy could be struck without automatically dodging. We also planned to add more dodge animations and directions later on in the project, to make it blend nicer.
The feature became a major combat feature for the unannounced project. I also worked on blocking and parrying behavior that changed the AI response according to the velocity of the player's weapon when it contacted the enemy's weapon.