Procedural Map Spawning in Edge of Twilight

Still planning on a Post-Mortem, but I've had a few friends ask how we did the procedural maps (Map, only the first one made it into game for the Jam) for Edge of Twilight, our entry over here: https://ldjam.com/events/ludum-dare/45/edge-of-twilight

To Start, for those who aren't interested in playing (Side note: We could use a few more votes, give us a shot if you like Difficult Strategy Games!)... Here's a quick overview of the map configurations in games, and the XML that runs the procedural map generation service.

ProceduralMapSpawning_LDJAM45.png

The Scenario File, which is an XML Data Sheet, holds all of the Data that makes up the Game Scenario. It's loaded at runtime and parsed out to all of the sub-game functions. The one we care about is the Map Generator Service. The MapGen gets two crucial pieces of information, how big the map is, which is used to create a set of initial valueless tiles. And then it gets the list of procedural rules that it runs in sequential order.

To flavor a map, I use the SETTILE function, and tell it to set the map to tiles of that type by using the @ALL modifier. I can also use it to set specific points on the map as specific types of tile, using the @(X,Y) command, or using the helper @CENTER. If no positional modifier is specified, it will be random. I can also specify a modifier inside the spawner data, using the "on" tag, which will only allow the tile to be set on that type of tile. I can also restrict the range on the map, using the minx/maxx, miny/maxy modifiers.

By adjusting the order in which I change things, and how I layer the changes, I can achieve pretty good results considering the limited Tileset and timeframe we had to build the game. I wish we'd had enough time to write the other two scenarios, but a lot more goes into them than just the Map Construction, and we cut it too close on too many other vital features. But I'll cover that in a Post-Mortem later!

Thanks for giving this a read, and, I guess, Follow me on Twitter? I Don't know: https://twitter.com/OccultGameDev