cartoon pic of site's author
Blog  |  D&D Stuff  |  About  |  Other Places  |  rss logo

Dev Diary 4

Before we get to the dev diary, cast your gaze off to the right! (Unless you're on mobile...) My friend Catarina has knocked it out of the park once again, this time with a logo for my Yarl-related posts. I have this expression much of the time I spend working on code. Other top coding expressions: utter bafflement, occasional anger, and occasionally despair.

No but coding is really very fun!

What's new in Yarl?

We continue our quest toward the semi-mythical Minimum Viable Dungeon. For me, writing this game feels a bit like exploring a dungeon. I'm venturing into unknown territory obscured by darkness and wandering down many twists and turns, occasionally finding a dead-end and having to backtrack.

Some roguelikes have chasms where you can fall or jump deeper into the dungeon, which is something I wanted in my game. While, Brogue for instance simply shows dark squares for the chasm, I had the idea that the player would be able to faintly see the level below, so I tried to implement that. In this image, the dark/faint squares to the left and right of the character are actually the next level down. So, once I code in the ability to fall between levels, you'll be able to see what's below should you jump, fall, or get pushed of the edge of a precipice.

The character crossing a chasm The player is on a wooden bridge spanning a chasm

I haven't finalized the look, yet. I think one some monitors the squares of the level below might be too faint. But I wanted it to be visually obvious that those tiles weren't on your currently level. I might also make the squares that form the edge of the chasm distinct from other floor tiles. Things to think about when I'm polishing the game later on.

Ooo VFX!

I had an idea for an animation to add to the game, a visual indication of when someone is hit in melee:

Animation showing his during fights The player and a kobold trading blows

I think the effect works pretty well since players will probably be paying more attention to the characters on the screen instead of the messages in the message area or their HP in the sidebar.

Leveling Up

I also began to work on what happens when characters level up. For now I just have the two character classes. Every second level their attack bonus goes up and on the odd levels they get a special feature. Right now, Orcish Reavers receive a random boon from among: a strength increase, a constitution increase, bonus HP, a damage bonus, Cleave, or Impale. Impale means if you hit a monster you may also hit a monster behind them. Cleave means you might hit monsters to the left or right of your opponent. I have to think about the implications of those abilities because I haven't handled the case there a friendly NPC might be in one of the target squares. Likewise, you can Impale or Cleave with any weapon and it doesn't really make sense to, say, Impale with a club. I'm not sure if that really matters, but on the other hand it might offer the player interesting choices about what weapon to wield.

Dwarf Stalwarts can get: Strength, Constitution, or Piety (think, Wisdom in D&D) boosts, Impale, or an ability called Shield of the Faithful (which is essentially just an armour class bonus). Stalwarts can eventually learn some prayer/spell type abilities but I haven't yet made any concrete decisions about how spellcasting will work in the game. Piety will be a Stalwarts spellcasting ability though.

Shopping

A big step toward MVD was beginning to add NPCs to the town and shopping. First, I gave NPCs barks that they can say while the player is walking around the town. This was a fun addition, and really makes me happy I decided to go with a non-breaking game loop. Here's the town priest:

A priest in the town calling out devotions Huntokar is a placeholder deity. I'll actually generate the gods for my game

Implementing shopping was a fair bit of work and when I first wrote the code for that pop-up window for other stuff, I didn't occur to me that I'd want to highlight things in colour. Hoo-boy, that turned a rabbit hole of hacking around in my code. But here's what the shopping screen looks like:

Shopping menu in the game

The character has chosen a helmet and 1 dagger, but doesn't have the funds for both :(

Topology? Geography?

Lastly, to add some interest and variety to the dungeon levels, I worked on draw rivers across a level and then adding in bridges so that all areas of the dungeon are still reachable on foot.

Dungoen map with a river and bridges

The river drawing code was a bit finicky, but adding the bridges was pretty easy! It's nice when you can just repurpose code you've already written. In this case, to connect areas divided by the river, I pick a point in each of two disjoint regions and use my pathfinding code to find a path between them. I then follow the path and when I encounter a water square, I replace it with a bridge.

The same river drawing code can be used to draw chasms and lava flows simply by switching the character I draw for the 'river'.

Oh, and those are wooden bridges! Eventually I'll implement the possibility of bridges being destroyed by fire or such. I need to decide what happens if you fall in the water. (If the bridge is over a chasm, you'll fall to the level below) Falling into lava will probably be very bad...

So that's what I've worked on over the past week or so!

The next things I'll work on are implmeenting randomized gods for the town's priest and more dungeon decoration features. If I get a decent way through that, the next thing will be developing a boss monster who'll be waiting for the player on level 5 of the dungeon.

Dana's Delve is open source under the Creative Commons CC0 1.0 Universal license and its source code is available on GitHub.