Author Topic: Auto Map Maker Source  (Read 1434 times)

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4840
Auto Map Maker Source
« on: July 02, 2009, 11:53:14 PM »
Someone was asking about the auto map maker project I had a long while back. I figured I'd post the source. The project is essentially dead though. There were some flaws with the idea, although, it does produce at least reasonable results, so maybe someone can do something with it.

You can not save the generate map sections with this tool. At least not without modifying the source code a little. It was designed as an editing tool for the fitness lists. That's what the Save/Load options are for under the file menu. It can also hang if if given a bad starting tile, or too restrictive of a fitness list. This is due to the backtracking in the algorithm, which could get caught in an infinite loop if there is no solution. In particular, if you try to set a lava tile as a seed, it will hang.

After a few tries, you may also notice a certain pattern to the output. It tends to generate things in lines from the top left to the bottom right. This is an artifact of the filling algorithm caused by it filling left to right, top to bottom. It tries to find an appropriate tile to place at each point, and generating output in this pattern has this effect due to how randomly placing transition tiles will force a new tile set to the right or below the transition tile. If you wanted to get rid of this diagonal line artifact, you might consider modifying the algorithm to fill the tiles in a random order.

There is a compiled exe along with VB source code. It may crash during startup. This is because the COM DLL is not registered, or a different version is registered. It's the same backend that the map editor uses. I vaguely remember instructions being posted for the map editor about what you can do if you encounter this problem. If you run into this and take the time to figure out how to register the DLL, please post the instructions here. (RegSrv? or something?) You can get it to run from within VB by setting a "Reference" to the DLL packed with it. (You'll need to browse for it).


The fitness lists were generated by scanning existing levels that came with outpost 2, and checking for occurances of two tiles being placed next to each other. I believe the number of occurances also affects the probability of choosing a matchup. As the original maps had quite a few graphical errors, this required cleaning up the fitness lists. Hence the editing tool in the attached package.


I had another idea, using the tile group information found at the end of the map files to produce better fitness lists, or rather, going with a slightly different system using the tile groups to match things up. It would probably produce better results, and perhaps be less likely to cause hangs if implemented properly. It should also give more control over placement as the groups have some implied information (like common terrain type), rather than simply checking if two tiles were ever next to each other in the original maps.