Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I was looking around at this site about eight months ago and wish I saved the location of this topic but I was wondering the different map rendering styles that you can do in XNA. The one style I looked at was using a text file to pull characters like "X" would be a monster and "O" would be the player. Is there another way with out an external file that I can put tiles from a sprite sheet to randomly create a map. Of course when dealing with random buildings I would have certain building designs so that if some one was playing they wouldn't see a building with half a wall missing.

This is for a top down 2D game.

share|improve this question
add comment

2 Answers

There are a lot of different ways to store this information. I would suggest using something standard, though. For instance a lot of opensource games use the TMX map format as used by the Tiled editor and several others.

TMX uses XML but can store its data in compressed form, as an array, or using a CSV layout. The storage method is for you to choose in the editor.

share|improve this answer
add comment

To add to the above answer Nick Gravelyn makes a very nice library for importing and rendering TMX maps. Takes about 10 lines of code to import it from Tiled and render it.

https://bitbucket.org/nickgravelyn/tiledlib

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.