I Made a Game for 7DRL: Dungeon Scoundrel

Back in March I did the Seven Day Roguelike game jam and ended up with a completed game: Dungeon Scoundrel. That's amazing to me; I entered with the intention of just making a little tech demo for the bigger roguelike I'm planning, Dog Rogue. Here are some thoughts about the design of Dungeon Scoundrel.

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:

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.

Unknown Items

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.

Continue reading...

How I Found a Bug in Twitter by Debugging Chromium

Sometimes I browse Twitter at work, okay? Code needs time to compile.

twitter-bug-cropped.gif

Occasionally I noticed I was randomly getting taken back a page if I clicked out of viewing an individual tweet. This was really irritating because I like to read all the tweets posted overnight, so the bug would force me to scroll through many hours of tweets to find my place again.

There's only so many times you can think "I must have right-clicked and pressed 'back' on the context menu" before you decide to investigate. After a bit of poking I figured out how to reproduce it: if you click on a tweet to bring up the details lightbox (where the background is grayed-out) and double-click outside to try to return to the timeline then boom, the bug will trigger.

It seemed like a problem with Twitter. But it was also kind of bizarre; how does clicking on a UI element take me back a page? Could it be a bug in Chrome? Plus the bug didn't reproduce in Edge or Firefox, which furthered my suspicion. It shouldn't be hard to confirm one way or the other, I thought. I have a debug build of Chromium right here! I'll just slap some breakpoints around and see what happens.

Continue reading...

Why I Play Dungeon Crawl Stone Soup Every Day Even Though I Hate It

Dungeon Crawl sucks and I hate it.

Pop quiz, what's better a +4 Mace of Crushing or a +2 Flail of Electrocution? I certainly don't know. I can fall back on received wisdom: generally flails are better because they do more damage by sacrificing some accuracy. Flails and electrocution are rarer than maces or crushing, respectively, so on that metric the developers agree with me that you should pick the flail.

But if you want cold hard math to prove the choice... Let's see, the wiki says Electrocution has a 33% chance of doing 7+1d13 damage, which is an EV of ~5 damage, plus the flail's base damage of 10 gives ~15. A mace has a base damage of 8 and crushing gives it an average of 16.6% extra damage, which is ~9. But just comparing those numbers doesn't take into account the mace's increased accuracy or greater enchantment bonus, both of which are rabbit holes in and of themselves.

Continue reading...

How I Made This Website

Welcome to this website that I made! I think it's very dot org. Perhaps it's even very very very dot org. We might never know.

I made this website because I keep writing things and I never know where to post them. A lot of people seem to use Medium for this purpose but it sucks to hand your work to someone else so they can make money off it. Plus they just fired a bunch of people last year and I would rather not build a house on quicksand.

I'm a programmer, I can make my own blog. So here it is! It took me about 4 hours to write the code, another 4 hours to do all the visual design, 2 hours to draw the fairy, and 2 hours to write this post and the about page. Not bad for a couple workdays, if I do say so myself.

If you want all the juicy technical details about how this site is put together, read on.

Continue reading...