Sign in to follow this  
choffstein

Appropriate physics library?

Recommended Posts

Well, this is the first time I will be looking out for my physics needs...though I don't actually know if I need to. I am just looking for possibilities. Basically, in my optimal design, I would want a system that could do a couple thousand sphere-to-sphere and sphere-to-box collisions as fast as possible -- and thats all I need. Nothing more complex than that. Now, I would like my system to be super light weight (not memory intensive, easy to set up, and not an extremely large linked file [though, the last isn't that big an issue]). Also, free. Also, it must be cross platform (so no .dlls). Anyone have any suggestions for me? Should I write my own simple system? I think it would be best to use something tested and tried so that if I want to later, I can easily add in another component. Thoughts? Right now, I am looking at Newton. Has anyone worked with it? The other big names seem to be Novodex, ODE, and Tokamak, though, I have no experience in this field. Help please! Thanks!

Share this post


Link to post
Share on other sites
Evaluate them all and see if they meet your needs. That means probably having to interface each one to your code..

Novodex is commercial, you can use it in non-commerical software only without a license. It will supposedly interface seemlessly to the PhysX card things they are making (so it should be very fast w/hardware accel).

Newton is pretty good, and is portable to Linux and Mac now.

Tokamak ... I hear people who like it but it seems not as powerful as the others.

ODE is open source and free, and a pain to compile on Windows without GNU tools but it works. I noticed it had some numerical problems a bit and wasn't very fast but it is the only open source one available so you can modify it (and release your changes) if you need to. The others are all close source.

I don't know, but they probably will work with alot of simple objects. Newton will get horribly slow if you try to do too many complex things at a time ( like sub-zero fps's....) but there is a Novodex demo with a bunch of rocks that runs about a frame per hour on my Athlon XP ;-) So.. keep it to simplified things as much as possible..

Oh, newton has that tree thing, which is pretty cool too.

Share this post


Link to post
Share on other sites
Quote:
Original post by visage
Well, this is the first time I will be looking out for my physics needs...though I don't actually know if I need to. I am just looking for possibilities.

Basically, in my optimal design, I would want a system that could do a couple thousand sphere-to-sphere and sphere-to-box collisions as fast as possible -- and thats all I need. Nothing more complex than that. Now, I would like my system to be super light weight (not memory intensive, easy to set up, and not an extremely large linked file [though, the last isn't that big an issue]). Also, free.

Also, it must be cross platform (so no .dlls). Anyone have any suggestions for me? Should I write my own simple system? I think it would be best to use something tested and tried so that if I want to later, I can easily add in another component.
Thanks!

Umm the way you phrase it, you make it sounds trivial but it is not. Doing a couple of thousand sphere-to-sphere or sphere-to-box as fast as possible is not something trivial. On top of that you want it to be light weight on memory and free, among other things.

The question you have to answer first is can I do it myself? If you think you can come even close to those specifications, then you can go with an engine and save yourself time.
Physics engines are not magic wands that do miracles, they use the same algorithms that are written all over the internet, just more polished and optimized.

Good look on that one

Share this post


Link to post
Share on other sites
While a specialized collision system using SSE and what's not may be able to run a few thousand dynamic spheres on a 3ghz system I doubt you will find a full physic solution able to do that. And sphere/box is a little bit more involved.

AFAIK Novodex is the fastest around and I'm pretty sure it can't do that without its magic board :). Not to mention that you will have to design a pretty efficient culling system because the graphic system is going to have a hard time displaying that too...

All I can think of is look into OPCODE, this might be a good place to start. From there design a simple mobile physic system on top of OPCODE, this should run pretty fast.

Note: I'm assuming you want a fully dynamic system, ie: a couple thousand spheres at once, falling from a cliff, etc...

Share this post


Link to post
Share on other sites
Well, I don't know why I didn't announce my purpose for the system...that was dumb of me...but I am going to use it for my particle system, which will play a very big part in my game. Particle collision is really what is necessary. I will be making the particles as big as possible, when I can, but they might get quite small. The game will be 2d, so that should help cut down a lot of the calculations. Thousands is probably an exaggeration...but I would like it to be handle at least 100 at a time. Culling isn't really a possibility, because those particles that would be culled will be in the same sphere anyway.

I think Newton is the one I am going to choose, as I am developing on a Mac.

Any other thoughts, people?

Thanks for the help so far.

Share this post


Link to post
Share on other sites
Quote:
Original post by visage
Well, I don't know why I didn't announce my purpose for the system...that was dumb of me...but I am going to use it for my particle system, which will play a very big part in my game. Particle collision is really what is necessary. I will be making the particles as big as possible, when I can, but they might get quite small. The game will be 2d, so that should help cut down a lot of the calculations. Thousands is probably an exaggeration...but I would like it to be handle at least 100 at a time. Culling isn't really a possibility, because those particles that would be culled will be in the same sphere anyway.

I think Newton is the one I am going to choose, as I am developing on a Mac.

Any other thoughts, people?

Thanks for the help so far.


Well, I imagine you have reasons for choosing an existing solution but Newton (or any other 3d package for that matter) will be overkill. Also, as mentionned earlier Newton really drops from >60fps to 0.00001fps as soon as the object count goes above 100. I have no idea why but this will certainly be a problem. It's a very good library otherwise but you'd better check on their forums if that problem has a known work-around before making your decision.

I know that Novodex has a mode especially designed for particles (no rotational effect) as do Tokamak. But, ok, displaying a couple thousand 2d particles is doable. You still need to be very careful because it's not that trivial. But it can be done.

Good luck :).

aftethought: If you are going to have 2000+ 2d particles on screen you should skip the particle/particle test altogether. From experience it won't look good unless you mean to model something like rocks etc... 2d particles with collision enabled really bring out the 2d constraint (you can tell it's 2d since you loose most of the parralax effect) plus it's usualy quite messy :).

[Edited by - b34r on August 2, 2005 1:21:23 AM]

Share this post


Link to post
Share on other sites
take a look at:

http://home.planet.nl/~woute890/disks.zip (hmm this is for windows, overlooked the mac thing )

there's an input file, where you can put a max of 700 particles. it's a small particle system which shouldn't take to long for you to write yourself.

[Edited by - Airo on August 2, 2005 8:41:25 AM]

Share this post


Link to post
Share on other sites
Oh, ODE is BSD license, my bad. So you can do whatever you like with it.

But now that you say it is for a particle system well. You'd have to do 2000 or so collision tests every frame. Now, if you use SIMD (what is on Mac?) you could do 4x4 sphere tests at a time (Ericson). That would probably be much faster than Newton. What else do you need? Collision query with a BSP tree is cheap. I don't know what more you want or why you need such a heavy duty for particle physics, but maybe it will be cool so I won't stop you.



Share this post


Link to post
Share on other sites
Quote:
Original post by Name_Unknown
You'd have to do 2000 or so collision tests every frame. Now, if you use SIMD (what is on Mac?) you could do 4x4 sphere tests at a time (Ericson). That would probably be much faster than Newton. What else do you need? Collision query with a BSP tree is cheap. I don't know what more you want or why you need such a heavy duty for particle physics, but maybe it will be cool so I won't stop you.

It is not 2000 check, it is 2000 time the complexity of the simulation. Since each ball can be in touch we at must 8 other balls, taking an value of 5 balls that's 2000 * 5 = 10000 collisions test conservativally!
that's only for collision, collision is the faster part of a physics engine.

about Newton this:
http://www.physicsengine.com/forum/viewtopic.php?t=1491&start=0
seems faster than 0.00001 frame per secunds to me.

[Edited by - jovani on August 2, 2005 4:04:46 AM]

Share this post


Link to post
Share on other sites
Quote:
Original post by jovani
about Newton this:
http://www.physicsengine.com/forum/viewtopic.php?t=1491&start=0
seems faster than 0.00001 frame per secunds to me.


I won't take the pain to reboot into Windows to provide a screenshot but if I have to, well, I will. I'm not saying that freely. I really like Newton but the point is that with the current version of the Newton Playground 99 bodies are above 60fps and 100 bodies are around 0.0000000647576fps. Don't know, don't care why. It's my experience with it.

There's nothing wrong about showing that it's not the case anymore but just don't make it look like I and others are making things up. That's not nice.

Share this post


Link to post
Share on other sites
Quote:
Original post by b34r
I won't take the pain to reboot into Windows to provide a screenshot but if I have to, well, I will. I'm not saying that freely. I really like Newton but the point is that with the current version of the Newton Playground 99 bodies are above 60fps and 100 bodies are around 0.0000000647576fps. Don't know, don't care why. It's my experience with it.

Well I am sorry the Newton engine was so horrendous to you. That have not been the case with me, in fact I had seeing plenty of games and demos using the Newton engine that certainly show more than a hundred objects.
One thing they say is that the engine is not using any iterative solver so maybe this is why stacking of hundred of objects is slow, but I am not doing that so maybe for me is okay.

On the bright site you seem to be a true genius that in creating your own physics algorithms as you go alone, which allow for thousand of stacking. I have seen your demos here in the forum and maybe one day your will go on to make the fastest. more robust physics engine ever made, better than Havoc, Novodex, ODE, Newton, True axis, Tokomak.
I am not as smart as you are and for me the Newton engine has worked as expected according to the laws of physics as they are stated, and within the specification they say.

Maybe when you released yours for the public, if I need to stack several thousands object I shelved Newton and take a look at your technology.

Share this post


Link to post
Share on other sites
Quote:
Original post by jovani
[...]


Just what exactly am I supposed to say now? You obviously will twist whatever I might write to take it the wrong way. You see evil where there is none.

As for the personal stuff, it's perfectly uncalled for and full of inexact assumptions...

edit: It appears that you must be some kind of Newton evangelist. I don't need marketing ninjas messing with my free time.

[Edited by - b34r on August 2, 2005 10:16:11 AM]

Share this post


Link to post
Share on other sites
Hey I am not fighting with you and I am not evangelizing anything.
I used ODE and Tokomak before. ODE exact solver is too prompt to blow up and the iterative solvers of both aren’t stable enough for mechanical articulated bodies.
Also I am not twisting anything either, you were the one who said the fps is 0.0000000647576 fps and I thought that, that was an exaggeration since this is the equivalent to 174 days per frame of animation.
Even if the frame counter says that, it can not possible be true

Share this post


Link to post
Share on other sites
Quote:
Original post by jovani
Hey I am not fighting with you and I am not evangelizing anything.
I used ODE and Tokomak before. ODE exact solver is too prompt to blow up and the iterative solvers of both aren’t stable enough for mechanical articulated bodies.
Also I am not twisting anything either, you were the one who said the fps is 0.0000000647576 fps and I thought that, that was an exaggeration since this is the equivalent to 174 days per frame of animation.
Even if the frame counter says that, it can not possible be true


edit: My apologies, today has been a bad day and I'm certainly to blame for putting the discussion in such a bad shape.

Well, glad to read that you are not fighting me.
I explicitely said many times that I consider Newton to be a very good engine. That doesn't mean it's perfect and will fit all situations. At least, not yet.

Of course a frame won't take that long to compute but dropping over 100 cubes in Newton Playground does bring my computer to a halt (ctrl+alt+suppr to kill the app).

Surely this is a problem worth pointing out?
Free Image Hosting at www.ImageShack.us

[Edited by - b34r on August 2, 2005 1:38:54 PM]

Share this post


Link to post
Share on other sites
"Newton will get horribly slow if you try to do too many complex things at a time ( like sub-zero fps's....)"

i was about to evangelize newton but i will just tell my experiences with it:

- it is free for commercial and freeware use (if you can't give them at least proper credit you should be shot aniway)
- it works extremely well with static triangle meshes & cars & cubes etc.. it doesn't have dynamic triangle meshes but they already shown demos of that which will be in next version and it really looks good.
- it doesn't "explode" - it is extremely stable (better than novodex or ode)
- it has a lot of cool stuff, like rendering collision geometry
- it fits into any graphical package, including windows gdi if you really want..
- with compound collision objects you can make miracles
- the material system is a big mess
- portable on mac, windows and linux!!
- really good sdk and documentation
- doesn't rely on object-junk, it is totally procedural
- can be used in practically anyprogramming language

...etc etc.. the only issuse is that it isn't ported to consoles yet and that progress is very slow (the developers really know what they are doing and they are doing it very well and precise), so a built-in raycast car is not yet availible if you are interested in cars but you can use built-in car joint or make your own raycast cars..

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this