Verlet Integration Ragdolls
Written in C# and Unity (mainly for easy display) Github
Created for my Dissertation Study, in which I achieved a First
Ragdolls in games have always interested me, and particularly older games, like Hitman, where it was close to what you expected, but for a lack of a better term, also janky.
I looked into older Ragdoll simulation methods and stumbled upon Verlet Integration, popularised in games by Thomas Jakobsen. The method is relatively non computationally intensive and quite easy to implement in its most basic form. It isn't the most accurate method, but its speed made it a prime candidate for ragdoll simulation in the early 2000s, but has since been replaced by more accurate methods.
I decided that for my dissertation I wanted to answer whether Verlet Integration was relevant to game development in 2020, looking at potential performance aspects.
My implementation of Ragdolls follow the same principles as Jakobsen's demonstration, every circle you see is a "Particle" which if unconnected to other particles will naturally interact with its environment and apply to basic simulation properties such as gravity.
Individually these aren't particularly impressive however, stick constraints allow the user to create rigid bodies out of combined particles, by maintaining a fixed length between the two. My ragdoll prefab is generated by connecting particles through stick constraints to create a representation of human anatomy. Areas such as the chest that do not deform are reinforced together with polygonal shaped stick constraints, whilst the arms and legs are only loosely connected, so that they can swing independently from the rest of the body. A tug on one limb will drag the rest of the body with it, and allows the compound shape to imitate a limp human body.
Below you can see the ragdoll in a static pose after it has fallen.
I looked into older Ragdoll simulation methods and stumbled upon Verlet Integration, popularised in games by Thomas Jakobsen. The method is relatively non computationally intensive and quite easy to implement in its most basic form. It isn't the most accurate method, but its speed made it a prime candidate for ragdoll simulation in the early 2000s, but has since been replaced by more accurate methods.
I decided that for my dissertation I wanted to answer whether Verlet Integration was relevant to game development in 2020, looking at potential performance aspects.
My implementation of Ragdolls follow the same principles as Jakobsen's demonstration, every circle you see is a "Particle" which if unconnected to other particles will naturally interact with its environment and apply to basic simulation properties such as gravity.
Individually these aren't particularly impressive however, stick constraints allow the user to create rigid bodies out of combined particles, by maintaining a fixed length between the two. My ragdoll prefab is generated by connecting particles through stick constraints to create a representation of human anatomy. Areas such as the chest that do not deform are reinforced together with polygonal shaped stick constraints, whilst the arms and legs are only loosely connected, so that they can swing independently from the rest of the body. A tug on one limb will drag the rest of the body with it, and allows the compound shape to imitate a limp human body.
Below you can see the ragdoll in a static pose after it has fallen.
This doesn't complete the ragdoll however, limbs are free to move inside the main body. There are two solutions to this that can work in conjunction. The first is an inequality constraint, which acts like a normal stick constraint, but only activates when the two offending particles are within a set minimum distance. The other is an angular restraint on limbs such as legs and arms, that prevent limbs from traversing beyond natural human anatomy constraints.
The stick constraints are represented in Green below
The stick constraints are represented in Green below
In the end, my findings were rather positive for this old technique, you can run up to 100 ragdolls at once, with no real performance downsides, in a Unity environment with an un-optimised, single threaded implementation. In my dissertation I concluded that with the ease of implementation and potential of scale, particularly in games like Total War, this technique could see use in scenarios where a "good enough" ragdoll is suitable.