I switched my game's physics engine from Bullet to ODE. Here are my thoughts...

237 views
Skip to first unread message

alan.wi...@gmail.com

unread,
May 7, 2019, 12:35:46 PM5/7/19
to ode-users
I've been using Bullet since 2007 and spent about a week switching it ODE. I wrote this up in case someone finds it interesting or has some ideas.

My game: https://github.com/jazztickets/irrlamb/
Gameplay video: https://youtu.be/6iex-aMhUjM

The object of the game is to touch all of the glowing orbs. The gameplay is very simple: you control a small sphere by applying torque to it, with the ability to jump.

The main reason I switched is that Bullet has poor internal edge handling with its collision response. Sometime after 2010 Bullet updated its collision response and I noticed bumpy movement over flat trimeshes.

Video of internal edge problem: https://youtu.be/71jd0g6PsdE
Original bug report: https://code.google.com/archive/p/bullet/issues/706

My temporary solution was to increase the physics update rate from 100hz to 1000hz. However, that still had the occasional problem with higher velocities and changed the gameplay quite a bit. With ODE, the collision response feels great. No more bumps, and the ball handles better. It's hard to describe but the controls feel "tighter" and more predictable with ODE.


-- Jumping --

https://youtu.be/xLZeib-G8Cc

One difference I immediately noticed was my player wasn't able to jump off ledges easily. This video demonstrates when the player is considered touching the ground and is able to jump. The player turns red when no collisions are occuring. In the Bullet version, the ball hugs the floor longer so you're able to jump off later. There's about 50ms difference between the two. My solution was to just allow the player to jump within a certain time window after leaving the ground.


-- Damping --

One minor thing I noticed in ODE was that the timestep affects certain parameters like damping. For example if you change your timestep from 100hz to 1000hz, you need to multiply your damping by 0.1. Same with ERP.


-- Waking bodies up --

By default, the glowing orbs are disabled (asleep in Bullet terms) because in some levels they would roll off a hill or similar once simulation begins. I noticed with Bullet, objects would wake up not when you touched them, but when you got *fairly* close to them. In ODE, you have to come in contact with the geometry to enable them. In certain levels this made hanging orbs harder to get, but at the same time made it easier for levels where they can get away from you.


-- Update Rate --

There was one issue in ODE I was unable to solve that only happens at sufficiently high physics rates (e.g. 1000hz).
Certain levels in the game require you to ride on top of a large object to move it around the map, and I found that I was unable to roll a large sphere with
relatively small mass (1.5 vs player's 1.0) and also a medium sized cylinder with a bigger mass (6.0).

Video example of sphere rolling:
https://youtu.be/UB8vnEBsJCM

Switching from dSINGLE to dDOUBLE in ODE helped a little bit. Increasing the ERP helped a tiny bit but that introduced too much bounce.
In the end, I had to settle for 500hz, even though the problem still occurs in one level (though it's not a big deal).
I imagine the problem occurs because some small value somewhere in the solver is being rounded down to 0. This was not a problem at all with Bullet, even at 10000hz.



Anyway, I'm pretty happy overall with the results of ODE.
Reply all
Reply to author
Forward
0 new messages