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

Questing and crafting

Two new things this week; quests and crafting.

Quests

When you enter a location containing an NPC who has something for you to do, you’re presented with a little message:

When you find the NPC, you can interact with them to see what quests they have available, and to hand in any you have completed for them in return for some rewards.

So far, the quests system can handle three different types of quests; all of which will be familiar to RPG players:

  • Kill a specified number of specific enemies
  • Acquire a specified number of items
  • Acquire a specified number of quest-specific items, which only drop while the quest is active

For the gathering items quests, those items can be from the result of performing a gathering skill, like fishing or logging, or looted from monsters. All quests can have multiple objectives. Quests can be one-off or repeatable, and can require the player to have completed previous quests before they become available, allowing me to chain them together to create a quest line.

Recipes and crafting

The second big thing of the week was adding in recipes and crafting. Characters can learn recipes from various items, which then enables them to do some crafting. At the moment that’s limited to cooking and woodworking, but there’s a few more production skills in the pipeline.

Once a character has learnt a recipe from a book or scroll, they can approach a crafting station — the campfire in the traveller’s camp to do cooking, for example — a little window pops up allowing the player to select a recipe and begin creating items.

Because BotLG has a strong gathering/crafting focus, I expect I’m going to be writing a lot of recipes in the next few weeks (and probably authoring a huge spreadsheet in an attempt to achieve some semblance of balance).

Miscellaneous other tweaks

I’ve also done a fair amount of smaller tweaks and improvements this week:

  • There’s now a little minimap that shows the surrounding area with interactable objects highlighted
  • Player characters and NPCs now have a configurable speed, so different monsters can move around at different rates; the player can also equip some boots of striding to boost their movement speed
  • Pop-up dialogue boxes now stack, so you can click an item referenced by a quest, for example, and keep your position
  • Side panels now remember if they’re open or closed between sessions
  • New reading, eating, and potion-quaffing actions; potions are automatically consumed in combat as required
  • Various CSS and JS tweaks

Changelog, 2019-05

May was a huge month for Bones of the Idle. For one thing, it got named and stopped being “that browser game project”. But it also got pixel art sprites, maps you can wander around (with A* pathfinding), crafting, and skill-based combat. It really went from being a proof-of-concept to being an actual game.

Environment

  • The player is now visible on the map and will move to a location when the map is clicked. Pathfinding is calculated entirely server-side and starting an action is now co-ordinate based and validated by the server.
  • The forests are now (potentially) infinite, with new maps generated by the server on demand. A small town consisting of pre-generated maps has been started.

Combat, monsters and NPCs

  • Monsters (and players) have a selection of stats that influence combat. Both now also have combat skills that have individual effects, strengths and weaknesses.
  • New monster: giant forest rat
  • Initial work on NPCs you can converse with.

Items and crafting

  • Crafting is now implemented with two skills: woodworking and cooking. Interacting with a crafting workbench opens up a new UI that shows all the recipes available to you, and allows you to specify how many products you want to start crafting.
  • New recipe: process oak wood
  • New recipe: wooden skewers
  • New recipe: rat on a stick

User interface

  • Player health and energy are displayed as a pair of progress bars above the map. Players now slowly recover health while performing any action other than combat, and can quickly recover both health and energy by eating food, or resting at specific locations.
  • New popup overlay windows for player stats, inventory and item details.
  • Clicking an item now pops up a small window describing it, and allows you to use certain items. Items with a use effect show a small yellow star next to their name.
  • Many, many visual updates and tweaks, including full mobile browser support.

All my to-do notes and outstanding bugs are tracked on this public trello board.