Early last year for a game called Kolumbo
I made a plugin for generating random levels (called "Dungeons" for RPG traditions). Not to take credit for other people's work, it was based on Jamis Buck's somewhat famous D&D dungeon generator. I didn't release the plugin as it was messy and also had many other functions for our game.
Let's fix that mistake, fresh start!Download
Plugin, .cap, and demo exe all in one happy package.Source code
It can do this:
And many variations of course, preferably with a better tileset. Unlike the last version, this one can create the tile objects on the layout automatically (after you tell it what object is what). I haven't added the traditional "for each tile... get tile at pos" actions/expressions yet.
The action workflow is.
- Set object mapping (currently only 0 = empty space, 1 = wall)
- Set parameters
- Build to layerParameters:
Tile size: Width/height of one tile in pixels
Seed: Number to base the randomization on. Same number = always same result.
Randomness: 0 - very straight corridors, 100 - lots of twists
Sparseness: 0 - very tight density, 100 - very sparse density
Dead end removal: percentage of dead ends the generator does its best to remove.
Room count: max/min.
Room dimensions: max/min height/width in tiles.
Size: dungeon width/height in tiles.
Expressions available for all of the above. For mazes (and other purposes too) you can also set a starting point and a ending point.
Jamis' generator is public domain, my license is also "do what you want".
Not complete! This was just today's work. Updates to follow.