How to improve performances?
Posted: Wed May 20, 2009 9:56 am
Hi,
I'm almost done porting my game from ODE to Chipmunk. My primary objective was to improve the performances. Since ODE is a 3D physics library, there are useless computations for the extra dimension. Also, I'm doing a lot of gymnastics to prevent the objects from rotating and/or translating in the 3rd dimension. I was convinced that using Chipmunk would improve the performances drastically.
Well, I've been surprise so far, but not in the good sense. The game is very much slower using Chipmunk (I'd say about 2x to 3x slower).
That said, there must be something that I can do to improve and surpass ODE's performances. A typical configuration has about 25 active blocks and 50 static blocks. There are very few joints (<10). I could use segments instead of blocks for the static environment, but I don't want to try this unless I'm sure that the performance gain is worth it.
I think the reason why ODE performs better may be related to the space hierarchy it supports. You can add space inside other spaces, which will improve the collisions detection if done properly (the object should intersect with the bounding-box of a space before trying the individual objects of that space). Is there a way to do something similar with Chipmunk?
I have played with many factors, including the number of iterations, the hash sizes, etc. I get either a slow simulation, or an unstable one.
The platform is the iPhoneOS.
Any idea would be helpful. Thanks all.
I'm almost done porting my game from ODE to Chipmunk. My primary objective was to improve the performances. Since ODE is a 3D physics library, there are useless computations for the extra dimension. Also, I'm doing a lot of gymnastics to prevent the objects from rotating and/or translating in the 3rd dimension. I was convinced that using Chipmunk would improve the performances drastically.
Well, I've been surprise so far, but not in the good sense. The game is very much slower using Chipmunk (I'd say about 2x to 3x slower).
That said, there must be something that I can do to improve and surpass ODE's performances. A typical configuration has about 25 active blocks and 50 static blocks. There are very few joints (<10). I could use segments instead of blocks for the static environment, but I don't want to try this unless I'm sure that the performance gain is worth it.
I think the reason why ODE performs better may be related to the space hierarchy it supports. You can add space inside other spaces, which will improve the collisions detection if done properly (the object should intersect with the bounding-box of a space before trying the individual objects of that space). Is there a way to do something similar with Chipmunk?
I have played with many factors, including the number of iterations, the hash sizes, etc. I get either a slow simulation, or an unstable one.
The platform is the iPhoneOS.
Any idea would be helpful. Thanks all.