• Weekly Update – February 16, 2024

    When I wrote the 2023 retrospective at the beginning of this year, I calculated that the time I spent on this project dropped 10% from the prior year. Since then, I’ve made a deliberate effort to make more time. I’ve started getting more done when I get home from work. I didn’t think that was possible because my brain is usually fried after work. What I’m finding is that the crux of the issue is that it’s harder to engage right when I get home. If I push through that and start on some task, as long as the task is not extremely complicated, I can make progress. The extra time was put to good use this week.

    • Object/Item interaction demo.
    • New content
      • Status Effects: Slow, Haste. These halve and double the number of actions per turn, respectively.
      • Items: Slow Potion, Haste Potion, Slow Arrow.
      • Interactions: Campfire + Water, Campfire Ring + Lit Torch.
    • Multiple actions per turn. I implemented this capability a couple of years ago but disabled it because it was buggy and not a priority at the time. I re-implemented it this week from scratch (the old code was gone or didn’t work the way I wanted it to). I needed this to support actors that move faster or slower than the player and Slow and Haste status effects. 
    • Duplicate event listener checking. I’ve recently come across a few instances where object destruction methods added an event listener instead of removed it due to copy/paste errors. I’ve also encountered situations where an existing object was reinitialized without removing its original listeners. In both cases, objects ended up with multiple listeners for the same event type, resulting in strange behavior and game-breaking bugs. These tend to be non-obvious, time-consuming issues to troubleshoot. To catch duplicate listeners before they cause downstream issues, the custom event-handling class now checks for attempts to add the same listener twice.
    • Tooltips for empty equipment and combine slots.
    • Bug fixes
      • Performing an interaction at the same time that a nearby Stalagmite Monster reveals itself displays the Stalagmite Monster in the Inspect Panel. This was certainly unexpected! I found the cause  quickly because I’ve come across it several times recently – a listener for a broadcasted event was responding to cases it should have ignored. In this instance, the Inspect Panel was responding to an Actor Type Changed event generated by an actor other than the one being inspected.
      • Starting items added to converted objects. For example, if a Poison Fountain is converted into a Water Fountain, gold coins may appear in the Water Fountain’s inventory because this object has a chance of containing gold.
      • Interaction particle effects and animations sometimes appear on incorrect items.
      • Interaction visual effects are being applied to Quick Switch slots.
      • Sometimes interaction visual effects are applied to empty slots.
      • Apples aren’t destroyed after being eaten.
      • Error when drinking from a Healing Fountain.
      • Error converting a Dry Fountain to Healing Fountain.
      • Drinking a potion doesn’t leave behind an Empty Vial.
      • The Inspect Panel registers event listeners twice.
      • Interaction visual effects not appearing when scooping liquid from a fountain into an Empty Vial.
      • Cursor displays Combine action when hovering over a Dry Fountain. 

    Next week, my focus is on adding content and completing an old, partially-implemented item degradation mechanic.

  • Weekly Update – February 9, 2024

    Inventory event handling was overhauled this week. That wasn’t the plan, but it was necessary to get visual effects for items created by interactions fully functional. The UI code was a pain to work with because the extensive use of events made it difficult to follow. And, the event logic was a mess. Some events were redundant, some events didn’t have any listeners, some events weren’t being raised in all of the places they needed to be, and some events were being raised in too many places. To get a handle on the UI event logic, I made a list of every event, its intended purpose, every class and method that raised it, every listener, and what the listener did. With this information I was able to understand what the UI was doing and where events and listeners needed to be added and removed. Visual effects for item interactions now work correctly and the UI event logic is more straightforward.

    Next week, I’m focusing on actor movement. I’ll fix a few movement-related bugs and make the number of times an actor can move in a turn configurable. The latter will be used to have enemies that move slower or faster than the player and haste/slow effects.

  • Weekly Update – February 2, 2024

    This week I refined object interaction, added new interactions, made a few UI improvements, and fixed several bugs. I planned on posting a demo of object/item interaction but there are still some issues with the visual effects.

    • New content
      • Objects: Cure Poison Fountain
      • Interactions: Mix Poison and Cure Poison Potions, Mix Water and Mushroom Pieces, Water and Brazier, Water and Fire, Torch and Unlit Brazier, Poison and Brazier, Puddle and Empty Vial
      • Items: Lantern, Fear Potion
    • Object interaction refinements
      • Items with a quantity > 1 are now handled correctly
      • Inventory panel immediately inventory reflects changes
      • Items can’t be combined with themselves (yes, this was previously, and unintentionally, possible)
      • More descriptive text shown after completing an interaction 
      • Hotbar correctly updated after an interaction.
      • (Crude) visual effects for items and objects affected by an interaction.
    • Inventory and Inspect Panels are no longer modal. These panels can now be opened and closed separately. It was previously possible to display both of them at the same time, but this functionality was implemented through a workaround and had limitations.
    • Item quantity displayed in Inspect Panel. The item quantity should always have appeared. It became essential when item interactions were added because interactions typically change the item quantity.
    • Quick Switch Slot background images lightened to better distinguish from the selected item in the slot.
    • Bug fixes
      • Actors appear under walls when moving
      • Performing more than one interaction in the same Inspect Panel instance causes error.causes error.
      • When clicking the Throw button from the Inspect Panel, the panel doesn’t close.

    Next week’s todo list includes bug fixes, new room types, and new object interactions.

  • Weekly Update – January 26, 2024

    Before starting on Legend, I was working on a game called World (I like generic titles). World was a massive project that eventually collapsed under its own weight. It became highly complex and unwieldy, a consequence of too many ambitious but ambiguous ideas and the absence of a framework to tie it altogether.

    One of my biggest struggles with World was object interactivity. I wanted to build an extensible, data-driven system in which the outcomes of interactions between objects were based not on explicitly defined object combinations but on the underlying properties of the objects (e.g. state of matter, flammability, hardness), and the manner in which an object was being used in relation to another object (e.g. chopping, piercing, shoveling). This system would support infinite object interactions, significantly expand emergent gameplay possibilities, and make it easier to add new object types. Much like the history generator added to Legend last year, it was very challenging to conceptualize the bridge between the vision and the implementation.

    Although a high degree of object interaction has always been a major design goal for Legend, I’ve been leery of it after my experience with World. But, as I thought through how I was going to implement a sample list of interactions I wanted to enable, I found myself drawing from the design work I did on World. To avoid the mistakes I made the first time around, I deliberately gave up flexibility in favor of simplicity and ease of development. The benefit I have now, vs when I was working on World, is that there are more knowns. I’ve been working on Legend for over four years now; many design decisions have been made and the systems are in place and proven. I don’t have to try to solve a problem with an overwhelming number of unknowns. 

    This week I implemented object/item interaction. Any object or item in the game can now be paired with another object or item to produce an outcome, provided that the item/object combination and the outcome have been defined. Example interactions I’ve implemented include:

    • Dipping an arrow into a poison potion to make a poison arrow
    • Making a healing potion by filling an empty vial with the liquid from a healing fountain
    • Poisoning a fountain by pouring a poison potion into it
    • Purifying a poison fountain by pouring a cure poison potion into it
    • Collecting water from a puddle with an empty vial

    There are a number of minor issues that still need to be addressed, for example the UI sometimes doesn’t properly update, and item quantities aren’t handled correctly. Next week I’ll fix these and post a demonstration of how the object/item interaction works.

  • Weekly Update – January 19, 2024

    I implemented more core gameplay improvements and fixes this week. Real life got in the way a bit, shrinking available time to 5 hours from 14 hours the prior week. Fortunately, watching others play the game is helping me isolate the things that matter most. 

    • Level rumors more prominently displayed. Rumors were previously displayed in the message log, which I never pay attention to. Now, when the player starts a new level, a popup containing the rumor appears. The player has to click the Ok button to close the popup and start playing. This may get annoying over time. We’ll see…
    Rumor prompt
    • Drinking a potion preserves the vial. It’s illogical to completely remove a potion after drinking it because the vial isn’t consumed (although that just gave an idea to create a playable race that consumes glass). Since empty vials have uses such as making new potions and carrying liquids, they should be preserved.
    • More available actions when inspecting an entity. Some actions such as Attack and Drink weren’t yet supported when inspecting an actor, item, or object. Buttons for these actions now appear in the Inspect Panel when applicable.
    • Pressing Escape displays the main game menu. This is a convention in PC games.
    • New arrow types: Poisonous Gas, Fear, Charm. These were easy to add because the effects were already implemented for potions.
    • Bug fixes
      • Unable to take items from a diagonally adjacent container.
      • Icons not centered at the bottom of the screen.
      • Hotbar and on-screen buttons responsive when modal panels are displayed.
      • Mushroom Gardens can be placed in corridors.
      • Empty vial issues: they appear in the hotbar by default even though they don’t have a default use, clicking on them generates an exception.
      • Magic Leather Boots cause an exception when placed on the map.
      • Stairs appear above corpses.

    Next week, the focus is on adding more ways for items and objects to interact with each other.