[ODE] cone twist joint & other stuff

Geoff Carlton gcarlton at iinet.net.au
Fri Jan 7 11:14:38 MST 2005

I worked on a ps2 pitch project (a FPS type game) using ode.  It worked, 
but not very well (if you can use a commercial library, go for it).

The things to watch out for are memory fragmentation, as ode goes crazy 
with it, and also general stability.  We had major problems with the 
caches (turn them all off), and the posr allocs/frees screwing us 
around.  A special posr allocator function that picks them off from a 
static array helps in that case - a similar setup to the alloc/free 
handlers but specifically for the posr struct.  Also, due to the various 
colliders its a bit hard to guarantee 0 allocs in and out of a game, 
which is a problem.  Lastly, because of static containers ode also does 
not shut down properly (in terms of 0 allocs at dClose), at least until 
some tweaking is done.  So in general, 32Mb is a bitch. :-)

We also had general issues with boxes on the trimesh world jittering 
around - however our game loop was variable, and I expect a fixed 
timestep may have helped a fair bit, plus more liberal autodisable (this 
was pre0.5 to just up to when 0.5 came out).  Also tweaking the 
parameters more may have helped.

The time per frame was problematic, from memory the time was something 
like 10-15ms per frame on average, but it could shoot up to 15-30 or 
more when many ragdolls became active (ragdolls were another fun thing 
to try to get working, in the end the effect was so so) - we had to 
limit it to 2 ragdolls I think, plus 1 "fake" doll used purely for ray 
collision purposes (set up geoms from target pose, ray test that).

Special ps2 ops:  Look out for the math functions, make sure no doubles 
slip in!  In particular I found that it used cos/sin rather than 
cosf/sinf, which on the ps2 is a killer due to its slow emulation.  We 
replaced copysign (which I've never heard of anyway) with something like 
(x*y < 0 : x : -x).  Check all warnings about double-float and remove 
every one.

What you call 'mutable' is best done by a geom without a body and moving 
it around yourself - we had two types of objects, ode bodies, and 
"normal" objects which were moved around with a compeletely different 
system.  Our avatar in particular was a swept AABB using opcode but with 
our own handlers (I wouldn't really recommend this approach though).


More information about the ODE mailing list