Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

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.

share|improve this answer

Your Answer


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.