* .xlsx map file
* .xml map file (xml spreadsheet file, ready to convert to an array)
* .arr map file (in MMF2 array format)
* .mfa example file (showing how to load the map in MMF2)
I'm using Excel Starter 2010 - the exact procedure will vary depending on which spreadhseet app you are using.
I generally prefer Excel 2003, but it is not ideal in this case, as it has a limit of 3 conditional formatting rules (Excel 2010 allows 64).
Making a game tile-based is a great way to cut down on the amount of graphics you need to produce, and also speeds up level creation. However, it's almost always necessary to make a custom map editor - fine if you're working on a big project, but very tedious if you just want to make a few quick maps to test an engine.
One solution I've found, is to use Microsoft Excel as a map editor. By using Excel's "conditional formatting", it's possible to make quite a functional map editor - and it's even possible to replace a lot of your MMF2 map loading code with just a few formulae in Excel.
However - before going any further, I would like to stress that this is NOT a replacement for a custom map editor, except in cases where you just want to see a few quick results.
The first thing we need to do is adjust the grid, so that the cells are all square. To do that, just click on the little triangle where the horizontal and vertical headers meet, and then drag the edges of the header cells.
Before going any further, set all the values in your map area to "0" - it turns out my array converter still has issues with blank spaces for some reason.
Next, select all the cells in your map area.
Click on the "conditional formatting" button, and then "new rule".
We're going to make it so an array value of 0 = water and 1 = land.
Now at this point, our map looks blue, but if we enter "1" into any cell, it turns green.
That's all well and good, but we need to be able to place other objects as well as background terrain.
So, make a copy the current worksheet. We'll rename the first sheet "Terrain" and the new copy "Units".
Select all the map cells in the Units sheet, and set them to "0".
Keeping the cells selected, click on the "conditional formatting" button, and then "manage rules".
Double click where it says "Cell Value = 1".
Select the option to "Use a formula to determine which cells to format", and then click the button to select a range of cells.
At this point, go back to the Terrain sheet and select all your map cells. Now, you must remove all the "$" signs from the resulting string, and add "=1" at the end.
Repeat for the other formatting rule, but using "=0" instead of "=1".
At this point, the Units sheet will look the same as the Terrain sheet, except without any numbers - and that's because (as you probably guessed by now) the numbers on this sheet will represent units.
Select all the maps cells, and select "conditional formatting" again - but this time, let's select "Icon Sets" and pick the flag set of indicators.
Select "manage rules" again, and adjust the rules for the icon set. Each army will have 6 different unit types, so lets make it so 1-6 are red units, and 7-12 are green units.
Now we just place a few units, and we're done.
However, using Excel we can do some more fancy stuff.
You may have read my article about terrain transitions - http://www.create-games.com/article.asp?id=1869 (apologies for the broken image links - check the example downloads to see how it works).
That always involved some extra code when loading the map - but we can do all that very easily in Excel instead.
To start with, create a new blank sheet, and adjust the grid size again.
Now we just need to use some IF() functions to check for land in each diagonally adjacent cell, and add either 1, 2, 4 or 8.
Finally, repeat with another sheet for the directly adjacent cells.
Export your Excel spreadsheet as an "xml spreadsheet" file (but save a copy in Excel's own format first - xml doesn't support all the features).
Load the MMF2 array editor and import your xml spreadsheet file. Then just save it to a number array, and you're done - simply load the map into MMF2 in the normal way (see the example).
So there you have it - kind of a rushed article, but you get the idea
Hi can't seem to get this I am using exel 2007
When I try to format values where this value is true:I am told "You cannot use references to other worksheets or work books for conditional formatting criteria." Another thing can I use hexes instead of tiles?
Any help would be welcome. Comment edited by mailmanic on 12/6/2012
A thought here if you were to have a hex shape in a rectangle and have the parts of the rectangle which was not the hex say make them white and make the white transparent when implented in your mmf project will that not make your grid look hex shaped. you would have to stager the rectangles.
What are your thoughts?