Guide a dirty rotten, good-for-nothing scoundrel in their hunt for the devil through the scandalous dungeon.
The Level Generator
The level generator in Dungeon Scoundrel is very simple but it does a reasonable job of making interesting spaces. When it makes a level it does the following:
- Do a drunkard’s walk with a 60% chance of moving forward — unless doing so would move off the edge of the level, in which case it always turns. Anywhere the “drunkard” walks is open space.
- After the drunkard’s walk is finished there’s usually one or two hallways that abruptly end, where the walk terminated or turned 180 degrees. We can easily find these by looking for open tiles with exactly one adjacent open tile. To make this look more natural, it places a door there and grows a room with no other connections.
- Fix any tiles with a diagonal exit by filling them in. Since the game has 4-directional movement, such an exit might be confusing. This doesn’t work perfectly — every so often I see a problem this should have fixed — but I haven’t gone back and investigated it.
- Randomly draw from the open spaces to get the player’s starting location, the stairs, monster spawn locations, and treasure chests. Originally I wanted to ensure every area in the level had at least 1 treasure and monster in it but I didn’t have enough time to do that, so it’s just random.
- If the either set of stairs isn’t reachable from the player’s starting location we reject the level and start over. This can happen when step 3 places a wall that cuts the level into two parts.
A lot of roguelikes deliberately obscure what each item does. For example, an “effervescent potion” could do one of many things, and you won’t know what it is until you try it. Maybe it heals you, maybe it makes you turn invisible, or maybe it explodes. And which potion is which changes from game to game, so you can’t look up what effervescent potions do in advance.
In principle this sounds like an exciting mystery, but in practice it’s often tedious. Every time you start a new game you have to go through the hassle of trying a bunch of stuff in a safe area just to gain a little information. Otherwise you’re essentially gambling that the potion will be the one you want when you drink it.
In Dungeon Scoundrel I still wanted to let the player have a little of this fun. My solution was to keep everything the same from game to game. So an effervescent potion’s effect never changes. A beginning player can try to solve the exciting mystery, and an expert player can just cut to the chase.
Stairs in roguelikes operate in one of three ways. Classic roguelikes (like Nethack) have stairs that connect every level, so you are free to backtrack as much as you want. In fact, backtracking all the way to the start of the dungeon, having acquired the game’s macguffin, is usually required to beat the game. Newer roguelikes (Crypt of the Necrodancer or Spelunky, for example) often omit stairs backwards completely, making backtracking impossible.
There are a few older roguelikes (like Angband) that instead allow the player to backtrack, but don’t save the specific geometry of each level. Thus every time the player visits a floor, even if they have visited it before, it is completely new. I took this idea for Dungeon Scoundrel for two reasons:
- It’s really easy to implement.
- It gives the player infinite resources, ensuring that no game is unwinnable.
Normally this idea has an unfortunate side-effect: the player can repeatedly enter and exit until they get a lucky level (sometimes called “stairscumming”). To solve this I just moved the player’s starting location away from the stairs, so they have to navigate at least part of each level. Of course I also allow the player to quickly jump between levels for a fee…
But now they aren’t really “stairs” are they? If I walk down a staircase I normally expect to be able to turn around and walk back up it. So I changed them to be magic portals. Making things magic is always a good solution.
You must log in to post a comment