How far can you make it? Battle through randomly generated lands and 1000 randomly generated dungeons. Slay monsters, gather resources, and craft new an powerful weapons. All to see just how far you can go. Die in dungeon 999? Start over from one. This is a war of perseverance.
An in depth look into how the worlds in 1000 Dungeons are randomly generated.
Posted by trihex on Apr 13th, 2013
I wanted to take a little time and give an in depth explanation of how the random world generation for 1000 Dungeons works. I think it's an interesting way of approaching random world generation that gives some very interesting (and non-obvious it is random) results.
When a player starts a new game of 1000 Dungeons, they are asked to name the world. The name given is used as the seed for the random generation of all terrains and dungeons for that game. This allows players to "share" worlds in that if they find an interesting layout, they can tell their friends the world name they used and they can generate the same world and dungeons. The experiences the players have will not be exactly the same though, as there are still random elements that are not seeded via the world name, ensuring that there is variety to every new world built.
In each world, there are 10 locations the player must travel through, clearing out every dungeon in a location before moving to the next. Each location has 100 dungeons in it. 100 dungeons in each of 10 worlds, gives you the 1000 dungeons the title of the game eludes to. The player has the ability to choose the relative size (small, medium, large) of the dungeons, so they can control how long it will take to progress through the game. In this post, I will be detailing how the game generates the 10 locations of each world.
Each of the locations is made up of a 100x100 tile map, each tile representing a specific terrain type. That gives each of the 10 worlds 10,000 tiles of terrain to randomly generate. 1000 Dungeons uses a seed and grow method to fill all of the 10,000 tiles per location. What we mean by a seed and grow method, is that out of the 10000 tiles for a given map, 100 of those tiles will be filled with a random terrain type (grass, mountain, water, forest, desert, etc.). Then, in successive loops through the map, each of those tiles spreads its type to any blank adjacent tiles.
So as an example, here is what an 8X8 tile map might look like after the inital seeding:
As you can see, we have a randomly placed grass tile, forest tile, mountain tile, and water tile. The location of each of those starting seed tiles is kept in a list for quick access during the next step.
After the initial seeding, we then begin to grow each seed tile by setting the eight surrounding tiles to the same type as the seed:
One of the first things you may notice is the blank squares by the water and forest areas, highlighed here:
One of the next steps in the evolution of the generation system is the ability to place transition tiles when certain types come up against certain other types. As an example, if water moves to the edge of a forest, then we end up with swamp:
This growth phase is repeated until all of the tiles of the map have been filled:
The final step in the generation process is to do a final clean up pass. This final cleanup pass looks for any stray single terrain tiles, like a loan grass tile in the middle of a mountain range, and replaces that tile with the terrain type of one of the randomly selected tiles surrounding the lone tile.