Physics engine

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Qlippoth
Gnoblar
Posts: 10
Joined: Sat Nov 20, 2004 6:25 am

Physics engine

Post by Qlippoth »

Hi,

I am working on a game using Ogre and I am wondering if you can recommend a good physics engine?

I want to be able to use the physics engine both for general collision detection and raycasting as well as physics simulation. Open source is a plus, so are easy integration with Ogre.

I have tried out Newton a bit but it seems to be quite buggy. Any suggestions besides Newton?
User avatar
Hudson
Halfling
Posts: 60
Joined: Thu Sep 14, 2006 2:46 pm
Location: NY

Post by Hudson »

You could try the Open Dynamics Engine
User avatar
Samir
Halfling
Posts: 59
Joined: Sat Jun 25, 2005 12:11 pm

Post by Samir »

When looking for a library to use with Ogre, like a physics engine, always start your search on this page:

http://www.ogre3d.org/wiki/index.php/Libraries

For the case of a physics engine, you'll find most possible libraries to use in this specific section:

http://www.ogre3d.org/wiki/index.php/Libraries#Physics
Qlippoth
Gnoblar
Posts: 10
Joined: Sat Nov 20, 2004 6:25 am

Post by Qlippoth »

Hudson,

Looks quite nice from the page and wiki, I'll try it out.
User avatar
SpaceDude
Bronze Sponsor
Bronze Sponsor
Posts: 822
Joined: Thu Feb 02, 2006 1:49 pm
Location: Nottingham, UK
x 3

Post by SpaceDude »

I've been using PhysX and I'm quite pleased with it. It is closed source commercial product though. Although you can use it for free for non-commercial games or even commercial games on PC i believe.

It has some nice features not present in other physics engines such as basic fluid dynamics, cloth tearing, etc...
User avatar
JohnJ
OGRE Expert User
OGRE Expert User
Posts: 975
Joined: Thu Aug 04, 2005 4:14 am
Location: Santa Clara, California
x 4

Post by JohnJ »

I agree - Ageia PhysX is top-of-the-line. It originally cost $50,000 dollars, but was later made completely free for commercial and personal use (as long as you register [free], you're licensed to use it ;) ).

PhysX will definitely have every feature you need, and more. Raytracing, cloth physics, mesh deformation, soft bodies, rigid bodies, etc., etc. The main reasons I'm using it are:

+ Extremely fast
+ Terrain heightmap support (critically important if you use terrains > 512x512)
+ Fast raytracing for AI
+ Any feature I could want is there
+ Very easy to use, even without a wrapper
+ Huge amount of documentation, including tutorials
+ Very easy to integrate into Ogre
+ It's free :)

The downsides are:

- Not open source
- Only works on Windows/Linux/PS3
User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
x 58

Post by betajaen »

It does XBox 360 as well. Apart from the Mac and the Wii, PhysX is on every platform. So those aren't really downsides ;)

But if you do decide on PhysX. There is a Ogre wrapper; NxOgre and it is awesome :D
QuantumG
Kobold
Posts: 36
Joined: Wed Jun 15, 2005 1:57 am

Post by QuantumG »

I see it has raycasting vehicles.. do they suck?
User avatar
rewb0rn
Greenskin
Posts: 128
Joined: Sat Dec 02, 2006 10:03 pm
Location: Berlin, Germany

Post by rewb0rn »

Qlippoth wrote:Hudson,

Looks quite nice from the page and wiki, I'll try it out.
You might want to check out OgreOde, its a wrapper for ode so you can easily use it in ogre. And we need people over there ;)
User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
x 58

Post by betajaen »

QuantumG wrote:I see it has raycasting vehicles.. do they suck?
Nope. They work better than cylinder-hinge joint combinations in other engines, because there are less errors than the joint, and you can absolute control over the wheel.
QuantumG
Kobold
Posts: 36
Joined: Wed Jun 15, 2005 1:57 am

Post by QuantumG »

Does PhysX's specific implementation not suck? Bullet's raycast vehicles suck.

Guess I'll have to try it for myself.

Integrating yet another physics engine, fun.
User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
x 58

Post by betajaen »

Not at all. Remember PhysX is a commercial engine it's developed by professionals and used by professionals. Everything is state of the art. :D
User avatar
Praetor
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3335
Joined: Tue Jun 21, 2005 8:26 pm
Location: Rochester, New York, US
x 3

Post by Praetor »

The only problem I have with PhysX is that you MUST have a runtime installed. I can understand drivers might be required only if you have a PhysX card, but then, why must I have a runtime installed separately? Shouldn't the drivers be with the card and only exist when using the card? This has actually caused problems, since a user must have the correct version of the runtime installed and unless I make an intelligent installer it can be quite a mess for the technically non-inclined.

Any thoughts on this (looking at you betajaen, PhysX expert!)? Maybe I'll just ask Ageia directly, from what I hear they're willing to chat with most people.
User avatar
JohnJ
OGRE Expert User
OGRE Expert User
Posts: 975
Joined: Thu Aug 04, 2005 4:14 am
Location: Santa Clara, California
x 4

Post by JohnJ »

The only problem I have with PhysX is that you MUST have a runtime installed. I can understand drivers might be required only if you have a PhysX card, but then, why must I have a runtime installed separately?
You're right (I forgot to mention that). Probably the only real disadvantage to Agea PhysX is that the users must install a 30 MB driver pack, which basically includes all releases of the runtimes for "backwards compatibility". I really don't know why they don't simply let you copy the latest runtimes (total of 3 MB) into your executable folder. I guess the runtime DLLs have to be chosen based on your firmware, but this wouldn't be a problem unless you have the PhysX hardware like you said (in which case the user would be sure to install their drivers anyway).
User avatar
Praetor
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3335
Joined: Tue Jun 21, 2005 8:26 pm
Location: Rochester, New York, US
x 3

Post by Praetor »

That's what I thought, which was confusing to me. Either they have the card, and the drivers can be handled like any hardware drivers, or they don't and all you need is a dll to be accessed. The extra installation puzzles me.
User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
x 58

Post by betajaen »

Unofficially you can. There has been some talk on the Ageia forums about this.

To me though the drivers seem a little un-needed, you don't need them for PhysX on Linux.
User avatar
syedhs
Silver Sponsor
Silver Sponsor
Posts: 2703
Joined: Mon Aug 29, 2005 3:24 pm
Location: Kuala Lumpur, Malaysia
x 51

Post by syedhs »

betajaen wrote:Unofficially you can. There has been some talk on the Ageia forums about this.

To me though the drivers seem a little un-needed, you don't need them for PhysX on Linux.
I have been trying to find the thread on Ageia Forum on lighter PhysX Driver, but I just couldn't find it. Mind telling me which forum, page etc?
User avatar
Farinorco
Gnoblar
Posts: 13
Joined: Sat Feb 03, 2007 9:41 pm
Location: Spain (Getafe - Madrid)

Post by Farinorco »

Oh, I'm looking for a good physic engine too, and I'm very interested in all have been said in this thread, specially because I've looked Ageia PhysX in a way like "ah, if it would be completely free..." :lol: . What you've said about being free of use in PC commercial projects also have immediatly enlightened me :lol:

I wanted to see it by myself, so I went to the Ageia's web and I saw the following:
What Does It Cost?

The AGEIA PhysX SDK is free for non-commercial use. Standard pricing for commercial use is $50,000/title/platform. Licensed developers who implement PhysX accelerator support in their PC title are not required to pay this fee.
What does actually mean "licensed" developers? Some of you are speaking about "registered" users (in its web?), does it really works this way, or is not that simply and direct?

And what about the implementation of PhysX accelerator support? Does it envolve a cost in additional coding or learning how-to-use? Is it feasible at all if you don't have such hardware to test that support?

I mean, is it all as pretty as it seems, or has it some noticeable implications and drawbacks? :twisted: :lol:

In the other hand, I was considering Newton Game Dynamics, I haven't read nothing about being so buggy as Qlippoth says, but I've known about an issue regarding performance at handling a high number of objects since its solver is at least O(n^2) complexity (or that's what I read). Anyone who has been using Newton could tell me a little bit about this topic?

-----------------------------------------------------------------------------------
EDIT: OK, I've been researching a little more inside its web, concretely in the support center, and I've seen the following:
Costs

At present, the following two options are all that are available. We will likely never provide any sort of royalty-based license. Open-source usage is limited only to the most middleware-friendly license model--in other words, we retain full ownership and rights to our own IP, and what you ship of ours will still be specified by contract.

Free:

* Commercial & non-commercial use on PC
o Must keep registration information currect
o Must agree to the EULA at the time of download (pops up, but is copied below)
o Available for Windows & Linux (soon)
o No PhysX HW support requirement
* PS3 platform (through Sony pre-purchase)
* All platforms through some of our middleware partnerships, such as UE3, Gamebryo 2.2, and others

$50k per platform:

* Xbox 360
* Fee may be waived at our discretion for multi-platform developers providing PC HW support
* Fee may be waived at our discretion for some Tools & Middleware providers
So I guess it's completely free while you are not developping your project for XBox 360, and even that may be free if it's a multi-platform project and add the PhysX HW support and they agree with it? I really can't understand how in two different places the same web about the same product they can say so different things in a so important topic, specially while the most restrictive one is in the most immediate (an publicitary...) section.
Last edited by Farinorco on Wed Mar 21, 2007 5:27 pm, edited 1 time in total.
User avatar
JohnJ
OGRE Expert User
OGRE Expert User
Posts: 975
Joined: Thu Aug 04, 2005 4:14 am
Location: Santa Clara, California
x 4

Post by JohnJ »

What does actually mean "licensed" developers? Some of you are speaking about "registered" users (in its web?), does it really works this way, or is not that simply and direct?
Unfortunately, the main page license info is out of date. In the developer's section, it gives a little more detail on the "free" part: http://devsupport.ageia.com/ics/support ... eptID=1949
Free:
* Commercial & non-commercial use on PC
o Must keep registration information currect
o Must agree to the EULA at the time of download (pops up, but is copied below)
o Available for Windows & Linux (soon)
o No PhysX HW support requirement
* PS3 platform (through Sony pre-purchase)
* All platforms through some of our middleware partnerships, such as UE3, Gamebryo 2.2, and others
Basically, it's free for commercial and noncommercial use on the everything but Mac.
And what about the implementation of PhysX accelerator support? Does it envolve a cost in additional coding or learning how-to-use? Is it feasible at all if you don't have such hardware to test that support?
As far as I know, there's no extra work required. When you use PhysX SDK, it will seamlessly accelerate physics on PCs with an accelerator card.

There are some features which are only available on accelerated PCs, but not the other way around, so you should be fine if you don't have a PhysX card.
but I've known about an issue regarding performance at handling a high number of objects since its solver is at least O(n^2) complexity (or that's what I read)
I don't have any experience programming with Newton, but every game I see that uses it gets extremely slow on my high-end PC when you have around 20-100 objects. That's the only reason why I crossed Newton off my list - it's sloow. One of the many, many, many, things I like about PhysX is it's extremely fast :)
I mean, is it all as pretty as it seems, or has it some noticeable implications and drawbacks?
The only noticeable drawback is that your users must install Ageia PhysX drivers to play your game. Other than that, PhysX is really nice (It better be, since it originally cost $50,000 [but now is free] :) )
User avatar
Farinorco
Gnoblar
Posts: 13
Joined: Sat Feb 03, 2007 9:41 pm
Location: Spain (Getafe - Madrid)

Post by Farinorco »

OK, thanks John, I was editing while you post your clarification :wink: . I'm a bit slow writing in english. And lots of thanks for this and the other usefull explanations you give :D (particularly regarding Newton and the PhysX HW)
User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
x 58

Post by betajaen »

syedhs wrote:I have been trying to find the thread on Ageia Forum on lighter PhysX Driver, but I just couldn't find it. Mind telling me which forum, page etc?
Here you go.

If that link doesn't work for some reason the title is "Deployment troubles", it's the last post in that thread.
User avatar
syedhs
Silver Sponsor
Silver Sponsor
Posts: 2703
Joined: Mon Aug 29, 2005 3:24 pm
Location: Kuala Lumpur, Malaysia
x 51

Post by syedhs »

Ooo nice.. down to 1 MB :) Okay thanks for the link.
User avatar
Farinorco
Gnoblar
Posts: 13
Joined: Sat Feb 03, 2007 9:41 pm
Location: Spain (Getafe - Madrid)

Post by Farinorco »

Ahmmm, one more question that I was thinking to ask in NxOgre forum, but finally I've decided to do here while I think it's a good point to talk about in this topic...

One of the main causes I liked Newton as a physic engine is because it seemed to be easy to use and relatively intuitive (as ODE, for example, seemed to be very complex to use properly for a physics-lib newbie like I am). Could any of you tell me how easy/difficult to use is PhysX? Is it really closer to Newton, to ODE, easier, or more difficult? Is it recommendable to a newbie in the physic libraries usage like I am, or should I start with another engine like Newton? I'm not really afraid of challenges, but I don't want to be completely overwhelmed from the beginning... :lol:

Lots of thanks to all of you.
User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
x 58

Post by betajaen »

I can't really speak because I write it. But a lot of people who have used previous libraries or wrappers said it's very easy to use.

I've always intended it to be so, so I must be doing something right. But to measure it against other code. A simple program based on the ogre sample application, takes 3 lines of code to create NxOgre, a scene and a cube and simulate/render it.
User avatar
Praetor
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3335
Joined: Tue Jun 21, 2005 8:26 pm
Location: Rochester, New York, US
x 3

Post by Praetor »

I don't think PhysX compares API-wise to the others. I actually very much dislike Newton's API. The callback mechanisms simply produced too much sloppiness when adapting to object-oriented. I liked the directive approach of ODE. However, Newton turned out to be just so damn stable. Since we're in 2D performance isn't much of a concern. For the next 3D project, now that it seems I can redistribute PhysX runtimes in a much more convenient way, I'll be going with that. In terms of ease of use, the little I did play with PhysX it was fairly intuitive and overall a decent design.