Jump to content
  • Advertisement
Sign in to follow this  
MrBob

storing map data for a 3D TBS

This topic is 3903 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!