There are a number of ways to implement an automated mapping system, with the requirements of your game being the biggest determining factor on how you implement the automated mapping. There are two parts to an automapping system. You need to store the data for the map, and you need to display the map.
Marking the areas of the map that are known to the player is very dependent on how your map is organized. If you have a simple tile map, then you could go with a very simple system of having a flag for each tile indicating if if has been seen or not. More complex structures can be broken into separate visible areas with each area assigned a bit. Another method of creating an automap is to just create a new map as the player journeys through the map. This takes significantly more memory, but has the advantage that structures such as secret doors can remain secret until the player actually enters them without increasing the complexity of the automap renderer.
Determining what parts of the map has been uncovered has it's own challenges. The easiest way, which is the method I usually choose, is to simply unveil a block of the map that surrounds the player. If you have more time to spend on the automap, then you could actually do visibility checks to mark all the areas that the player can possibly see as uncovered. You could also increase the complexity of the automap data by tracking where the player has actually been and what they have seen. The renderer could then display known but non-entered areas as grayed out.
Displaying or rendering the map is simply the matter of drawing the parts of the map that the player has seen. In flash, tile methods can be fairly simple to implement, but if you are using later versions of flash, creating the automap as a bitmap is more efficient. The thing about automaps is that the map doesn't need to be generated. If you wanted to, you could hand draw a map and then use the automap data to slowly uncover portions of the hand-drawn map.This could add a really neat feel to the game, and for games who's maps are not logically laid out would allow for an automated mapping system.
Wednesday, October 10, 2007
Implementing an automap
Subscribe to: Post Comments (Atom)
Post a Comment