Some doubts about Newton. How are your own experiences?

Farinorco

21-03-2007 02:54:28

Hello, I'm making a game engine (well, actually a framework to put a bunch of libraries together, you know, Ogre and some others for sound, physics, etc) for a game, and I've done some heavy internet (and forum) researching about which physic engine I could chose, but I still have some doubts about it. At first sight, Newton seems the most atractive option to me (that's why I'm here! :) ) but I wish to know a little bit more about some drawbacks that I've read:

1) Objects moving at high velocity + collision detection: I've read in several places that objects moving at a "very high speed" often go through other rigid thin objects (like a wall) and doesn't collide with them. But what does "very high speed" exactly mean? A car, maybe a F-1, through a wall? Maybe something more like a firegun projectile? faster than that? slower?

2) Capability to handle a high number of objects: I've read that Newton is particularly bad when it have to deal with lots of objects because its solver has at least a O(n^2) complexity - I asume that the usual is O(n) or so?. In practise, how much impact can have on the game's overall performance? Does it make Newton a bad choice when you have to deal with a high number of objects? If so, what is exactly a high number of objects? Dozens, hundreds, thousands? Is this issue only related to movable (through physic simulation) objects, or also to static collidable objects?

3) Overall performance: aside from the former, how is the overall performance of Newton? As far as I know, it's not its best characteristic, but does it result in a noticeably slower game's framerate than other physic engines as ODE or Bullet? Or shouldn't I worry about that?

Also, I'd estimate any other thing that any of you want to emphasize about Newton with regard to any other physic engine you have used, or about your own experiences with Newton (both possitive and negative ones).

Lots of thanks for reading all this, and lots more for any answer you give me... and sorry for being sooooo boooooring... :oops: :lol:

nikhil

21-03-2007 04:40:37

1) that is with every physics engine.. and so is with Newton. the problems is mostly when the colliding objects are small and fast moving, like bullets fired. it can occur with large objects also, in which case they 'sink' through the ground. but like with most physics engine you've the option to set a continuousCollision mode on, which helps.

2)No idea. I workd with a large mesh and that was fine. by mistake, once I created the physics body for everything in my game (things which a player would never ever reach) and it brought the system on its knees.. but that was like way too many objects, nt in thousands though..

3)don't think thts be too much of a concern.. moreover I've to see numbers or facts first to believe it.

your only concern should be convex hull bug with current newton version.. chk on newton forums for more details.. i think julio is going to release a patch, just doesn't want to talk about it.

Farinorco

21-03-2007 14:57:13

Thank you nikhil for your reply. Regarding the first question, I've read that a few other physic libraries like TrueAxis has a better support for this thanks to a different approach in the collision system, but TrueAxis particularly (which also has a better performance as far as I know) has a non-free license for commercial projects, and I'd prefer to avoid this (my project isn't commercial of course, but I can't know the future and I don't want to have that limitation :wink: ). Anyway, if you say that is in the order of bullets firing through walls, as I supose that it's a matter of both objects not being colliding at the moment of checking collisions in any step, I supose a larger object would have to be moving extremely fast to cause that, and I'm happy to know about the existence of a continuousCollision mode :D . So I supose there are ways to deal with that problem, I won't worry about that anymore (until I have the problem, obviously :lol: ).

And thank you for the advice about convex hulls bug... I'll try to search a little about that problem, I'll visit the Newton forums next.

Anyway, I'd like to know about my second question, I think it could be a critical issue when we are talking about games (depending on how much objects are "lots of" of course). I've played a very original and impressive free game (actually, a "tech demo") called Penumbra (a sort of first person survival horror without any weapon and centered in puzzles and physics) developed by a small group which shows a good overall performance (for its very advanced technologies, including graphics, physics and so...), but it always shows few objects simultaneously, and it doesn't really solve my doubt. Any other of you could tell me something concerning that?

Lots of thanks again to nikhil and any other people who can help me :)

PS: This is the Penumbra game if you are interested in seeing it (it uses Newton for the great physics):
http://frictionalgames.com/penumbra/

walaber

22-03-2007 05:37:09

I've never needed to use it extensively, but the continuous collision mode should work fine.

with regards to many objects, Newton handles thousands of objects just fine... it's stacks of many objects that causes slowdowns. if your game design doesn't require ridiculous stacks of objects, you should be OK. my game Stunt Playgound handles pretty big stacks OK on most computers.

as to overall performance, I've not had any trouble with performance in my experience, but most of my games are fairly limited in scope.

the biggest compliment I can give to Newton is that it works as advertised, ever feature that has been implemented works well, and the custom joint system is extremely robust, and powerful.

nikhil

22-03-2007 06:53:07

anytime ;) .. The thing is it's easy to pickup Newton, specially coz of OgreNewt.. And concerning the number of objects it can handle, I suggest you do the following.

Since in any physics engine it's easy to spawn boxes, you can spawn X number of boxes using different engines and let them fall to the ground. That should not be difficult and will give you a brief idea on how easy is to get started with each engine. you probably will be able to do this in 3 diferent physics engine in one day.. And this will give you an idea on how the engines are doing at handling large number of objects. Just spawn a lot of boxes at random positions, I suggest you fix the height above the ground so they are all hitting the ground at the same time in all the engines..

This might sound like a coarse way of determining engine performace, but it needs the least amount of effort on your part, and you wouldn't be taking anybodys word for judging each engine..

Farinorco

22-03-2007 14:52:26

Well, lots of thanks to both of you, you've helped me a lot, really :wink:

Now I've got a much better idea of what are the real capabilities in practise of Newton, and I like it. But recently I've discovered that a physic library I've discarded because of not being free for commercial use, Ageia's PhysX, it IS completely free in fact now. I think I'll take a look at this one, and then I'll decide (PhysX or Newton). AFAIK, PhysX is very powerful (as it could be expected since it had a 50,000$ license...) and well documented, so it should not be particularly hard to use. Anyway, one of the things why I like Newton (aside from its good accuracy comparing to other free physic library) is that it seems very intuitive and easy to use, something important to me since I've never worked with a physic library. I'd like to now if PhysX will be much harder than Newton to use, specially if someone has used both. I'll ask in NxOgre forum too, and if any of you could give me some advice about this...

PS: nikhil, I'll do what you sugest to test both engines. It's a better thing to do than it seems, because in this way I think that I'll can not only test performance, else the way in wich work both engines making an idea about the relative complexity of one and the other, without having to dive very deep into it. :wink:

Lots of thanks again for your help to both, If finally I decide to run with Newton (and therefore probably with OgreNewt), I'll come back here to bore all of you with my newbie problems... :lol:

nikhil

22-03-2007 20:47:18

let me know too how it goes. I wanted to switch to PhysX at one point coz of the convex hull bug I mentioned. But I was ao heavily invested into Newton at that point it made no sense for me to do it. God bless Julio, my saviour, coz he gave me a fixed DLL when I made a personal request to him. That solved the problem (only partially, but left me in a working mode).

Good luck to u.. though if you are just starting it'll take a couple of days for you to get your hand on the PhysX SDK. You've to register for it and your registration request gets approved by hand :shock: .That's wht betajen told me.