RobertCrandall
Posts: 2819
Joined: 2/25/2002 From: Burlington, Ontario Status: offline
|
The new map model is kind of interesting for us. We wanted roughly the same thing as before but *much* easier to produce and modify. What we did was we went to a modified tiled system that operates like this: We have four layers to the map. From bottom up they are elevation, natural terrain, rivers, and man-made terrain (e.g. buildings and roads). They combine into one visual layer but are strictly separate underneath. Each location is still a 500m by 500m square but we have divided it into a 4 x 4 grid of "cells" within. Each cell can hold its own 4 layers and there is no requirement that they be the same. The various values of the 16 cells are averaged together to produce the overall values for the location. For example, elevations are tracked in 10m increments. We can drop a "10m" elevation tile onto a location and then drop two "20m" cells onto it somewhere. The average elevation of the whole becomes (14 x 10 + 2 x 20) / 16 = 11 (rounded) meters. The finer grain of the cells lets us create tiles with a near infinite variety of values from just a handful of tile and cell images. To start a new map we fire up the map editor, select new map, and specify the size. 40 x 30 is still my favourite but you can go larger or smaller if you like. No, I haven't tested to see how big it can get... You also select a default elevation (e.g. 10m) and a default terrain type (e.g. clear) and you are presented with the basic map. You then select amongst the four layers to paint on, the various tile and cell sets to paint with, and you get creative. If you don't like what you have drawn then you can erase it or just paint something else over it. A 40 x 30 map (1,200 locations or 19,200 cells) takes me about 20 minutes to knock out. I'll fuss over it later of course, but the basics are there in 20 minutes. At this point the map will look like a refugee from the 8-bit Atari days. The elevation layer has a resolution of 16 pixels per cell and looks rather blocky to the eye. What we then do is apply a Gaussian blur to the elevation layer to get rid of the blockiness and then posterize it to resolve the blurred colors back into discrete height bands again. This gives us a map reminiscent of the FPG maps but requiring something less than 200 hours a pop to produce. It is also way easier for a player to use. The 'blocky' version of the map is saved as a stream of map objects to an *.m (map) file. It can be reloaded and modified at will in the editor unless it is password protected. It is not used by the game code though and need not be distributed. The key location averages and values derived from the map are saved as a *.p (parameter) file and are used by the game. Finally, the finished map is flattened to a single layer and saved as a *.png graphics file for use by the game as the main battle map. I mentioned "averages and values derived from the map" above but where do those values come from if all you have done is exercise your painting skills? Ah, the tile and cell images that you painted with are coded in their file names with the key values we are tracking. These are the mobility multiplier (%), the visual hindrance modifier (%) and the cover height field (m). Swamp, forest, rough, cropland, towns, farms, whatever are given a visual image and rated on these three attributes. As with the elevations, the location values are the averages of the painted on values. Does this that you can make your own map artwork and use it? Of course, that has been the intent all along. You make not just single images but horizontal strips of images and the game will then randomly select and remember the particular one to use. If you have the password you can add completely new tiles (image and values) to old maps, redo the graphics but keep all the values, or change the values and keep the images. We are trying to be mod-friendly here. All artwork is bundled up into the .m file so you will have it anywhere you take it, but since you are not required to distribute it with your scenarios you can keep control of it too. It is an open ended system.
|