Well I've been doing a little work on auto generating maps or filling regions with tiles. Hopefully it can evetually be used to make designing maps easier.
First off, I would like to point out that the code is in a very early test stage and probably needs some rewrite before it could be used in an editor.
Anyways, here's a link to some images of the initial
Results. (I don't want to spam dialup users with large images).
The first set (marked initial results) was a simple algorithm that tried to fill each tile once. If it couldn't find a tile that "fit" then it just left it as blue and continued on. This created more problems than just unsightly blue tiles. It also caused areas of the images to be developed seperately and when they came together, there was no way to merge them properly. This resulted in more blue tiles and no real chance to let the user fix things up. (At least not without modifying large regions).
The second set of images (marked 2-x) used a backtracking algorithm to make sure all tiles were filled in. If there were no tiles that "fit" a certain location, nearby tiles could be deleted and it would try again. This lead to much better results as there wre no unsightly blue tiles, and the whole image was developed together so there wasn't the same problem with things not matching up.
There are still a few problems with the second version which I'll eventually be fixing. Those of you who are picky enough to notice, you'll see some of the edges where one terrain type transitions into another aren't quite right. Sometimes blocks that don't represent an edge transition get used. They tend to sort of blend in, so you might not notice so easily, but the flatness of the edge can sometimes be a bit detracting.
Another problem is diagonal banding along terrain transitions. This is fairly evident in all the images. It is a side effect of the weighting used in the random choosing and the order in which the tiles are placed. It is statistically favoured that a new tile is choosen from the terrain type of surounding tiles. However there is also a constraint of the tile having to "fit" with the surounding tiles. So once a transition starts, the seam tends to continue to ensure the fitness, but it lags by 1 tile on the line below since the transition tiles don't usually force the tile below to be a transition tile, but the new terrain after the transition will force the tile below to be a transition tile. Anyways, it's only really a problem because I built the images line by line, starting from the top left, moving down to the bottom right. I plan to mixup the growth in future versions so it can, say, start in the middle and grow in a blob around the starting point. Kinda like the blight.
This initial version just generates a square of tiles. Really what it does, is it choose a starting seed tile, and grows things by lines from that starting tile (in the top left). Eventually in future implementations, the seed tile(s) can be placed anywhere, and it will grow around them. It will be most effective starting at some central point and growing outwards. That way there won't be any problems with two seperate parts growing together and creating a seam. However, it should (hopefully) also be useful to fill in a bounded region, creating large objects (like volcanoes, craters, wreckage), and (eventually) to fill in seams or ridges between two parts/terrain types. Oh, and it does the polar caps really nicely too. (thumbsup)
Right now, the growth is fairly unrestricted. But I'm thinking of adding in controls to restrict growth to using tiles from a certain terrain only. I've also got some ideas about having it generate ridges properly, but no idea yet how well that will work out. Anyways, that sort of work seems like a ways off. For now, I'm aiming at something to help fill in flat terrain with matching tiles, but still have a bit of variance so it doesn't become an eye sore.