PDA

View Full Version : Recommended physics libraries?


NCarter
2004.09.07, 06:07 PM
As I mentioned in my blog (http://www.udevgames.com/index.php?option=com_mamblog&task=show&action=user&id=133), I'm trying to use libraries to handle all the tricky stuff in my uDG entry. The hardest thing for me is going to be the collision response code, so I'm looking for a library which can do the job for me.

I have fairly simple requirements: I have spaceships and asteroids in zero gravity, and I want to have reasonably accurate (rigid body?) collision response between them. Ideally, I'd like to be able to treat the spaceships as fairly simple approximations but to use the full detail of the asteroid's surface. The asteroids don't have very many polygons, but I'd like them to be somewhat irregular, so spherical/ellipsoidal approximation is probably out of the question.

I've been Googling all evening with only a little success so far (ODE (http://ode.org/) looks like the best bet at the moment). I'm going to continue hunting, but I wondered if anyone here can recommend a physics library which would work well for my game.

Any thoughts?

Skorche
2004.09.07, 09:49 PM
ODE for sure. For the little I've played with it, it looks awesome, performs great, and seems to be pretty powerful. Oh and a bag of chips...

I don't think that I've seen any other free library that can stand close.

phydeaux
2004.09.13, 08:45 PM
I use ODE in my entry- you may or may not find the included source to be useful to you.

http://q-tech.rpg-dev.net/stuff/phydeaux-pre1.tar.gz

Nick
2004.09.15, 05:21 PM
Would ODE be a good choice for me if my goal is a first person shooter (gravity, bullet simulating collisions, etc) with breakable scenery (simple as boxes falling apart into 6 pieces. nothing Halo 2 kinda fancy)?

NCarter
2004.09.15, 05:39 PM
Would ODE be a good choice for me if my goal is a first person shooter (gravity, bullet simulating collisions, etc) with breakable scenery (simple as boxes falling apart into 6 pieces. nothing Halo 2 kinda fancy)?
It might be a bit over-the-top for an FPS, since most things can be faked quite simply in that kind of game. That said, it'd be interesting to see how it could be used to enhance the gameplay of an FPS, rather than just the effects (thinking of UT2004's incredibly limited ragdoll animation).

Meanwhile, I've decided that ODE was too complicated for me to learn in the short time I have available, so I'm hacking out a simple physics engine which treats everything as groups of spheres, capsules and rays. Should be pretty easy, I think.

flipflop
2004.09.15, 08:08 PM
ODE seems great for 3d games but seems to be lacking in the 2d arena. After reading some of the archived mail list it seems some people got it working by essentially using one value all the time for the z coordinate. Someone else created a class called Plane2d which hides a lot of this complexity but it seems that extension / class is out of date and no longer maintained.

Is there a recommended physics engine for 2d games out there? I'm currently looking at Squirrel Physics (thanks Skorche!) as a simple alternative.

Skorche
2004.09.16, 01:02 AM
Actually, you may be in luck then. Not only have I decided to go 2D only to take care of some of the headaches associated with 3D (like lack of editing tools), I think I'm starting to get over some of my language barrier problems that started making the last two versions of SPK so, well... ugly to work with. Not to mention that right now it's very, very basic. Most of my own ideas are still on paper.

Not only that, I've decided to drop my own UDG entry to work with someone else where updating SPK will be a high priority. That said, I wouldn't count on anything but the version SPK that you can actually get your hands on. I'm not going to promise any timeline or anything.

willThimbleby
2004.09.16, 04:31 AM
I'm using ODE in BitRacer thread (http://www.idevgames.com/forum/showthread.php?t=7070). And while it is powerful, it is a bit complicated.

I have found much to my irritation that my physics coding has become trial and error coding. Trying to get an arcady physics of what I want is hard. Way to many variables. It also still struggles a little bit with trimeshes, I wanted beautiful curving tracks and my racer keeps getting snagged on the seams.

Having said that ODE is about the only decent choice for physics at the moment. But I'm still tempted to write my own custom engine.

flipflop
2004.09.16, 03:50 PM
Not only that, I've decided to drop my own UDG entry to work with someone else where updating SPK will be a high priority. That said, I wouldn't count on anything but the version SPK that you can actually get your hands on. I'm not going to promise any timeline or anything.

Good news for SPK fans. Any chance on getting a pre-release as you develop? ;)

O/T - If you don't mind me asking, which project are you hooking up with?

Skorche
2004.09.16, 10:08 PM
I'm a bit afraid that making more tiny releases will just lead to more crappieness, and frustrated people who keep getting the floor taken from their feet. Although I'll need a few people to help test it and give suggestions to improve it. That helped immensely when I was beginning SPK, to have someone using it asking me questions about how to do feature X or Y so I could see how they were trying to use it.

Anyway, one of two such projects was Exit Strategy. lightBringer started it over his spring break last year, then gave me the source code to speed it up a bit. It had a screenshot up on CMG for a while, but derek never quite finished the whole thing. So we figured that we might try and enter it in uDG.

Maybe I should just start a new thread soon about this instead of invading NCarter's...