Game map - tarrain + buildings

Tau
Posts: 25
Joined: Tue May 01, 2012 11:52 am

Game map - tarrain + buildings

Post by Tau »

Hi all
Map for my game consist of one heightmap and buildings that are placed on it. What is better for performance?
To create each building and map with separated rigid bodies and compound shapes, or to create entire map as one rigid body and one compound shape that will contain shapes of heightmap and all buildings.
Tau
Posts: 25
Joined: Tue May 01, 2012 11:52 am

Re: Game map - tarrain + buildings

Post by Tau »

Or similar question:
When creating a map is it better to create entire map as one body with btCompoundShape OR to create different static objects with their own bodies and shapes?
xexuxjy
Posts: 225
Joined: Wed Jan 07, 2009 11:43 am
Location: London

Re: Game map - tarrain + buildings

Post by xexuxjy »

I think the most truthful (and unhelpful answer) is that it depends on your world and what you might want to do with your objects. I'd generally say that breaking it up would be more useful though, if you have a heightfield or triangle mesh for your ground/terrain you can give it one particular type of collision mask, and possibly a different one for buildings and the like - another advantage is that you could add/remove building collision objects, or vary their complexity depending on where the player is on the map. Hard to know from a performance point of view without knowing some idea of scale of map, number/complexity of objects etc.
Tau
Posts: 25
Joined: Tue May 01, 2012 11:52 am

Re: Game map - tarrain + buildings

Post by Tau »

Ok thanks, i will try both and see what happens.