This might be a long and torturous post as random map generation is a bit complicated and my idea might be a bit technical.
My idea is first to split the world in ‘surface’ for the open world and ‘dungeons’ for the more tunnel like parts (which will be below ground).
The world map is the map where players move around, it is saved off as aligned 40×40 maps on the servers hard drive. They are loaded up or created on the fly as the server needs them. They are only saved if they change so that we can have server reboots or worse, crashes. This is completely transparent for the players, well except for the reboots!
The surface might be just a set of pre-created 40×40 maps, each having a ‘type’ for each side, for example sand to the right water to the left, stone to the north etc. so we can use those parts and build on to the already existing puzzle-block maps.
A world could start off with just one 40×40 map and the rest being generated as players walk around.
The dungeon will be generated using pre-created any-sized map-parts, each one with one or several connections. The generation will be done on the fly so that a big world can be possible but to see it you must (or someone must) explore it to generate it (hence the Schrödinger title). For ease of use I will create maps with Weltmeister (a tool from the Impact Engine pack) and save off data about the map and its connections in a database. I will also place monsters, items and other game related things on the map parts but I guess I’ll cover that in another post and keep to the map generation in this one.
For this to work I need to describe each ‘connection’ so that when a player closes in on an undiscovered part of the world, ie. there are ‘open’ connections nearby, the database can match those open connections with the pre-created map parts connections and insert a corresponding part on the general map (thus closing the open connection and either sealing of that trunk or add new open connections, it all depends on the pre created map part).
The way I have thought of is to only save off the blocking tiles of the map-connection in a sort of unique (for each connection type) string:
Say I have one stone tile (nr 31), some sand and then another stone tile (top to bottom) the string could be as follows: “31_0,2_31″ meaning one tile nr 31 and two steps below, another tile nr 31. Like this:
Inserted in a database, other connections with the same configuration can be found quick and easily, their map recovered and then, if the new map part does fit into the world map (not crushing existing tiles) it can be used, the connection be removed and the new maps connections inserted in the database (if the new map part isn’t a dead end).