SSS #12 - Linking up Lenna and Metazelda
I’ve finally linked Metazelda and Lenna’s Inception together to procedurally generate dungeon layouts.
Update to Metazelda
Metazelda, the library I wrote to procedurally generate lock-and-key puzzles (which I’ve described before), needed tweaking to make it produce consistent and interesting dungeons. I did this by subclassing the DungeonGenerator class and overriding the probabilistic, decision-making methods. The viewer will use the new generator if it is passed -lenna as a command-line option. There are a few differences:
It more consistently produces dungeons of 15-25 rooms through a combination of tweaked probabilities and reattempting generation if the number of rooms is outside that range.
It produces dungeons containing exactly 4 key items.
There’s an extra room before the goal - the boss room.
It will reattempt generation if it has produced a dungeon containing too many corridor-like rooms.
I’ve also added “intensity” as a property to rooms in Metazelda. This affects the default generator too. Intensity is used in Lenna’s Inception to determine what difficulty the room should have, and affects the mobs that appear in the room. It’s displayed on the Metazelda viewer as colors and numbers (blue or 0.0 - easy, red or 1.0 - hard).
The work I did on Lenna’s Inception this week was to place rooms, link doorways, and produce mixes of mobs in each room based on the room’s intensity. This can all be viewed in the screenshots below and the video above.
The rooms all look quite sparse and boring at the moment, but that’s only because I haven’t yet coded anything for decorations, item placement, etc.
blog comments powered by Disqus