Jump to content
  • Advertisement
Sign in to follow this  
shadowayex

Saving 2D map data

This topic is 2603 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'm making a 2D game that uses a tile based map system. I want to save information about each tile into a group that can be read back later. I've asked around about general ways to store data, and I've been suggested that saving the data as comma separated values would be an easy way to read and write the data, but I'm not sure yet.

I want the data to be able to be read and written by the game only, and I don't want the data to take up too much space (as there will be a lot of maps). The maps are of variable size. Some may have only a small area of tiles while others could span quite a bit.

I don't know much about different means of saving data to files (and the pros and cons of each), nor do I know anything about compression or anything (this was also suggested). I've read and written to files in certain formats, but the files were always text files and they were readable by anyone.

Can anyone point me in the direction of a good way to store and protect my data effectively?

Share this post


Link to post
Share on other sites
Advertisement
"Can anyone point me in the direction of a good way to store and protect my data effectively? "

Protect your data from what / whom and why would you want to do this ?

Share this post


Link to post
Share on other sites
Players.

The game isn't like an MMO game or anything (although it will feature some LAN co-op). People would just play on their own computers. If they got into the map data and messed something up, then their game would most likely not work, and that wouldn't make for a very fun game.

Assuming most people would know better than to play around in the game data, this shouldn't be a problem. But I just want to make sure that curious people don't mess up their copy of the game.

Share this post


Link to post
Share on other sites
Compared to comma-separated values, a binary data format would be significantly smaller, faster to read and write, and less susceptible to end-user modification. You could apply some kind of encryption, but that seems unnecessary. As for compression, zlib or lzo may serve your needs.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!