Sponsored By

Feature: 'Ragdoll Physics On The DS'

In <a href="http://www.gamasutra.com/view/feature/3916/ragdoll_physics_on_the_ds.php">this technical feature</a>, Sensory Sweep Studios' senior programmer Eric Brown explains the Verlet integration method for ragdoll physics, and how it enables sophistica

January 29, 2009

3 Min Read

Author: by Staff

In this technical feature, Sensory Sweep Studios' senior programmer Eric Brown explains the Verlet integration method for ragdoll physics, and how it enables sophisticated tech goals on the Nintendo DS. Though the Nintendo DS's computational power is certainly limited when compared to its bigger console brothers, Brown says programmers can still implement ragdoll physics on the handheld, provided that they dismiss their restricted expectations of its performance. The idea he used to successfully include ragdoll physics was the common Verlet integration technique: "The Verlet particle system is ideal for representing a ragdoll skeleton because constraints can be infinitely rigid without causing the system to diverge, thus the distance between joints can more rigidly be maintained. For this reason, you may find that a Verlet particle system is a nice thing to have around, even if you are not planning on doing any ragdoll physics. The main idea behind the Verlet integration approach to ragdoll is that the positions of the joints are determined by point particles. The 'bones' of the skeletons, represented by length constraints that enforce two neighboring particles, are an exact distance apart. Extra length constraints can be added as necessary to prevent unnatural poses, as well as self intersection of the ragdoll. Updating the positions of the particles is relatively inexpensive, and calculating a length constraint is the equivalent of resolving a sphere collision, so the overall cost of updating the particle system is pretty low." After updating the positions of all of the particles and applying constraints to ensure the appropriate distance relationships between them, programmers can add collision. "I decided to allow the particles to collide with the world as independent spheres, rather than trying to construct a closed collision volume that encompassed a ragdoll limb. This decision was based on two factors. The first was the cheapness factor-sphere collision is much cheaper than some kind of ellipsoid or oriented bounding box collision. The second was that I succeeded in convincing the artists and designers who were creating the collision worlds to "play nice" with the ragdoll -- meaning that they should try to make the static collision geometry as smooth as possible, with no really sharp kinks or protrusions that the ragdoll might get hung up on. However, I still ran into pretty big problems using this approach. If you are using spheres to represent the collision volumes of joints, then the spheres generally need to be pretty small. After all, they are representing things like a hand, shoulder, or hip. Using such small spheres, I immediately began to notice that all of my collision routines would generally fail, due to the numerical imprecision introduced by fixed-point arithmetic." You can read the full technical feature, which details what Brown learned in order to overcome those precision-related issues, as well as how he interfaced with the animation system (no registration required, please feel free to link to this feature from other websites).

Daily news, dev blogs, and stories from Game Developer straight to your inbox

You May Also Like