Procedurally generated dungeons

I finally got around to improving the way procedurally generated locations work. Now, locations can have a procgen tag, which causes the game to look for a default set of rules for generating the location when the player enters it. This lets me specify things like which dungeon generation algorithm to use, what tiles to use, which monsters to make present, and things like that.

Additionally, I can specify a list of overrides on a per-level basis, so I can make certain floors of a dungeon different. For example, the first few levels could be brick-and-mortar dungeons, before devolving into rock face caverns with their own colour scheme and different monsters present. Another option available to me is to specify a premade map, so I can have fixed points within a dungeon — boss chambers, alters, shops, or whatever. Within these premade locations, I can even specify which position and level within the dungeon an exit should take you to, so I can also make shortcuts around larger labyrinths. All this should let me build some more engaging dungeon locations.

Alongside this dungeon revamp, I added a couple of complimentary features: procedurally generated quests and quest-locked portals. BotLG is a little unusual in that monsters won’t attack the player; combat is only initiated by the player bumping into a monster themselves. Now, this would mean that you could carefully navigate your way to the bottom of a dungeon and never face any actual danger, which is ridiculous.

To help combat this, I implemented a flag on portals (like doors, staircases, etc., any tile that moves you to another location) that makes that portal only work if a specified quest has been completed. When you enter a dungeon floor, a quest template is picked from a list, and the conditions to complete it are adjusted based on the current difficulty level. Players can only use the stairs down to the next level once the quest is completed; if the player leaves the dungeon, the quest is abandoned.

I’m going to use this system to flesh out the Rat King’s Lair, the first procedural dungeon the player will come across, and then add in a couple more. I’m increasingly thinking I need to revamp the starting area so the player can more immediately jump into some dungeon crawling without having to find the Rat King’s Lair, which is a fair distance away from the player’s start location, and a little off the beaten track.

People, places, and things

I’ve worked on three things, mainly, this week. I started out by implementing NPCs the player can interact with. Under the hood they’re essentially just the same as monsters, only they have a dialogue system for their main action, instead of combat. But there’s no reason why in future you couldn’t fight NPCs or parley with monsters. I created a simple branching dialogue system, where you’re presented with what the NPC has to say, and then you have some pre-canned responses to choose from that can lead to further dialogue.

BONES of the LOST GOD is based on a play-by-mail Labyrinth Lord campaign I ran back in the day. At the centre of that campaign was the city of Rooksfoot, an economically-thriving but morally dubious city dominated by a magical arena where sell-swords and adventurous hopefuls would fight to the death for a cheering crowd and the promise of fame and riches. I’m both excited and nervous to be re-implementing the city in this game, and having some NPCs seemed like a good excuse to put the first hint of the city in-game:

Image
Image

Getting past that guard forms the opening segment of the game, and forces the player to go explore the surrounding area. I have two or three different ways in mind for the player to get into the city for the first time, and once they’re in, coming and going as they please will become much easier.

The next thing I worked on was items. I made the view item screen much more detailed and attractive, and made a bunch of new items to support initial character creation, so new characters now receive a set of starting gear better tailored to their rolled attributes. Here’s an example item:

It’s listed as a two-handed weapon, with a strength attribute, so performing basic melee attacks with it will use your strength attribute. Most weapons are strength based, but lighter, more finesse based weapons will use dexterity, instead.

But the main thing to note here is how wielding the item — a staff in this case — actually grants the character access to two actions: fireball and basic attack. For the first time, player characters can now perform different actions in combat, instead of just wailing away with basic melee attacks round-after-round. I’ve been wanting to implement this for weeks, and finally it’s here.

BotLG is a classless game, but characters have attributes and items available to them that are very much in the mould of the traditional fantasy RPG. How your character behaves in combat (and elsewhere) is very much decided by the items they choose to equip themselves with. You can load yourself up with heavy armour, sword and shield and play a strong warrior type, or wield a poisoned dagger and light armour and be the assassin-rogue. This also allows for some neat customisation. If you want to be something a little more unique — a necromancer-bard, perhaps — that’s fine! Get yourself some evil robes covered in death-magic runes, and equip the biggest, baddest trumpet you can find.

Note: neither evil necromancer robes nor trumpets of any size have been implemented (yet). But they could be! And you’d get different spells and actions from each, and they might even synergise a little, and you’d be the happiest necro-bard for miles around.

Image

My next steps are to spruce up monsters, so there’s a bit of variety as you’re exploring dungeon-like locations. Monsters work mechanically the same as player characters, so they also benefit from equipment granting actions to use in combat, but so far none of them are wielding anything that provides anything other than a basic attack.

In tandem with improved monsters, I want to add some quests into the game, so there’s a bit of structure to the slaughter. I already have code written that tracks when you need to collect items for a quest, how many you have, and if a monster should have a chance to drop a quest item. All that’s missing is some UI to allow players to start and complete quests, which I can now tie into the NPC dialogue system.

But is it a roguelike?

It’s been an interesting week for thinking about the word roguelike. On Tuesday, I was finally forced to admit that the game I am making is, in fact, a roguelike:

I’ve been working on procedurally generated maps this week, you see. And with that final piece of the puzzle slotted into place, I finally felt like I had enough elements to realistically consider BotLG to be a roguelike game. Not a traditional roguelike, perhaps, but a roguelike nonetheless.

It’s since turned out to be the perfect week to have these thoughts, as yesterday @humbit set r/roguelike on fire by publishing the excellent blog post, The “Roguelike” War Is Over. I’m firmly in the camp that @humbit argues for; language changes whether you like it or not, and roguelike doesn’t mean the same thing today as it did Back In The Day, and that’s okay. What’s important is that everyone knows what you mean when you say it — yes, even you, grumpy grognard, even if you don’t like it — and it’s easy enough to just say traditional roguelike if you really, really, want a pure turn-and-text based experience. No-one has to lose out here.

The obvious problem with discussions about roguelike vs roguelite is that they’re UTTERLY BORING. There’s nothing new to say but we’ve been treading the same ground for literally years. It’s beyond beating a dead horse. It’s beating a zombie horse. Can we just… stop?

The “Roguelike” War Is Over

So is BONES of the LOST GOD really a roguelike — by anyone’s standards? I think so. Let’s take a look through the Berlin Interpretation guidelines as a flawed but decent-enough starting point:

High-value factors

  • Random environment generation: Yes! Dungeons and wilderness are now procedurally generated. There are some fixed-point locations that are consistent, however.
  • Permadeath: Yes! Characters die, and when they’re gone, they’re gone, along with all their stuff. There is an account-wide storage system, so you can “bank” some items between characters, which softens the blow a little.
  • Turn-based: Sort of! Combat is turn based. Movement is not, but combat and movement are modal, which we’ll get onto in a moment.
  • Grid-based: Yes! All the map locations are grid-based. Players and monsters of all sizes take up one tile.
  • Non-modal: No! Probably the biggest rule breaker here, but movement and combat occur separately from each other, and what actions are available to you very much depends on what you’re currently doing.
  • Complexity / Resource Management: Eventually! So, there’s not a lot of complexity in the game yet, but several systems are in place that will result in complexity as more items, monsters and effects are added. So watch this space on this one.
  • Hack’n’slash: Yes! Killing lots of monsters is important in roguelikes, and there’s plenty of monsters to kill in BotLG.
  • Exploration and discovery: Yes! I spent enough time on making field-of-view and fog-of-war work nicely alongside a mix of hand-made and procedurally generated maps, and all the best stuff will be tucked away in dungeons and the wilderness, so I hope exploration will be a strong component of gameplay.

Low value factors

  • Single player character: Yes! I originally envisaged BotLG as a party-based RPG, but after some play testing, I’ve fallen back to a single character to speed things up, and I think it was the right decision.
  • Monsters are similar to players: Yes! They share the same attributes, skills and equipment as players, and use the same rules for movement and combat.
  • Tactical challenge: Not so much! BotLG is slightly more about the strategic long-game of refining equipment and skills over the course of multiple characters, and combat is abstracted thus that there are not many tactical decisions to make.
  • ASCII display: Nope! The game world is represented with graphical tiles, and I think it looks great.
  • Dungeons: Yes! Not just the traditional rooms and corridors, but also cave systems, overgrown forests, mountain passes, boggy swampland, etc. etc.
  • Numbers displayed up-front: Yes! There’s no secrets here. You can see all your attributes, item properties and damage numbers.

So is it a roguelike?

I think it is! A weird one, maybe, but definitely in the ballpark! More importantly, I’ve started to think of it as one, and it’s partially how I would describe it. It still has all of its initial idle/incremental features, so I’m thinking of it as an idle/incremental RPG with a roguelike world. That seems to cover all of the bases. It’s not a traditional roguelike by any stretch, but it certainly ticks enough of the boxes.

It does have some distinctly unroguelike elements. As you and the monsters/NPCs are wandering around the map, there’s no taking turns; everyone moves at the same time, so there’s no tactical tile-hopping and waiting. But that doesn’t matter, because combat is initiated only by the player deliberately “bumping” a monster, and combat is modal, so there aren’t any positional considerations. Because a big part of the game is idle/incremental gathering and crafting, I ruled that is was not important that monsters could attack you when they wanted to. It’s entirely possible to play out a character to the level cap as a pacifist gatherer/crafter, though you’d be missing out on a decent chunk of content– crafting some items requires components only obtainable through looting monsters. What’s important is that you could play the game this way, and when you eventually retire that pacifist crafter, you’ll get account-wide bonuses reflecting the life they lived.

Numbers getting bigger

Here’s a fascinating article on the math behind incremental games; Numbers Getting Bigger: The Design and Math of Incremental Games, by Alexander King.

Each line represents a different building, with cost on the y-axis and income rate on the x-axis (both logarithmic scales)

You know what it all boils down to? It’s this handy formula:

Price = Base Cost × Multiplier(#Owned)

It works particularly well, psychologically, if the multiplier is set between 1.07 and 1.15. Less than that and you progress too quickly to enjoy each new upgrade, and much larger than that and the game bogs down and feels like a tedious grind. Somewhere between 1.07 and 1.15 is the sweet spot, used by many, many idle/incremental games.

And me, too.

What makes “Clicker Games” good?

Here’s a nice little YouTube video from RealityEscape on what makes a clicker game good:

Just in case the name didn’t give it away, Bones of the Idle has a strong idle/clicker component. When you’re gathering materials

There’s a few points raised that I want to briefly talk about in the context of Bones‘ design:

Ascension

I kind of have a system in mind for “ascension”, whereby players will be able to retire characters in exchange for a regular offline income. You get to start over with a new character, and every day you’ll receive some income and items based on all your retired character’s skills. Potentially these retirees will appear in the game as NPCs.

Autoclickers and scripting

I don’t care, in general. The client is written in Javascript and executed in the browser, so there’s only so much I can do to stop people using the developer console to script things. All the important stuff is server-side and validated there, but there’ll still be little shortcuts dedicated students of Javascript could uncover. I just have to minimise what scripters can get away with, and try not to sweat the small stuff.

Monetisation

Bones of the Idle is free to play, and there’s no adverts. It’s also not going to be nagging you to spend money. However, my time has value, and I’m not adverse to money. I set up a Ko-fi page here, where people can chip in with donations if they feel the game is worth it.

If I ever add anything resembling micro transactions — in general I have no issues with them, when done well — I’d have them be ethical, not lootboxes, and definitely not pay-to-win.