Advertisement

Map Formats - rectangular isometric maps

Started by June 19, 2001 04:07 PM
0 comments, last by zennehoy 23 years, 7 months ago
I am programming an iso-rpg with directdraw 7. While doing this, I have come across several different methods for storing maps, and I'd like some feedback as to what works well and what doesn't. Let's assume that we store the map as a simple 3-dimensional array of pointers, map[layer][y][x]. Going by everything I have seen on the web and in books, information is simply stored in "cartesian" coordinates. This is doubtlessly the most intuitive method of doing this. A simple 5x5 map would look like this: +++++ +===+ //assume = is a wall +=+=+ //and + is grass or something +===+ +++++ It is really easy to see what the map is meant to represent. The problem with this map is that you have huge black areas on the screen when you approach one of the corners. There is really no way of drawing the map to stay flush with the edges of the screen. An alternate way of storing map info is as follows + + = + +  + = = + + + = + = +  + = = + + + + = + + or in matrix format: + + = + + + = = + + + = + = + + = = + + + + = + + This draws the same 3*3 walled in area, but now the map coordinates are much more similar to screen coordinates, because the map doesn't have to be rotated by 90 degrees. This method also allows filling the screen and never displaying black edges, despite maintaining an isometric look. I am wondering why there are no references to anybody having tried this. The math is a lot simpler, which should mean that it would execute faster. Is there a reason this way is not popular? Just curious. Edited by - zennehoy on June 19, 2001 6:06:44 PM
i believe you are describing staggered maps, characterized by every other row being offset by half of the tile width. these types of map are good to use when you want to have a rectangular playing area completely filled up and or when you want the game world to wrap around. one of the downsides to staggered maps is in moving from one tile to another is irregular.

Get off my lawn!

This topic is closed to new replies.

Advertisement