Jump to content


Animation-driven physics in Doom 3


  • Please log in to reply
2 replies to this topic

#1 RPGista


    Advanced Member

  • Member
  • PipPipPip
  • 1672 posts

Posted 05 February 2019 - 11:26 AM


Hey, have you guys seen this?




"Suppose a game character needs react to the direct impact of a bullet on its body. Trying to achieve this accurately for all possible impact positions under all possible conditions using only an animation system would require an enormous set of available animations to choose from. Only then, impacts would fit nicely with the any previous pose and activity.

Alternatively, the animation system (and possibly other systems, like inverse kinematics) could be used to generate a frame-by-frame pose that acts like a target to drive an actual physically simulated character body towards. This would be a bit like having a virtual puppeteer (the animation system) control a simulated marionette (the simulated character body, or rag doll). Obviously, you could try to set the simulated pose instantly to mimic the target pose, but this would simply hamper and override the physics simulation, causing it to break in various ways.

Instead of using infinitely strong marionette strings, it’s better to drive the body by relatively weak virtual springs. This way, the physics simulation always has the final say. For example, the body would normally match the animations closely. But when shot, the body would receive a physical push from the impact. This impact will push the pose away from the target pose, stretching the springs. Consequently, the stretched springs will start to push back towards their rest length, restoring the actual pose to the target pose over the course of a (fraction of a) second."


Theres a full article explaining the mechanics, as well as a download link for the the source code. The result is bizarrely interesting. A thing that pushes itself pysically no matter what direction its facing, and reacts in real time to force (impact, bumps in direction).



It would be brilliant to have TDM AI reacting more organically to force/damage, specially when hit by arrows, sword blows or thrown objects.

  • lowenz, jaxa, nbohr1more and 3 others like this

#2 i30817



  • Member
  • PipPip
  • 453 posts

Posted 06 February 2019 - 08:16 AM

Sounds too expensive for your average trash machine. Also a bit telling that the example they choose to demonstrate their code was a parody npc that can't get into a 'wrong' position. I suspect they tried with a normal body and got something that was hilariously uncanny valley.

  • stgatilov likes this

#3 RPGista


    Advanced Member

  • Member
  • PipPipPip
  • 1672 posts

Posted 06 February 2019 - 11:31 PM

Yeah, Im not sure about the performance cost, though this scene running quite a few of the creatures seemed to do fine. Whats is very interesting is that he added support for motor drives for hinge and ball-and-socket joints, which is something that appearently wasnt supported by the engine before. This allowed for a moving character that uses actual physics to propel itself foward using the floor, which then translates to the whole IK rig, instead of the character "gliding" through the floor as it is carried by the root bone (the movement speed being set by the animation used).


But the most interesting to me was the direct relation he achieved between character and world space physics, and how the monster reacts to force and gets bumped and pushed around and keeps on going organically. We have a couple of "hurt" animations which are fine but rather generic, they play whenever the characters suffer a blow or an impact of some sort, no matter where it was. It would be amazing to see characters reacting in real time to small forces, getting their heads nudged by a stone youve thrown at them, or an arm shoved back by the impact of an arrow or sword. If its doable or not, cant say. But its food for thought.

  • Anderson likes this

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users