Bullet for online 3D space simulator!

eviX
Posts: 3
Joined: Wed Aug 13, 2008 8:21 am

Bullet for online 3D space simulator!

Post by eviX »

Hi everyone!

We are a team of enthusiasts that want to build a online 3d space sim. We a currently in a dilemma of choosing the right physics engine for our needs. (we would deal with lots of moving object that collide)

By our calculations we would use about 40.000 objects in one location (EVE analogy of space regions)

I know this number of object is really huge and computing all collisions is too costly, but we figured out we don't need to realistic collisions, we don't need to simulate friction between objects, what we would need from the physics engine is to:

- allow using lots of objects
- allow speeds of 10 km/s (and even more), so i guess it should have some advanced CCD (continuous collision detection) for this to work fine
-really big mass ratios (so we will have tiny objects that have 1m in length and really huge ones tha have 1km)
- compute the coordinates of objects in a double float format (our worlds will be really huge, like solar systems and we need precise location of objects in space, single precision float is not enough), as i saw from the documentation, Bullet does allow double precision, right?
- very simple collision model, no need of realistic interaction (no friction needed, the collision doesn't really have to be too realistic)


Does Bullet allow such things, or maybe someone could share some experience in dealing with lots of objects or/and with really big speeds of interaction and big mass ratios.

Thanks in advance.
Any advice would be of a big help!

PS: I found a thread similar to my question, actually almost the same thing here:
http://www.bulletphysics.com/Bullet/php ... f=4&t=2386
sparkprime
Posts: 508
Joined: Fri May 30, 2008 2:51 am
Location: Ossining, New York

Re: Bullet for online 3D space simulator!

Post by sparkprime »

40,000 is a lot of objects, you may need to experiment with different broadphases to get good performance. Some of them have default maximums of 32000 objects but you can pass in a new maximum as a constructor parameter.

What happens when objects collide? Do they just explode? Do you really just want dynamics?
eviX
Posts: 3
Joined: Wed Aug 13, 2008 8:21 am

Re: Bullet for online 3D space simulator!

Post by eviX »

sparkprime wrote:40,000 is a lot of objects, you may need to experiment with different broadphases to get good performance. Some of them have default maximums of 32000 objects but you can pass in a new maximum as a constructor parameter.

What happens when objects collide? Do they just explode? Do you really just want dynamics?
What we would like is a realistic interaction in space, but because performance issues we have to figure out the level of realism we can use in the physics model. So far we omitted friction as a first step, i guess we will have to drop more things in future to maintain performance for this 40.000 objects (some of this objects will be more complex, not just a box)

I have some thoughts about how to gain some performance boosts
- one idea would be to simplify the collisions at very high speeds (because the observer wouldn't notice the collision was wrongly computed if the impact happened at 10km/s, we could just throw the objects away at a random angular speed and a arbitrary translation speed, or the shuttle could just explode and break apart at such a speed etc )

- another thing we could do is to also simplify the model of objects (just for the physics part, the graphics would draw really nice and detailed models)

The biggest problem is how to deal with such high speeds in the system, do i have to implement a personal collision detection algorithm (something like CCD)?

If anyone has any ideas on this matter, please feel free to express yourself, any advice is important for me!

Best regards,
Nick
sparkprime
Posts: 508
Joined: Fri May 30, 2008 2:51 am
Location: Ossining, New York

Re: Bullet for online 3D space simulator!

Post by sparkprime »

You will probably only have to worry about performance in the broadphase, which is computed with bounding boxes so it doesn't matter how complex your collision meshes are. That sort of thing matters more when you have a big pile of objects that are all touching and affecting each others' positions. Of course if you're going to have big space ships with lots of spaceships flying around / close to them then it could be a problem since bounding box tests won't be enough anymore. As for what happens when things collide... I imagine it would be quite nice to have a debris field where things are floating around and occasionally bumping into each other. All this should be possible I think. Most bullet simulations have clear distinctions between static trimesh geometry and dynamic geometry, so if you do have mother ships, you may like to make them mostly static. Otherwise, you may want to look at gimpact for your ship geometry.

Most of this is speculation as I haven't got to the stage where I can scale up the physics simulation in my game yet.

I suspect you won't get definite answers about performance on this forum unless someone has done the exact same thing you want to do. Your time is probably better spent hacking something together, e.g. creating 40000 instances of a sphere and applying random impulses to them and seeing what the performance is like. If you can run it through a profiler and see where the bottlenecks are, you might get good advice. I think the bullet project in general is very much a platform for experimentation and seeing what can be done, and I think as a user you need to have the same attitude because top-level advice often isn't forthcoming. Low-level advice is usually available though.
eviX
Posts: 3
Joined: Wed Aug 13, 2008 8:21 am

Re: Bullet for online 3D space simulator!

Post by eviX »

Thanks sparkprime for your advice.

Did anybody else try working with great speeds in Bullet (more then 10KM/s)

Thanks,
NIck