storing map data for a 3D TBS

Started by
0 comments, last by yahastu 16 years, 3 months ago
I am having trouble coming up with an idea on how to store map data for a 3d turn based strategy type game. map this is a really simple example of the problem. my hope is to make most of the objects in the game destructible, everything from doors, walls, to sections of floors. think along the lines of the old XCom games. my current model is a 40x40 grid with 3 levels. in most cases the only floors that could be destroyed are ones inside a house. what i am not sure on is how to develop a class to handle the map. the only thing i have come up with is to make a tile class and for each tile i set flags and values for things like height, walkable, move cost, wall (north, south, east, west), etc. this just looks bulky and it seems that there should be a better way. thanks for any help, i have been beating my head against a wall trying to come up with a good idea to do this.
A priest, a rabbi, and a monkey walk into a bar. The bartender says," hey whats going on here, is this some kinda joke?"
Advertisement
It depends on how you want the mechanics of the game to actually work. If pieces of the map can only be destroyed (and not moved around) then a tile set would be pretty good. ie, you have a grid (matrix), and each type of grid cell has an ID which is simply recorded as a number in the table, or alternatively (identically) a pointer to a static instance of that class type. That's the simpler way to do it.

The more complicated but more powerful way to do it would be to maintain logical objects and dynamically break them into smaller objects when they should be broken. This would be how crysis does it for example, and it would be necessary if you wanted more realistic deformations, or the ability to move objects around at intervals more precise than your grid.

This topic is closed to new replies.

Advertisement