PDA

View Full Version : You give me physics, I'll give you a shiny dollar


Raptisoft
11-21-2005, 02:42 PM
Hi all,

I'm looking for a good free or cheap physics library. Basically, I want to pile blocks-- oddly shaped blocks. I've so far tried out two online open source physics things that stack polygons, but they both have the same problem-- nothing ever stops moving, no matter how much friction you add. Reminds me of a certain guy I know, if you get my drift guys, hur hur.

Anyway, I'm trying to make stacking blocks, but nothing ever comes to rest. At the same time, I don't want to FREEZE the blocks, because then they can't be toppled later.

So, does anyone have a favorite physics library? Also, I'd like to request that it be EASY to integrate. After integrating two that were medium/hard to integrate, only to find they both had the same problem, I want to breeze through these things.

Also, I'm putting up a collection so I can buy Havok, feel free to contribute a buck or a thousand.

John

Jim Buck
11-21-2005, 02:47 PM
The Newton physics library was something I messed around with earlier this year.. it seemed pretty decent, though it didn't work too well for my needs (very complicated ragdoll stuff). It's closed source, though. (Unless that's changed since earlier this year.)

ggambett
11-21-2005, 03:18 PM
Is ODE (ode.org) one of the libraries you tried? If not, take a look at it.

Greg Squire
11-21-2005, 04:19 PM
I haven't used any physic engines to give a recommendation, but for whatever its worth, I have heard good things about the Tokamak (http://www.tokamakphysics.com/) and ODE (http://www.ode.com) (as mentioned above) SDK's.

jankoM
11-21-2005, 04:22 PM
Well I gues we all know that there are ODE, Newton, Tokamak, True Axis, and there was Novodex Rocket (It seems it got renamed and I can't see if it's free or whats the price) which had really the coolest demo and there was some really heavy stacking. And for 3dengine with physics there is 3impact.

Jim Buck
11-21-2005, 06:05 PM
At the time I was messing with Newton, I too looked at ODE. The API looks pretty good, so I think it's a good option depending on what you are doing. (And the fact that it's open-source is a bonus.) However, it didn't have a lot of game-y features like "first contact" that is important with firing off sounds.

Raptisoft
11-21-2005, 06:42 PM
Hm, Newton looks good... Tokomak looks a little better. Ode seems to have an embedding problem if you do a lot of stacking-- i.e. rigid bodies sink into eachother a little ways, then spring back out.

I'll see what happens tomorrow. Thanks for the leads!

Vectrex
11-21-2005, 07:09 PM
the newton guy says it can stack boxes without auto-freezing and indeed it can (mostly). One option that just poped into my head would be instead of autofreezing if an object goes below some threshold, why not heavily damp the object? Might stop the shakes enough for the pile to hold together.
...anyway, boxes?? Where's my full screen, 100 level version of hap-hazard!? :D The best platform game I've played in a LONG time.

TimS
11-21-2005, 07:35 PM
Novodex Rocket (It seems it got renamed and I can't see if it's free or whats the price)

Novodex (now PhysX) is one of the best you'll likely find... and NOT within any reasonable budget (at least not for those who would take a collection to get Havok) :D

Cool stuff though... Well worth checking out the SDK if you're ... well... into Physics. :o

ggambett
11-21-2005, 08:05 PM
And for 3dengine with physics there is 3impact.
3impact uses ODE, AFAIK.
Ode seems to have an embedding problem if you do a lot of stacking-- i.e. rigid bodies sink into eachother a little ways, then spring back out.
ODE comes with a demo which shows a vertical array of boxes which you can ram with a car. I think the trick is to disable the boxes at the right time (ODE supports auto disable-enable). I've done interesting things with ODE but not stacking, I must add.

impossible
11-21-2005, 08:12 PM
Novodex (now PhysX) is one of the best you'll likely find... and NOT within any reasonable budget (at least not for those who would take a collection to get Havok) :D

Cool stuff though... Well worth checking out the SDK if you're ... well... into Physics. :o
Novodex is free for commercial use if you support the PhysX hardware. I have no idea what that requires though, on the site they just say "contact us". Otherwise the license is $50K, which might be within you budget... its a lot lower than $750K for havok.

One solution (for masochists only) would be to write your own physics engine :D.

ManuelFLara
11-21-2005, 10:40 PM
You can also try DynaMo (http://home.iae.nl/users/starcat/dynamo/), which is used by BreakQuest (http://www.nurium.com).

Torque2D (http://www.garagegames.com/products/62) has a pretty decent physics and collision engine, but in order to integrate it in your own code you'll have to strip it from T2D's, so not easy to test. Leave it as the last option :)

Daire Quinlan
11-22-2005, 01:00 AM
One solution (for masochists only) would be to write your own physics engine :D.

good god no, don't do this ! I tried to do this before trying out a couple of the more -ahem- stable librarys out there for use. Thing is, its actually relatively easy to code up about 99% of the physics library. Theres a lot of documentation available. Its the other 1% unfortunately that distinguishes a usable engine from one that'll go into wild oscillations and feedback loops whenever you hit any boundary conditions.

This was a couple of years ago, tried ODE and (iirc) Newton. I preferred Newton, seemed more stable. Bear in mind that the stacking thing you're trying to do is actually quite a difficult problem for some some engines. You generally have to resort to a certain amount of jiggery pokery to get it to work, things like damping , or setting up some elastic joins between the boxes, or removing them from the purview of the engine altogether once they've reached some threshold rest state.

D/

NuriumGames
11-22-2005, 01:37 AM
I used DynaMo for BreakQuest, but different physics algorithms are better for different types of problems. DynaMo is fast and very precise but is not very good at piling things.

You should look for some physics engine with specific support for high piles.

Jesse Aldridge
11-22-2005, 02:13 AM
As I recall, one of the projects that won an award at one of the IGF competitions was about stacking objects. It was called Bontago, I beleive... (yep, here is is (http://www.bontago.com/)).
I remember reading an interview in which they decided to use Tokamak because of its stacking capability. (yep, here it is (http://www.gamedev.net/columns/interviews/circularlogic.asp) ).


I saw you chose Tokamak for the physics - what were the factors that led to that decision, and if you could go back, would you have picked a different approach?
Eric: It's kind of funny, really.
Justin: Haha...
Eric: We started off wanting to make our own from scratch. The guy who was tasked with this... did nothing, so we fired him.
Eric: At about the same time, I saw "TOKAMAK Physics Library" on Gamedev, so we tried it out. It was *EXACTLY* what we needed.
Tristan: Yeah, it work out very nicely in the end.
Eric: Optimized for stacking objects... hmmm, sounds like our game...
Tristan: We did experiment with ODE before it, though.
Eric: Yeah, we had ODE running prior to it, but it doesnt like large systems on windows or something like that, and was slow.

Was Tokamak easy to integrate into the project, or did you not have much of a project to integrate into at that time?
Justin: It was easy until we began to add in network play... then things got a bit hairy for a while.
Eric: No real major problems. A few things we would have liked to do more easily were hacked in a way into working, but more or less it was a breeze.

Robert Cummings
11-22-2005, 05:52 AM
Tokamak has a poor friction model in my experience. It will slide on slopes very slowly. That was just my experience with it however.

jetro
11-22-2005, 08:13 AM
When you mention "oddly shaped blocks", Novodex (PhysX) instantly pops in my mind as well.. being impressed by some of their demos.

I think one of example codes with ODE had a wall of blocks which you can ram, and it worked pretty well. It used also automatic freezing of objects, without much problems in re-enabling them as needed. Remember that ODE is also open source and free, with at least some activity in community to get some support. :) However, I'm quite unsure how possible it is to get reasonable stacking with odd shapes (maybe quite ok with composite geom objects, but probably not quite well if you try freeform trimeshes / "polygon soups").

I'm under impression that Tokamak is not really supported any more (the developers disappeared for a long time, although currently I guess there may be hope of having some support over relevant forums). Even if it would have great stacking support or so, IMO this would be a serious issue to consider.