Building Open-Source Euphoria-Style Hit Reactions for Godot
Euphoria's physics-based character reactions have been locked behind proprietary tech for 18 years. I spent six days building Kickback, an open-source Godot plugin that brings the same principles to indie developers.
Every game developer has seen that moment in GTA IV. You shoot an NPC on a staircase and they don’t play a canned death animation — they stumble, grab the railing, lose their grip, and tumble down in a way that’s never quite the same twice. That’s NaturalMotion’s Euphoria engine. It’s proprietary, it’s been unavailable to anyone outside a handful of AAA studios since 2006, and no open-source alternative exists.
I spent six days building one for Godot. The result is Kickback — an MIT-licensed plugin that brings physics-based hit reactions to any humanoid character.
What Euphoria Actually Does
Most games handle hits one of two ways: play a canned animation (“hit_front”), or toggle full ragdoll on death. Neither produces the rich, emergent reactions you see in GTA or Red Dead Redemption.
Euphoria’s insight is that characters are active agents trying to survive. They don’t just fall — they brace against walls, windmill their arms for balance, take corrective steps to avoid going down. Every bone in the body is physics-simulated, but a layer of intelligence fights to keep the character upright.
The result is that every hit is unique. A running character tumbles forward. A standing character staggers sideways. Repeated shots visibly wear someone down. The same gun, the same target, the same angle — different outcome every time.
That’s the bar. Kickback doesn’t fully clear it, but it implements many of the same underlying principles.
The Spring Approach
Kickback creates an invisible physics rig of 16 RigidBody3D bodies connected by 15 joints, mirroring the character’s animation skeleton. Every physics frame, velocity-based springs pull each physics body toward the animation pose. When springs are at full strength, the character perfectly tracks their animation. When a hit reduces spring strength, physics wins and the body reacts.
The core is surprisingly compact:
# For each of the 16 bones, every physics frame:
var target_rotation = get_animation_bone_pose(bone_index)
var current_rotation = physics_body.global_transform.basis
var rotation_error = (target_rotation * current_rotation.inverse()).get_euler()
var target_angular_velocity = rotation_error / delta
var blend = strength # 1.0 = animation, 0.0 = ragdoll
physics_body.angular_velocity = physics_body.angular_velocity.lerp(target_angular_velocity, blend)
When a bullet hits, strength drops from 1.0 toward zero in the affected region. The character’s body reacts to the impact force while springs in unaffected areas keep the rest of the body tracking animation. Over time, strength recovers and animation regains control.
Five impact profiles ship with the plugin — bullet, shotgun, explosion, melee, arrow — each producing a distinct reaction:
Why Not PhysicalBone3D?
Godot has a built-in PhysicalBone3D node. It seems like the obvious choice for a ragdoll system. The problem: it’s missing critical methods.
| Feature | PhysicalBone3D | Dual RigidBody3D Rig |
|---|---|---|
apply_force() | No | Yes |
apply_torque() | No | Yes |
| Collision signals | No | Yes |
center_of_mass | No | Yes |
contact_monitor | No | Yes |
Without apply_force(), you can’t build a spring system that applies continuous corrective forces. Without collision signals, you can’t detect hits. Without center_of_mass, you can’t track balance.
So Kickback builds its own rig: 16 RigidBody3D bodies with anatomically-distributed masses (hips at 15kg, head at 5kg, hands at 1kg each), connected by Generic6DOFJoint3D joints with anatomical angular limits. Every physics frame, the transforms of these invisible bodies get written back to the visible skeleton as bone pose overrides.
More infrastructure, but it unlocks everything the system needs.
The Counterintuitive Parts
Three things surprised me during development:
Animation never stops. Even when a character is fully ragdolled on the ground, their animation keeps playing. This feels wrong — why animate a limp body? But the spring resolver needs target poses. Without animation providing “here’s where normal is,” the springs have nothing to pull toward and recovery becomes impossible.
Timers look fake. Early stagger used a fixed timer: wobble for N seconds, then recover. The problem was visible — a character that had already regained balance kept wobbling, and one clearly falling would snap upright when the timer expired. The fix was physics-informed balance tracking. The system computes center of mass (mass-weighted average of all 16 body positions) and compares it to the support polygon between the feet. Regain balance early? Stagger ends early. Lose balance regardless of the timer? You ragdoll.
The wobble must never repeat. Stagger sway uses irrational frequency ratios (1.73x, 2.17x) so the oscillation pattern mathematically never repeats. Perpendicular drift creates figure-8 motion. Each stagger gets a random phase offset. The result looks organic and hand-animated — but it’s entirely procedural.
Six Days, 94 Commits
| Day | Focus | Milestone |
|---|---|---|
| 1-2 | Foundation | Dual skeleton, velocity-based springs, 5 weapon profiles, get-up recovery |
| 3 | Architecture + stagger | Resource-based config, skeleton auto-detection, stagger state, momentum transfer, cumulative pain, regional injuries |
| 4 | Active resistance | Per-bone dynamic spring adjustment, organic sway, 59 automated tests |
| 5 | Integration testing | Tested with real FPS game, fixed 8 integration issues |
| 6 | Public release | v0.7.0 on GitHub, demo GIFs, documentation |
Final count: 59 tests with 161 assertions, 10 interactive demo scenes, 1,600+ lines of documentation, and 35+ tunable parameters — all exposed as Godot Resources with zero hardcoded values.
What’s Missing
Kickback implements the muscles. What’s missing is the brain.
Euphoria characters take corrective steps when off-balance. They windmill their arms. They reach for nearby walls and railings. They generate fully emergent poses without animation targets. Kickback characters don’t do any of that — they’re passive spring systems that get pushed around by physics and pulled back by springs.
The roadmap includes procedural stumble steps, arm bracing, and environmental grabbing. But those are hard problems — each one is a significant project on its own. For now, the spring system handles the spectrum from subtle flinches to full ragdoll, and the stagger state fills the critical gap between “standing” and “collapsed.”
What I Learned
Fight the engine when the API is wrong. PhysicalBone3D exists, and building a parallel rig felt wasteful. But the missing methods were non-negotiable. Sometimes the built-in tool isn’t the right tool.
Velocity-based springs beat joint spring parameters. Jolt’s built-in joint springs are poorly documented, have coordinate space issues, and flipped axes. Manual velocity lerping is simpler, debuggable, and scales uniformly. The V-Sekai community and the Jolt physics creator both recommend this approach.
Physics needs active animation. The counter-intuitive decision that unlocked everything. Ragdoll without animation targets is just a collapsing skeleton.
Center of mass beats timers. Timer-based state transitions feel arbitrary. Physics-informed balance tracking responds to what’s actually happening to the character, and players can read it intuitively.
Documentation is the last 20% that takes 30% of the time. 1,600 lines of docs, 10 demo scenes, 5 GIF captures — this is what makes a plugin usable vs. just functional. Nobody will adopt a physics system they can’t see working.
Try It
Kickback is on GitHub. MIT licensed. Godot 4.6+ with Jolt Physics. Two clicks to add to any humanoid character, one line of code to send hits.
Pull requests welcome — especially if you have non-Mixamo skeletons to test with.