Phyics Engines


PhonicUK

Member
Joined
Mar 27, 2009
Messages
148
Age
36
Website
www.phonicuk.com
Does anybody know of any Physics engines that are either already ported to the P&|a or that could easily be done so? Thinking along the lines of ODE or Newton here. ODE especially because it integrates well with OGRE

OGRE + ODE = Infinite Fun! :D

Anyone got anything on this?
 
I doubt we will see newton at any time in the near future because it always came as a lib and not with sourcecode - also developement was really slow in the last month and the project starts to be optimized for multi-cores. I like newton myself so I wish we had that - but yeh...
//Edit: correction: via MSN - good source :p
QUOTE
???: newton 2.0 sdk is out, beta but it's stable.
JayFoxRox: or did you hear about an ARM version yet?
???: newton is availible on iphone :p
JayFoxRox: oh thats cool
???: the author is very easy about this, he will compile you for almost any platform if you can help him configuire GCC for it
???: but he's not releasing source code.


ODE will definatly come and its probably not too hard to compile it for ARM.

The question is wether you want to waste so much processing time with physics on a handheld.
Normally gameplay and graphics take up enough time on a handheld and the screen is not big enough - you wouldn't really care for some small boxes I think.
(Though, Flatout on PSP was really impressive :p)

My game will come with its own physics system which is just cheap arcade physics - it still looks nice tho.
 
I think Tokamak is open-source now, and it's supposed to good for low-bandwidth consoles and cases where you need to tune between precision and performance.

Physics engines are all just math code anyway, it will be easy to re-compile any open-source engine for the Pandora. At worst, maybe they use some x86 math code, which will slow down a little when converted back to C.
 
Are there any existing 'cheap arcade physics' engines?

All I really need is the ability to roll a boulder down a hill and know when it hits something so I can play the appropriate crushing animation.
 
PhonicUK: Thats definatly not where you should use a Physics engine.. You don't have to simulate real behaviour there - a simple recreation is a lot easier and faster.
Sphere/Ball physics are usually not too hard; Boxes, Ragdolls are a lot harder and complex.

What I mean by "cheap arcade physics" is just checking collision and recreate the behaviour you would expect.. (even tho it might not be exact). My physics are also very case specific: So every object gets different physics.

You can see the same since GTA3 - in a car you get something done by a more complex physics "engine" and if you are on foot you just get a cheap physics simulation: no more sliding down hills, no real friction, no rolling or so - just XYZ position, an almost fixed velocity, and an Angle - nothing else (ok, that changed back for GTA4 to some degree).
 
ODE would be the ultimate physics solution for the Pandora: Small, scalable (you can change Epsilon and whatnot so as to reduce processing requirements) and it is usable through Java (which would make my cross-platform game development easier)
BTW, will we have (and this is only speculation of course, I don't expect answers to this)
1. some kind of SIMD/vectorization optimization? A Physics engine should be ideal for that kind of operation
2. float compatibility at a reasonable speed?
3. the "standard" API and not something else, more reduced stuff?
 
What makes this tricky is I'm starting to work on a game where the map is a sphere (Ala Populous 3), so gravity pulls something towards the centre of the sphere. I'm not sure what the math involved is to get a boulder convincingly rolling down a mountain.
 
pm me, I might be able to help
Basicly its only simple vector math - your gravity vector points to the map center, then your gravity vector is split into 2 components which are added to the boulders velocity.
 
PhonicUK posted on May 25 2009 at 05:17 PM) What makes this tricky is I'm starting to work on a game where the map is a sphere (Ala Populous 3 said:
, so gravity pulls something towards the centre of the sphere. I'm not sure what the math involved is to get a boulder convincingly rolling down a mountain.
You know that Populous 3 actually uses a square world, right? :p It just looks like a ball because they bend the map in a strange way.
Anyways, if you know the Newtonian physics "laws" you know everything required for making a ball roll down a hill. Just make the gravity vector always point towards the middle of the globe, or if you use the Populous 3 model, just straight down (since Populous doesn't have a sphere at all as I said)

BTW, if you only need 2D physics, look at Box2D; it even has gravity-towards-a-point support.
 
Last edited by a moderator:
dflemstr posted on May 25 2009 at 04:32 PM said:
You know that Populous 3 actually uses a square world, right? :p It just looks like a ball because they bend the map in a strange way.
I didn't actually, I assumed it was an actual sphere and that it used polar coordinates to work out where everything was (which was pretty much how I planned to do it)

Do you guys think this is a good idea, or should I bend a square? ;)
 
Last edited by a moderator:
PhonicUK posted on May 25 2009 at 05:51 PM) [quote="dflemstr posted on May 25 2009 at 04:32 PM said:
You know that Populous 3 actually uses a square world, right? :p It just looks like a ball because they bend the map in a strange way.
I didn't actually, I assumed it was an actual sphere and that it used polar coordinates to work out where everything was (which was pretty much how I planned to do it)

Do you guys think this is a good idea, or should I bend a square? ;)

Well, I would really just bend a square; the physics will be (kinda) correct as long as you don't want anything to orbit your planet :p
It's so much easier to use a flat surface obviously; you won't have to deal with radial acceleration etc.
It's even possible to make something orbit over a flat surface ( :huh: "] by making an upwards vector that increases with the distance from the ground and the velocity of the "orbiting" body, thus simulating the centripetal force.[/quote]If you want something that's even more sophisticated, for example a solar system with mutual planet gravity, or something like a planet's weight distribution, or a planet that rotates around its own axis, then you need a spherical system.
 
Last edited by a moderator:
by making an upwards vector that increases with the distance from the ground and the velocity of the "orbiting" body, thus simulating the centripetal force.

If you want something that's even more sophisticated, for example a solar system with mutual planet gravity, or something like a planet's weight distribution, or a planet that rotates around its own axis, then you need a spherical system.
How does one bend a square map? I don't massively need any of the sophisticated stuff you mentioned. Also a square grid system for the terrain makes everything massively easier than dealing with the wireframe you end up with for a sphere (Unless its possible to make a sphere entirely out of equally sized squares?)
 
Last edited by a moderator:
PhonicUK posted on May 25 2009 at 08:58 PM) How does one bend a square map? I don't massively need any of the sophisticated stuff you mentioned. Also a square grid system for the terrain makes everything massively easier than dealing with the wireframe you end up with for a sphere (Unless its possible to make a sphere entirely out of equally sized squares? said:
OK, there are two ways of doing this, and they are really the same: Either you do it like in Civilzation 4, or you do it like in Populous 3.
Let's start with the easiest one: Populous 3.
What you need is basically a mesh to use for your map "projection". Say that you have a terrain structure like on a normal rectangular map, with heights and whatnot:

(here, only the "visible part" of the map is pictured; there's more to the map that's "out of sight")

What you then want to do, is that you "bend" the map, by having a "grid" of vectors that offset your map, so that it gets a curved shape, like this:

When the camera then moves, for example to the right, you simply move/rotate the whole thing to the left, add map cells to the right onto the grid, and remove cells to the left. This gives you the seamless scrolling motion that you might want.
You have to fix the edges of the map, of course, so that when you reach the right edge of the map, you feed the curved grid with tiles form the left side instead, so that the tiles wrap. It then looks like you have a "sphere" that repeats itself, but the map really is like any other terrain map, just shown differently, and wrapping.

Same principle in Civ4, only that you view the projection grid from above, and the convexness of the grid changes depending on zoom level.
 
Last edited by a moderator:
box2d came to my mind, too. Bullet physics would be a dependency of SuperTuxKart, so I hope it will be easy to port.
 
conso posted on May 26 2009 at 12:11 AM said:
box2d came to my mind, too. Bullet physics would be a dependency of SuperTuxKart, so I hope it will be easy to port.
Bullet is the most portable system there is ;)
There's even a NATIVE Java implementation of it (pure Java code, no dependencies) that's almost (90% or so) as fast as the native version. So, if all else fails...
 
Last edited by a moderator:
1. some kind of SIMD/vectorization optimization? A Physics engine should be ideal for that kind of operation
2. float compatibility at a reasonable speed?
3. the "standard" API and not something else, more reduced stuff?
The problem here is that for Cortex-A8 1. is mandatory due to how slow the VFP is.
It's been a few months since I looked at ODE source code, but it wasn't trivially vectorizable...
 
Last edited by a moderator:
Back
Top