Merchants, items and inventory

Two major things and a whole bunch of polish this week. I wrote earlier about improving procedural dungeon generation, so I won’t rehash that; the other big feature this week was getting merchants and shops into the game.

I now have the ability to add buying and selling as actions when interacting with an NPC. Each NPC merchant will (currently) buy any item, and has a list of items that they will sell to players. Heavily inspired by old console RPGs like Final Fantasy and Pokémon , there’s also a shop location. I can alter this on a case-by-case basis, to customise the merchant themselves, the products they have on display, and the crafting workstation on the left.

I think I’ve got all the bugs, exploits and edge-cases worked out (like adding an item to your sell list, then consuming it in another window, then completing the sale of the now non-existent item, for example), but it’ll be interesting to see what players come up with. Buying and selling are kind of an important, potentially economy-breaking feature if there’s any horrific item and/or currency duplicating bugs left in there, so I’ll be keeping an eye on it for a while.

Because I’d spent so much time working with merchants and therefore items, I also made some improvements there. Can you believe BotLG contains 57 different items already (and I feel like I haven’t really even started on generating item content yet)? First, I consolidated the item types into a much smaller set — With that done, I added a dedicated inventory screen, which can be filtered by these new categories. Then, as a last bit of polish, I made it so that wherever an item is displayed, it shows an icon next to the text label. I’m really happy with how it looks, and now the console looks a bit more exciting while you’re gathering resources:

So this leaves me with just two major mechanics to implement: account-wide storage and account-wide progression through character retirement, which I’m hoping to get done next week. After that it’s just bug fixes, content and polish. I really want to completely revamp the starting area, so that players can get into a dungeon much quicker — and a more exciting one than the pretty trope-heavy Rat King’s Nest. This week (and last) have introduced a lot of new stuff, and the current maps don’t really show them off to the game’s best advantage; I actually think I’m going to hold back on making these things live until I have some shiny new locations in place.

This week’s changelog

Here are the edited highlights from this week’s changelog. You can view the whole list here.

  • As usual, BotLG is a little less idle and a little more roguelike. Every type of gathering node is now a limited resource. To compensate for limited resources, lowered global action duration to 3 seconds (from 8 seconds)
  • New skills: gathering, hedge magic, mining
  • New items: plum-nose mushroom, gorgeous plum-nose mushroom, myconic essence, myconic potions, part I, rough stone, copper ore, iron ore, silver ore, lump of coal
  • New recipes: distill (gorgeous) plum-nose mushroom into myconic essence; brew small healing potion from myconic essence
  • NPCs can now buy and sell items
  • Looking at a skill’s details (click the name of a skill from the skills panel) now shows which recipes you both know and have yet to learn. Learning a recipe now grants the corresponding skill at level 1 if you do not already have it.
  • The inventory panel now only lists the most recent items received, but contains a link to browse your entire inventory, which is filterable. Players can click an empty equipment slot to open their inventory filtered for items suitable to equip there
  • Each floor of a procedurally generated dungeon now requires a randomised quest to be completed before you can descend to the next floor. Closing the page or refreshing while in a dungeon will cause you to lose some of your inventory
  • Location name and difficulty is now displayed as the minimap window title
  • Consolidated item types down to: accessory, armour, bones, component, drink, food, ingredient, junk, potion, quest, recipe, weapon
  • Wherever an item name is displayed, its icon is also shown
  • Monsters now slow down when the player is chasing them, and will pause if they end up adjacent to a stationary player

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.

Character and Item generation

I’ve been working on BONES of the LOST GOD’s Character and Item generation this week. First of all, here’s an example character, wearing a few items:

The stats rolled might look a little off if you’re used to Dungeons & Dragons‘ traditional 3-18 range. Instead, each ability score falls in the range 11-16, with lower numbers being much more prevalent. Ability bonuses scale much more linearly as well, with no dead spots, so getting an extra +1, even at the low end, should feel like a genuine improvement. It’s going to be a brutal game, but you’ll have a whole party of hapless heroes to use, and an infinite stream of fresh recruits, so the odds are still in your favour.

I’ve also got some encumbrance and quality ratings in there. Each item generated is unique (albeit built from templates), so I can track the durability of each item separately. Because your items can break, and you can’t carry an infinite amount of stuff, there’s some tactical decisions to be made before setting off into the wilderness. It also opens the door for having perishable items, field repair kits, and all sorts of other little mechanics.

You can have a play with the generator herelet me know if you manage to roll up someone cool! Both player characters and NPCs are going to be drawn from the same pool, so each time I need a NPC, or to populate a roster of potential new recruits, they’ll be coming from the characters created by this generator.

Next up I’ll be fleshing out the items a little more, and then having the game automatically generate a new party of characters for newly-registered players.