Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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

Which is better for game prototyping of a game map: a tile map or an image map? What are their respective pros and cons? Should I, in other words:

  • Load the map as a png and set collision points (easy to render; less work)


  • Load the map as tiles with tiled map editor and then set the collision points.
share|improve this question

closed as not constructive by Byte56, Trevor Powell, bummzack, Laurent Couvidou, Josh Petrie Mar 1 '13 at 15:55

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

Totally up to your end goal for the game. From your description alone, it sounds like the first one is your best choice, since it's easy to render and less work. – Byte56 Feb 28 '13 at 17:44
@dineshswamyp for prototyping, you should use whatever approach looks easiest to implement, so if the prototype doesn't work, you wouldn't have wasted additional time. – user1306322 Feb 28 '13 at 17:47
@Byte56 i ll try it out myself . is ther any bigger lose in the first approach .. i mean "You cant achieve this" with that ? – dineshswamyp Feb 28 '13 at 17:52
I can't really say. It would depend on how it's implemented. If you check out the FAQ and read about "Which is better" you'll see how this question applies to a Gorilla vs Shark situation. There are too many variables to give a definitive answer either way. – Byte56 Feb 28 '13 at 17:55

My recommendation would be to load the map as tiles with tiled map editor and add support for reading-in objects, not just tiles, from those xml files, so you can use the objects to define the collision points. Here's an example of what I mean:

map example

The red rectangles are objects drawn in a defined "collision" layer. Blue rectangles are objects drawn in a defined "exits" layer. And you can see an icon of a sword there, which is actually a tile-object, not a tile, and represents in game logic (in this case, a mob). There are a few advantages of this approach:

  • Lets you rapidly prototype a new level. All the collisions, mapping, mobs, etc. are in the same place.

  • Since you're using tiles, you can draw a different map easily. I.e., you don't have to take an image into a photo editor, you can just draw new walls etc., and play around with it.

  • Separating out the game logic from the level editor lets you have someone with no (or little) knowledge of the codebase easily create maps.

  • By using objects for the collisions instead of the tiles themselves, you have more versatility. I.e., you can draw polygons that aren't square for, for example, diagonal collisions. Or you can draw lines so that an un-enterable "block" needn't be a full tile wide or tall.

As noted by the astute Benjamin "Danger" Johnson in the comments below, using a tile map does have its disadvantages, including increased load times and rendering performance. In your question you mentioned your goal was for prototyping, so my general advice is not to worry about load times and performance until you're ready to worry about load times and performance. If you develop your maps with a tiled-approach, you may decide when you're ready to optimize that it's worth migrating some or all of them from a tile approach to larger images.

share|improve this answer
You should also mention the disadvantages such as increased load times and rendering performance hits. While these are relatively small (depending on level size) it is important to know. I do however completely agree in that Tile maps are usually the best solution in cases like this due to their high re-usability and how easy they are to understand. A well defined tile map allows for so much easier design and even allows you to randomly generate levels on the fly (granted you need to add some validation to ensure levels are playable). – Benjamin Danger Johnson Feb 28 '13 at 19:53

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