Physics integration with Ogre

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
CrimsonGT
Greenskin
Posts: 120
Joined: Thu Sep 20, 2007 10:13 am

Physics integration with Ogre

Post by CrimsonGT »

So I have been trying to decide on a physics system to use for my game, and from what I can tell they are all pretty similar. Im making an RPG but would like to recycle the code and build on to it (instead of replacing it later) for more as I become more familar with the designs and concepts. I was originally going to use NxOgre, but the required PhysX installer for anyone trying to run my game was a huge turn off. I started looking into Havok a bit, and found one sample, but as a new comer to the world of 3d game design (most of my history is in Mod development for Source engine and 2d RPGs way back when) the sample for Havok was a bit difficult to comprehend (the comments being in another language didnt help much).

So basically I am just looking for some opinions. Should I suck it up and keep banging my face on Havok and try and figure it out, or use something more simple like OgreNewt (saw some example videos of what it can do, and it doesnt look all that far off from Havok/PhysX). I really wish Havok had a wrapper made for Ogre3D, but I have no intentions of ripping out the rest of my hair trying to create one, so really I can only think I should try and get Havok implemented, or just switch to OgreNewt.
User avatar
xavier
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 9481
Joined: Fri Feb 18, 2005 2:03 am
Location: Dublin, CA, US
x 22

Re: Physics integration with Ogre

Post by xavier »

It depends on what your needs are. Newton/OgreNewt are much more newbie-friendly, and if you run into limitations with Newton and want to move to Havok, you can replace the calls to Newton within OgreNewt, with similar calls to Havok.
Do you need help? What have you tried?

Image

Angels can fly because they take themselves lightly.
User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
x 58
Contact:

Re: Physics integration with Ogre

Post by betajaen »

Yeah, I hate the PhysX installer as well, but:

I don't know if you know, but NVIDIA/Ageia provides a "run-time installer" for PhysX that you can embed into your game installer. Usually they are version specific so they don't carry any extra libraries or old versions like the big installer does, so it is only a few megs. You can even make it install silently when you install your game on a computer.
CrimsonGT
Greenskin
Posts: 120
Joined: Thu Sep 20, 2007 10:13 am

Re: Physics integration with Ogre

Post by CrimsonGT »

Xavier: That sounds like a decent idea. For some reason I really want to go with Havok, but I think Newton will be the way to go for now until I atleast have a better concept of implementing physics, or until someone makes a wrapper for Havok.

betajaen: Yeah, I just despize it completely, and despite really liking the capabilities of PhysX, the installer, even integrated, just turns me off to the entire thing. I was actually working on adding NxOgre to my project when I remember the PhysX installer was a requirement for any potential player, and I immediately deleted it lol.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: Physics integration with Ogre

Post by jacmoe »

No big deal, IMO.
You already need to install the DirectX runtimes, the Visual Studio runtimes, ..
I mean, one silent install more is really not going to ruin everything.
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
xavier
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 9481
Joined: Fri Feb 18, 2005 2:03 am
Location: Dublin, CA, US
x 22

Re: Physics integration with Ogre

Post by xavier »

It does for me. I feel the same way about it. And when it's the only physics solution that requires such a thing, and there are plenty of other viable alternatives, I'll go with the alternatives.

As for DX, I don't actually have to install it -- I can simply distribute (albeit anti-EULA) the runtime DLL for the version I am using (because all of my supported platforms come with some version of at least DX9). And I also don't need to install the VC runtimes, because my application is static-linked.

I really don't like the idea of *forcing* my users to install additional software to use the software I am providing. If you couldn't tell.
Do you need help? What have you tried?

Image

Angels can fly because they take themselves lightly.
Leadwerks
Gnoblar
Posts: 24
Joined: Tue Nov 21, 2006 10:06 pm

Re: Physics integration with Ogre

Post by Leadwerks »

I've had very good results with Newton. Here's what I like about it:

-It's much more stable than other physics libraries I have tried. No jitters or explosive objects. Joints are stable and solid.
-It's very easy to start using. It took me about a day to integrate it into my engine, when I first started using it.
-It supports a dynamic terrain heightfield. You can just change the terrain height data, and you don't have to rebuild a triangle mesh or anything like that.

It doesn't support soft bodies yet, although the author is always adding new features, so hopefully we will see that soon. Also, some of the advanced functionality can change a bit from version to version because parts of it are still being developed, but if you are just making bodies and joints, that probably won't affect you.

I say, try them all and see which one you like best. PhysX has features that Newton lacks, and Newton has features that PhysX lacks.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: Physics integration with Ogre

Post by jacmoe »

How would you compare Newton to Bullet ? :)
I'd very much prefer an open source library, but if Newton kicks it's behind, I'm willing to make compromises.
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Leadwerks
Gnoblar
Posts: 24
Joined: Tue Nov 21, 2006 10:06 pm

Re: Physics integration with Ogre

Post by Leadwerks »

I looked into bullet at one point. I can't remember exactly why I decided against it, so you should research it yourself.

I prefer something that is closed source. Open-source means the developer won't fix things when they are broken (Do it yourself, you have the source!), and there will be a bunch of different "community-supported" features that don't really work.
User avatar
_tommo_
Gnoll
Posts: 677
Joined: Tue Sep 19, 2006 6:09 pm
x 5
Contact:

Re: Physics integration with Ogre

Post by _tommo_ »

Leadwerks wrote:I looked into bullet at one point. I can't remember exactly why I decided against it, so you should research it yourself.

I prefer something that is closed source. Open-source means the developer won't fix things when they are broken (Do it yourself, you have the source!), and there will be a bunch of different "community-supported" features that don't really work.
Well that's decidedly not the case of Bullet as the core team is actively funded by Sony and AMD for what i know :wink:

I am now using PhysX for one year and half, and i'm not bothered at all by the additional installer...
but as an expert user, as the top "issue" i would certainly put that Nvidia killed any development... and i would not recommend to adopt it as of today.
version 2.9 was scheduled for September 2008... and now MAYBE we get the 2.8.3 in december, while there are outstanding lackings in joint stability, shape support, IK support, etc.
AND, CUDA support is really crappy for what they advertise; it can move ONLY cloths and fluids... meaning that it's completely useful to any gameplay.
Interesting enough, Bullet is more complete also on that side :roll:
On the other hand, Bullet is really complicated for a first time use... you have to choose nearly anything while building the scene.
OverMindGames Blog
IndieVault.it: Il nuovo portale italiano su Game Dev & Indie Games
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: Physics integration with Ogre

Post by jacmoe »

Leadwerks wrote:I prefer something that is closed source.
I remember what happened to Tokamak all too well. :(
Yes, I know that it went open source later on, but much too late.

I personally think you're wrong about Open Source.
You cannot generalise like that. :)
Open source is a sound business model. Why do you think Google makes it's beta software public? The more exposure the source gets, the better it becomes.
I know that there's some badly run open source project 'out there', but that doesn't mean that it applies to everything.
And I don't really think Ogre would have been what it is today, had Steve kept it hidden in his desktop drawer. :wink:

And that's enough of that.
I am just curious about the differences between those two libraries.
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
nikki
Old One
Posts: 2730
Joined: Sat Sep 17, 2005 10:08 am
Location: San Francisco
x 13
Contact:

Re: Physics integration with Ogre

Post by nikki »

<offtopic>
Leadwerks wrote:I prefer something that is closed source. Open-source means the developer won't fix things when they are broken (Do it yourself, you have the source!), and there will be a bunch of different "community-supported" features that don't really work.
Well, in most open source projects I know, addition of features after feature requests was done by a 'team member'. Someone else might come up and add it. In fact, maybe that person is even better at it. People work on parts of the project they're good at. This is a really nice property of open source. If I'm working on a project, and someone decides to add a certain feature that they've worked with a lot, he can do it. If it was in great demand, many benifit. If it's closed, either I have to learn about that feature (and maybe after I'm done with implementing it, forget about it because I never really was interested in it myself anyway), or get the other guy 'in the team', both being yet another impediment on the development cycle.

If you don't want community supported features, you can skip them. Whether it's open source or not, the 'core' will remain the same. Or maybe I understood 'community supported' wrong.

If it's open source, community supported features can be even better because the community has greater access to the code. Some times new core features might rise out of community supported features. The core developers can concentrate on core only, and the community can work on what they want to, maybe come up with new ideas that the core developers would never have thought of. People can also read the project's code and learn about it. I learnt a lot of software development techniques by reading code written by other people.

(note: coming from an inexperienced fellow, add an 'IMHO' to every line above ;) )
</offtopic>

About physics engines, Bullet does pretty good for me. It's in active development, and any questions and requests you have are immediately handled in their forums.
CrimsonGT
Greenskin
Posts: 120
Joined: Thu Sep 20, 2007 10:13 am

Re: Physics integration with Ogre

Post by CrimsonGT »

I go get lunch and come back with a lot to read :)

Well basically I would like to either go with Havok or Newton. As stated before the PhysX installer, and I guess also the lack of updates according to a former post, are both reasons I am against it. I think the developers of NxOgre did an amazing job, and I just wish they had done it for Havok instead :P

I am developing an RPG so I dont think overly advanced physics is something I need to concern myself with too much. I would however like to have something professional, full of features, and stable, which it seems both Havok and Newton are. I dont mind spending the time if you guys think Havok would be in my best interest (the games using it, and its history are all really awesome) but if its just going to be overkill I will just go ahead and implement OgreNewt probably. I put a job offer on the recruitment thread to pay someone to help me implement Havok, but I guess that is more or less based on what becomes of this thread.
User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
x 58
Contact:

Re: Physics integration with Ogre

Post by betajaen »

CrimsonGT wrote:I think the developers of NxOgre did an amazing job, and I just wish they had done it for Havok instead :P
I may be doing that in the future.

But personally, for what you want, I would go with Newton. Havok and PhysX are a bit over the top for what to you need.
User avatar
xavier
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 9481
Joined: Fri Feb 18, 2005 2:03 am
Location: Dublin, CA, US
x 22

Re: Physics integration with Ogre

Post by xavier »

Agreed. I use Havok directly, and Havok was the choice mostly for its animation and tools support.
Do you need help? What have you tried?

Image

Angels can fly because they take themselves lightly.
User avatar
DanielSefton
Ogre Magi
Posts: 1235
Joined: Fri Oct 26, 2007 12:36 am
Location: Mountain View, CA
x 10
Contact:

Re: Physics integration with Ogre

Post by DanielSefton »

Thing is with PhysX vs Havok, Havok is not free for commercial use on the PC, is that right?

I'm also overwhelmed by all the different Havok components - are they all completely separate? Do you have to buy each individually? At least PhysX is all-in-one.

I really want to like PhysX, but I've read a lot of negative press saying they are anti-ATI etc. I want my game to be available to as wide an audience as possible, I don't want those with an ATI card to be discriminated. Not forgetting the installer.

Bullet is nice; and it's improving at a fast rate. The API takes a while to get to grips with though, and the documentation isn't great. I found Newton easy to work with and quick to get the results I wanted, and it has pretty solid dynamics and collision, with a powerful callback system. But thinking in terms of the future, I can see Bullet being the one to watch. It's got 2 ingredients for success: open source and funding.
CrimsonGT
Greenskin
Posts: 120
Joined: Thu Sep 20, 2007 10:13 am

Re: Physics integration with Ogre

Post by CrimsonGT »

Havok is free.

http://www.havok.com/index.php?page=pro

If you sell your game for less than 10$ your good to go, if its more than that you have to request a no cost license from them (Intel picked up the cost with the commercial agreement)
User avatar
xavier
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 9481
Joined: Fri Feb 18, 2005 2:03 am
Location: Dublin, CA, US
x 22

Re: Physics integration with Ogre

Post by xavier »

CrimsonGT wrote:Havok is free.
And has been from some time now (18 months I think? Long enough for 4 releases since the first free one, anyway).
DanielSefton wrote: I'm also overwhelmed by all the different Havok components - are they all completely separate? Do you have to buy each individually? At least PhysX is all-in-one.
Depends on what you want. Physics and Animation and the art tools come with the free bundle, everything else (Destruction, Cloth, Behavior, etc) is licensed (read: not free). For the most part, your typical hobby-level project will be more than overwhelmed with what you can do with just Physics and Animation.
Do you need help? What have you tried?

Image

Angels can fly because they take themselves lightly.
User avatar
_tommo_
Gnoll
Posts: 677
Joined: Tue Sep 19, 2006 6:09 pm
x 5
Contact:

Re: Physics integration with Ogre

Post by _tommo_ »

betajaen wrote:]Havok and PhysX are a bit over the top for what to you need.
define "over the top" :)
Chances are that Havok and PhysX are faster, more solid, with more features than newton... and for what concerns PhysX, good design and easy learning are one of its best features...
So i don't see why use something limited just because you are a beginner :)
OverMindGames Blog
IndieVault.it: Il nuovo portale italiano su Game Dev & Indie Games
User avatar
xavier
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 9481
Joined: Fri Feb 18, 2005 2:03 am
Location: Dublin, CA, US
x 22

Re: Physics integration with Ogre

Post by xavier »

_tommo_ wrote:
betajaen wrote:
CrimsonGT wrote:Havok and PhysX are a bit over the top for what to you need.
define "over the top" :)
Chances are that Havok and PhysX are faster, more solid, with more features than newton... and for what concerns PhysX, good design and easy learning are one of its best features...
So i don't see why use something limited just because you are a beginner :)
Probably because as mentioned, in the first post, the learning curve with Havok is much steeper than it is with Newton. And from the description of his needs, Newton should work fine.
Do you need help? What have you tried?

Image

Angels can fly because they take themselves lightly.
User avatar
DanielSefton
Ogre Magi
Posts: 1235
Joined: Fri Oct 26, 2007 12:36 am
Location: Mountain View, CA
x 10
Contact:

Re: Physics integration with Ogre

Post by DanielSefton »

xavier wrote:Depends on what you want. Physics and Animation and the art tools come with the free bundle, everything else (Destruction, Cloth, Behavior, etc) is licensed (read: not free). For the most part, your typical hobby-level project will be more than overwhelmed with what you can do with just Physics and Animation.
How did I not know this? *deletes all PhysX code* Time to dig into Havok :D

@OP: Basically, if you have the time and ability to invest in Havok's (*much*) steeper learning curve, go for it. If not, choose Newton. If you want to know why Newton is the god of all physics libraries, wait for nullsquared :mrgreen:
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: Physics integration with Ogre

Post by jacmoe »

DanielSefton wrote:If you want to know why Newton is the god of all physics libraries, wait for nullsquared :mrgreen:
Very true! :lol:
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
cybereality
Hobgoblin
Posts: 563
Joined: Wed Jul 12, 2006 5:40 pm
x 12

Re: Physics integration with Ogre

Post by cybereality »

Anyone tried integrating Bullet with Ogre? I kind of wanted to get a jump on this after hearing that they are working on an OpenCL version (which will hopefully become the standard). PhysX is alright but I am getting sick of Nvidia's tom foolery. I happen to own an Ageia PhysX card, which no longer seems to be supported. Who knows, at any point they could just drop support for ATI cards altogether or some similar nonsense. Not exactly the best platform to be investing in.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: Physics integration with Ogre

Post by jacmoe »

Are you kidding?
Of course. :)
OgreBullet, btOgre and various non-wrapper examples. Take your pick. :wink:
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Vectrex
Ogre Magi
Posts: 1266
Joined: Tue Aug 12, 2003 1:53 am
Location: Melbourne, Australia
x 1
Contact:

Re: Physics integration with Ogre

Post by Vectrex »

Newton vs PhysX from our specific needs

- Newton :
Pros - Very solid collision. No noticeable problems.
- Static world seems to be able to handle many polygons without slowdown.
- Interpenetration is handled with grace. Very few explosions.
- Jointed bodies can be happily forcefully moved without problem.
- Good support from Julio. He might be.. eccentric, but he loves physics.

Cons - Joints are usually stable, but under certain situations (many bodies jointed together) it has bad problems with drifting.
- No tools for modellers.
- Doesn't have point collisions yet (for particles), fluid, cloth etc, but I personally don't care.


- Physx :
Pros - It's a bit faster maybe... 'fluid' and all that fluff.
- Handles joints decently, doesn't explode.

Cons - Nasty collision, visible 'rubberyness'.
- Flaky 'skinwidth' thing to fudge over bad effects, requires a lot of frigging about to adjust meshes, still looks bad.
- Any interpenetration causes huge explosions.
- Can't forcefully move jointed bodies around. It freaks out.
- Static world slows down with many polys.
- ZERO support... ZERO.

PLEASE let Havok be better than PhysX since we are moving to it next. If it wasn't for the joint problems we'd just stay with Newton. That said, the joint 'problems' are very specific to our needs (around 30 bodies jointed by 60 joints).
Post Reply