How to deal with "HUGE" world ? Really Need help!~

Post Reply
ocean2oo6
Posts: 18
Joined: Thu Nov 15, 2007 2:01 pm
Location: Sichuan province, China
Contact:

How to deal with "HUGE" world ? Really Need help!~

Post by ocean2oo6 »

Hi all,
I'm trying to integrate bullet to our existing game. In our game, all models' unit is centimeter. So,models with a width of 1000 or even larger are so common. I find it sometimes bullet comes to be not stable.For example, when a dynamic convex hull is 500 * 500 * 500 as large, it moves strange sometimes. When i search around in bullet document and forum, it's suggested to use meter as unit.
If so, how to choose my unit? Convert all models unit to meter or is there an easier way to do so?

My second question is also about "size". Our universe (in our game) would be huge and even limitless in boundary. But i would do some regional selection to decide objects, which are close to player, to join in collision would. So my collision world would handle objects located inside (-1000,-1000,-1000, 1000,1000,1000) this time or then (1000,1000,1000,3000,3000,3000) . As you see, the "size" is the same, but handle region is changing. If i do this way ,bullet's precision wouldn't drop or not? I can guarantee that collision world wouldn't be too large, but i cannot guarantee that my world's "location".
If so, how to modify my collision would's AABB or adjust it according to my real world?

I wander if any of you understand my questions because my poor English :) .
Any input would be appreciated, thanks in advance!
ocean2oo6
Posts: 18
Joined: Thu Nov 15, 2007 2:01 pm
Location: Sichuan province, China
Contact:

Re: How to deal with "HUGE" world ? Really Need help!~

Post by ocean2oo6 »

Is it best to make my objects inside (-1000,-1000,-1000 --- 1000, 1000, 1000)?
If my scene is continuous and huge, but "REAL" handle size is small. Then how can i adjust collision world ?
User avatar
Dragonlord
Posts: 192
Joined: Mon Sep 04, 2006 5:31 pm
Location: Switzerland
Contact:

Re: How to deal with "HUGE" world ? Really Need help!~

Post by Dragonlord »

Not sure if you are trying to do what I am trying to do. What do you mean with boundless? Even though I'm also heading for a larger game world there is one important factor: you have to populate this vast space. Hence large is not always better hence boundless is a bit... stretched. Some explanation would help.

Now what goes for doing a large but bounded world I used first cell system with each cell 1km in size. Gave though too many problems and things had been utterly complicated. So I switched to simply using double for world coordinates and float at all other places ( where you don't need the large scale precision ). Bullet is already compilable with double precision support and on 64-bit ( which is the future anyways ) double is even slightly faster than float. This way you can do 1e9 km safely with good precision. I doubt this boundary is going to affect you in any way. I don't know though how this approach scales to consoles. Erwin knows definitely better if this is a viable approach. Clustering you need though anyways ( hence only having loaded a surrounding of X km around the player ) since double only fixes the issue of large worlds but not the time required to process massive amounts of objects.
ocean2oo6
Posts: 18
Joined: Thu Nov 15, 2007 2:01 pm
Location: Sichuan province, China
Contact:

Re: How to deal with "HUGE" world ? Really Need help!~

Post by ocean2oo6 »

Thx for your reply.
In my system, i'm thinking something like cell system. However, as you state, "Bullet is already compilable with double precision support"?
Then, if i set
btVector3 worldAabbMin(-1e9 km ,-1e9 km ,-1e9 km );
btVector3 worldAabbMax(1e9 km ,1e9 km ,1e9 km );
It wouldn't drop bullet's precision or make it unstable? or is there anything must to do that I'm missing?
At the same time, would it be save to add a large(maybe 500*500*500) object to this world?
User avatar
Dragonlord
Posts: 192
Joined: Mon Sep 04, 2006 5:31 pm
Location: Switzerland
Contact:

Re: How to deal with "HUGE" world ? Really Need help!~

Post by Dragonlord »

You need to compile with -DBT_USE_DOUBLE_PRECISION to get double precision. Now what goes for the initial AABB only use the largest sizes you really need. I doubt you need 1e9km world. Just as reference representing the entire earth would be 4e4km ( 40k km ). This is already HUGE for game terms. Large game worlds tend to be around 60-100km ( crysis I think had 60km if I'm not mistaken ) and that's already a lot of space to cover with meaningful geometry. Furthermore what goes about large objects I would recommend to map your coordinates to meter metrics to not let them grow utterly large. To my knowledge bullet likes metric units better and it's anyways easier to work with than arbitrary unit.
reltham
Posts: 66
Joined: Fri Oct 12, 2007 6:28 pm
Location: San Diego

Re: How to deal with "HUGE" world ? Really Need help!~

Post by reltham »

In the game I am working on, the world is seamless and pretty large. We manage a set of "chunks" around where the player is at.

For Bullet we use the btDbvtBroadphase, and it is working great for us. You just add/remove objects and it dynamically adjusts.

Also, I would switch to using meters for your units, and avoid using double precision unless you are willing to live with things being significantly slower.
ocean2oo6
Posts: 18
Joined: Thu Nov 15, 2007 2:01 pm
Location: Sichuan province, China
Contact:

Re: How to deal with "HUGE" world ? Really Need help!~

Post by ocean2oo6 »

Dragonlord,reltham
Thank you for your reply, and i think i have understand something now. And i'll try the way what you two say.
thank you again~ :D
Post Reply