Physics Engines: Which is the fastest?

Blitz3D Forums/Blitz3D Beginners Area/Physics Engines: Which is the fastest?

Rick Nasher(Posted 2014) [#1]
I believe the most popular ones are ODE, Newton, PhysX and Bullet.

But: which one is the fastest and has the best implementation of features?

It's for usage in a 3rd person shooter featuring a free roaming world in which one can walk, run, jump, climb, fall, swim, use vehicles like cars, planes, helicopters, etc, a range of weapons and of course has to combat enemies.

Only one I've really tried in my code is PhysX, but it seemed a bit sparse on documentation and slowing down FPS quite a bit.


Yasha(Posted 2014) [#2]
PhysX relies on hardware acceleration for best performance. On low-end GPUs it is unusably slow for complex scenes as a result. On the other hand, a scene you need hardware acceleration for probably isn't going to work on the CPU anyway. PhysX probably has the biggest feature set (breakable things, soft things, tearable cloth etc.).

ODE is not hardware accelerated. It's also pretty old and not under active development any more. I assume this means it's less optimised than newer ones. ODE is extremely basic featurewise: you have solid objects, they have mass, they can be connected by joints, the end.

Bullet seems to be the system of choice for game engines that bundle physics, except for Leadwerks which bundles Newton. Make of that appeal to authority what you will. I think Newton is simpler than the others as well in terms of features, don't know.


However, if you really care about optimisation, you should optimise your scenes to prevent complexity rather than hoping your engine is capable of just swallowing it. A standard shooter game simply doesn't require a powerful physics engine: you don't need it anyway for player, NPC or most vehicle movement, or many weapons, and any of the above will handle boxes-barrels-'n'-ragdolls well enough for production use. Keep it simple and things will stay fast (most physics engines also don't bother simulate objects that are "dead", i.e. not moved in the last second or so, so the scale of the overworld won't affect performance on any of them). If things aren't fast it's most likely the scenario's fault and won't be fast in any of them.

A few hundred static objects of standard geometric shapes will be no trouble to any of those engines. Just choose the simplest one that meets your game's needs. (So you should probably avoid PhysX.) If your scenes regularly involve stuff more complicated than ~50 live geometric objects, this isn't really shooter territory any more and you should reassess your needs accordingly.


RemiD(Posted 2014) [#3]
I have done some tests with JVODE, Bullet, Newton, Devil physics engine and for the exact same scene with moving/spining bodies (spheres, cubes, cylinders, wedges, pyramids, cones) against others moving/spining bodies and against static meshes, i have found that bullet is faster than the others.
It depends on what you want to do...


fox95871(Posted 2014) [#4]
I tested out a bunch of em a while ago when I was new to dlls. Overall, I thought BlitzODE was the best. The only problem I ever had with it was I never figured out how to free a level mesh, so you'd have to use one huge physics mesh for an entire game. On the other hand, I doubt that'd be a problem since it's not rendered if I remember right. In general though, I just loved how by basically adding a few Includes, viola: my game had physics! It's quite awesome, and I'm sure took a zillion years to program.


Blitzplotter(Posted 2014) [#5]
I had great fun and productivity with JV-ODE, cant tell you about speed comparisons though.


Rick Nasher(Posted 2014) [#6]
Many thanks guys, very useful info.