Player swing prediction and dynamic AI dodging

Player Swing Simulation and Dynamic AI Dodging

Precise weapon-path simulation and exact hit-location prediction allowed enemies to evade individual strikes without abandoning the player's threat area.

Engine Unity
Team Endeavor One — Unannounced Project
Prototype Duration 2 Weeks
01

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.

Simulated player weapon path predicting an exact hit location
02

Predict the Exact Contact Point

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.

03

Blend a Localized Dodge

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.

Enemy using a refined dynamic dodge animation
04

Refine the Combat Timing

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.

More Info

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.