• Advertisement
Sign in to follow this  

Physics Engines Appraisal

This topic is 4329 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi All, For my final year project at uni, I am investigating the effect of physics simulation on "presence" in virtual environments. The basic idea is to create a demo, like a house, where as much as possible is physically modelled and interactive. Once this demo is built, I would run some experiments with users and so on. I decided to use the Ogre3D engine for the graphics side of the demo, since it has an excellent feature set, is well designed using OO etc, and most importantly has great documentation/tutorials and a very active forum community. Since this is research project rather than a programming one, I didn't want to spend ages integrating a physics engine so I limited myself to those that had wrappers for Ogre already: Newton, ODE and PhysX. In the end I went for PhysX, my main reasons being: - It's fast - From what I can gather, it's as accurate as the other two and faster. - Good set of built in features - Excellent set of tutorials - NxOgre wrapper in active development, with a very helpful dev. - Free since my project is purely academic. I'm trying to write up a section in my report, giving an overview of the technology choices I made - but I'm finding it very hard to get concrete information on the various pro's and con's of particular engines (aside from comments in forums). Since the PPU has been released, the Ageia site is full of marketing hype for that... The Newton site just doesn't seem to say much at all... ODE has a 98 page manual from which I'm trying to skim through any relevant sections. I'm also reading Chris Hecker's articles on rigid body dynamics, and Baraff's siggraph 97 stuff to get more understanding of how physics engines in general work. Basically, what I need your help with, is finding some more concrete information on the pros and cons for the engines mentioned; and information on the underlying methods and implentations used in them. If you have links to articles/papers/official docs that would be ideal. However if you have some in-depth knowledge yourself, and could shed some light, that would be great also. Not meaning to offend, but if it is the later could you please mention why I should believe you. =p i.e. how you aquired such knowledge. Thanks in advance for any replies - really appreciate any help/pointers you can give! =) -[ salmod ]- [Edited by - Salmod on April 19, 2006 7:14:17 AM]

Share this post


Link to post
Share on other sites
Advertisement
Cheers for the reply :)

I would be grateful if you could give me some reasoning as to exactly why you'd say PhysX is the best out of the three?

I've been to the Bullet forum before, tried using their search thing, and haven't really been able to find what I was after either. Do you think I should try posting there as well?

Google (on this site and the web) has led me to the Baraff and Chris Hecker stuff, which is an interesting read - but still nothing specific to the engines in question.

I had a quick flick through the paper you mentioned - again it seems to be on the underlying theory for simulating physics, and doesn't use or mention any of the engines in question...

I suppose my question could be rephrased - without planning and executing some kind of rigorous practical performance shoot out with the engines in question, how would you go about writting a comparison of them?

Share this post


Link to post
Share on other sites
I just noticed this post over at the Bullet forums: http://www.continuousphysics.com/Bullet/phpBB2/viewtopic.php?t=262. It's a fairly old comparison of some physics engines(mainly Novodex vs Tokamak), but fairly useful nonetheless. Still not a huge help to me, so any more links/articles/info are welcome! ;)

@tomek_zielinski2

Could you please give me some reasoning as to why you think ODE is so bad?

Isn't the PhysX 6-degrees-of-freedom joint as good as a custom joint?

I don't need the PPU at all, but it could be useful in the future if I was to add say fluids to the demo - so having that option open is still a plus in my book. Also, this is not an engineering simulation or anything, so as long as stuff behaves reasonably accurately - in line with an average users expectation of how a certain object should behave (so that someone playing the demo doesn't think "omg that is ridiculous!"), then that is fine.

As I mentioned, I have already started using PhysX, for the reasons above - the strongest of which are the excellent wrapper for Ogre and the good documentation and tutorial set.

Thanks again for the input so far - more is definitely welcome! ;)

Share this post


Link to post
Share on other sites
Quote:
Original post by tomek_zielinski2
PhysX is much faster but is less capable and has strange festures(like "one-sided" materials).


My custom physics engine supports only two primitives: arbitrary convex hulls (any number of planes and their (convex hull) intersections as line segments) and one-sided cubic polynomial patches. By forcing the use of one-sided patches, all interaction topology must form closed volumes (can be concave). Thus, even for networked physics (where objects might end up with deep penetration), the engine can always determine what is inside and what is outside, and do the right thing. The code was greatly simplified by supporting ony these two primitives. Other primitives such as spheres, cylinders, general implicits, can be added later (not needed for the current game).

Salmod, have you seen the Ogre physics testbed/demo [edit: tomek mentioned it: Gangsta (w)rapper]? Not sure what happened to it, but they were switching between a variety of engines.

You might also contact Havok; it is the oldest and most mature commercial physics engine (incorporated Ipion's work/people). Since you are in school, they may allow you to use their software (especially if you were to write a paper comparing Havok to PhysX (perhaps create a higher level interface to allow dynamically switching between the two engines in real-time for the same scenes (or run them in parallel in two windows; that would be very cool: check behavioral plausibility/correctness. You could extend this system to also test against the free engines such as ODE, Newton, Bullet, etc.). Who knows, maybe the results of your work could be used as a foundation for a generalized open physics API...

WRT papers on this topic: I've read a lot of papers- I'm not aware of any paper that provides such a comparison of commercial engines. All the papers discussed new/different ways to perform certain aspects of computational physics.

If you'd like to examine two (relatively) simple impulse-based engines (with source code), see Erin Catto's 2D physics demo and Danny Chapman's Jiglib demo (google this site for the links). I also use an impulse-based design for my current game (relatively simple, fast enough so far).

[Edited by - John Schultz on April 19, 2006 2:54:11 PM]

Share this post


Link to post
Share on other sites
@ John Schultz

I think you are thinking of the Gangsta Wrapper that "monster" was developing: http://www.ogre3d.org/phpBB2/viewtopic.php?t=8291&postdays=0&postorder=asc&highlight=gangsta&start=0

It has some basic framerate comparsions in there, but nothing more in depth than that. It was intended to be the "generalized open physics API" that you suggest, rather than a test bed for engines - unfortunately it hasn't been actively worked on for ages and I'm not sure what happened to monster. :(

Doing the comparsion does sound like a very interesting project - given the lack of explicitly this kind of information at the moment... Unfortunately I don't have the time to do this right now, and it isn't the focus of the project I am currently working on.

@ tomek_zielinski2

Thanks for elaborating! :)

I won't be having anything too complicated in my demo, and unfortunately I don't have the time left to try new engines - I think PhysX will do fine, but like I said, I'm just trying to gather information for writting the formal report. ;)

A couple of last questions for you though. =p In what ways does PhysX cheat in comparison to Newton? And how did you learn this - by observing the behaviour, or something more concrete? I'm not trying to say you are wrong, I've generally heard the Newton is very accurate, but I've not been able to find out exactly HOW it is more accurate than PhysX...

Share this post


Link to post
Share on other sites

**********
IMHO PhysX and Newton are for different purposes and it's pointless to directly compare them.
**********

[Edited by - tomek_zielinski2 on April 19, 2006 3:22:48 PM]

Share this post


Link to post
Share on other sites
Quote:
Original post by Salmod
A couple of last questions for you though. =p In what ways does PhysX cheat in comparison to Newton? And how did you learn this - by observing the behaviour, or something more concrete? I'm not trying to say you are wrong, I've generally heard the Newton is very accurate, but I've not been able to find out exactly HOW it is more accurate than PhysX...


Both Newton and PhysX have made their tradeoffs (IMO neither is very accurate). Years ago I created a (somewhat trivial) "perfect physics" demo to study what correct motion should look like (precession, kinetic energy accuracy, etc.). You should easily be able to set up PhysX and Newton to compare in a similar demo. I'm curious whether PhysX and Newton integrate angular velocity or angular momentum (based on behavior and previous forum posts). The "perfect physics" demo integrates angular momentum (per Baraff), as does my current engine (though I too had to make trade-offs for the game physics engine; it's not as accurate as the simple demo).

Things get tricky when you have to deal with stacking and constraints. That's where general purpose physics engines end up fudging the motion (and making the simple cases also look wrong). For real-world applications such as games, accuracy has been far less important than absolute stability (can't allow the simulation to blow up). The (typical!) end-user/player isn't going to sit their and say "hey- what a rip-off, that crate should have bounced more: it was over damped! I want a refund!). However, now that physics is becoming mainstream, comercial companies will probably start pointing out that their engines are "better" because the are more accurate (realistic). In the early days in GFX, we didn't have bi-linear filtering for textures, then once everyone had bi-linear, MIP mapping was marketed as better, then elliptical/anisotropic, then antialiasing, then number of shaders, etc. The same will probabaly happen with physics engines.

Share this post


Link to post
Share on other sites
Quote:
Original post by tomek_zielinski2
I'm doing vehicle physics - it's very visible in vehicle behaviour which method is more accurate that other.


Cool! How are you modeling the tires? I'll be posting a beta test-demo of my game shortly (well, before E3!). I'll be curious to hear what you think about the flexible tire model I implemented.

Share this post


Link to post
Share on other sites
**** isn't perfect but from my experience, what I've been doing was easier with ****. Less tricks on my side was needed.
Other people can have opposite experiences and it's perfectly good as I'm talking only about my personal feelings and experiences.
Similarly - I don't know exact inner working of neither **** nor ****, I can only guess and/or talk with their developers.

[Edited by - tomek_zielinski2 on April 19, 2006 3:42:07 PM]

Share this post


Link to post
Share on other sites
This is prob a very noobish question, so I apologise, but how do simulations "blow up" when they are more accurate?

Share this post


Link to post
Share on other sites
Quote:
Original post by John Schultz
Quote:
Original post by tomek_zielinski2
I'm doing vehicle physics - it's very visible in vehicle behaviour which method is more accurate that other.


Cool! How are you modeling the tires? I'll be posting a beta test-demo of my game shortly (well, before E3!). I'll be curious to hear what you think about the flexible tire model I implemented.



I've been only doing raycast wheels and rigid body wheels with custom response, nothing fancy/AAA stuff :)


Share this post


Link to post
Share on other sites
Quote:
Original post by tomek_zielinski2
Newton isn't perfect but from my experience, what I've been doing was easier with Newton. Less tricks on my side was needed.
Other people can have opposite experiences and it's perfectly good as I'm talking only about my personal feelings and experiences.
Similarly - I don't know exact inner working of neither PhysX nor Newton, I can only guess and/or talk with their developers.


Ease of use can translate into a better product (the user only sees the end result; the developer may give up because it's too hard to "get it right" in a timely manner).

Have you had a chance to compare Havok to PhysX/Newton? From what I have seen, Havok looks reasonably good, but its not clear where they made their trade-offs (in areas were perhaps PhysX and Newton do a better job, etc.).

Share this post


Link to post
Share on other sites
Quote:
Original post by Salmod
This is prob a very noobish question, so I apologise, but how do simulations "blow up" when they are more accurate?


Stability and accuracy are different things. One method can be stable but not accurate and other can be opposite.

Share this post


Link to post
Share on other sites
But what kind of situations could cause a simulation to "blow up"...? No need to get too technical, but if there is a simple example to explain the concept - that would be nice. :)

Share this post


Link to post
Share on other sites
Quote:
Original post by John Schultz
Have you had a chance to compare Havok to PhysX/Newton? From what I have seen, Havok looks reasonably good, but its not clear where they made their trade-offs (in areas were perhaps PhysX and Newton do a better job, etc.).


I haven't been using Havok so far and most probably won't be in predictable
future :)

Share this post


Link to post
Share on other sites
Quote:
Original post by Salmod
But what kind of situations could cause a simulation to "blow up"...? No need to get too technical, but if there is a simple example to explain the concept - that would be nice. :)


For example spring - if timestep is big enough then Euler will explode instead of oscillate. Google for integration stability.
Also joint configurations coud be deadly when solver cannot determine good enough solution and everything flies towards Mars.

Share this post


Link to post
Share on other sites
Quote:
Original post by Salmod
But what kind of situations could cause a simulation to "blow up"...? No need to get too technical, but if there is a simple example to explain the concept - that would be nice. :)


Probably the easiest way to find out is to create a scene with lots of objects connected with very stiff springs (or constraints), then start bashing the objects in some way (you'll probably have to turn up the engine's fudge-o-tron (whatever it is) to keep it stable (resulting in loss of high frequency motion)).

Another simple example would be to model a car with very stiff springs and go off of a jump. Upon landing, if the system can't handle the spring stiffness, the car will hit the ground and launch into outer space!

Share this post


Link to post
Share on other sites
lol - ok thanks guys, I'll do some more research on that one. :)

Thanks again for all your input so far guys. I think it's fairly clear I won't find any kind of "reference" material for asserting the pro's and con's of these systems. I guess this is due to the fact that the people who make the engines don't want to publicise their bad points! ;)

I think I will stick to listing the actual features of the engines, and then discussing specifically why I went with PhysX.

Thanks again for the help. Feel free to continue discussing though - it's good reading. :)

Out of interest, are you guys allowed to give any details of the projects you are working on? ;)

Share this post


Link to post
Share on other sites
Quote:
Original post by Salmod
Out of interest, are you guys allowed to give any details of the projects you are working on? ;)


You've just reminded me to keep my mouth shut, I've censored my posts to keep lawyers apart, sorry for that.

Share this post


Link to post
Share on other sites
Quote:
Original post by Salmod
Out of interest, are you guys allowed to give any details of the projects you are working on? ;)


Quick screen shot from upcoming beta test-demo:


Up to 64 cars, networked. The military-style vehicle will either be removed or replaced with prettier art (was good test vehicle with high center of mass). Cars drive directly on cubic polynomial patches (patches are dynamically tessellated before sending to GFX card). No shaders or other modern GPU elements currently used (mostly old school rendering (multi-pass env maps, bump mapping, specular effects, simple pre-rendered shadow/outlines projected to contact surface, etc.).

Physics engine is impulse-based with an emphasis on kinetic energy correctness. Cars use a flexible tire model. In the "lab", 300ms network lag is fairly well hidden, even with cars traveling at 300+ MPH. We'll see how it fairs out in the wild of the internet [wink].

Share this post


Link to post
Share on other sites
Quote:
Original post by tomek_zielinski2
Quote:
Original post by Salmod
Out of interest, are you guys allowed to give any details of the projects you are working on? ;)


You've just reminded me to keep my mouth shut, I've censored my posts to keep lawyers apart, sorry for that.


Oh dear - shud've save all that first then! :(

Nice screenie John, sounds v cool! Let us know when the beta is available... ;)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement