Crafting System and Bug Fixes

Intro

While I originally thought that most of this sprint would be designing I neglected to consider that I hadn't really implemented the architecture for the full crafting system yet. The main crafting system of the game is based around the potions and a lot of my work this past sprint was programming the architecture for that system and fixing the bugs that appeared in the crafting UI. I also completely finished documenting the new Quest system and also worked on documenting the new Potion Crafting system I redesigned.

New Potion Crafting

To start I implemented a new system for how to craft potions. The old system was hard coded to give the player a specific potion when an herb was in the Cauldron. Now when the button to make a potion is pressed, the PotionManager script determines which potion should be given to the player based on the added values of the herbs. Each Herb object now has a Dictionary of the different elements and the amount that that herb has. To test this I gave the currently implemented Herb one unit of the Fire attribute and set the current potion to require 2 units of Fire to be outputted. This requires the player to add 2 herbs to the cauldron to make the potion.

Going back to the Elements that I added in the game, I went back and forth as to which elemental attributes to add as mechanics. I debated going against the common Fire, Water, Earth, Air core however I decided that it is popular for a reason. I did change water to Ice though just to have the possibility of a snowy area. I also added the Light and Shadow elements so I could include some healing/poison potions in the future. Each Herb is required to have one or more of these elements and the three devices are able to change these elemental attributes in different ways (though this will be dependent on the herb and is not implemented yet).

Potion Crafting UI Changes

With the Potion Crafting UI I made some changes primarily to the storage in the Cauldron. Before, herbs were just added to an array stored within the cauldron and any amount of herbs could be added. Now, the Cauldron only allows for up to 4 herbs to be stored at once and the player is able to click on containers in the cauldron to remove them. I also thought to add in drag functionality for the inventory and Cauldron UI however, as i was in the process of adding it I remembered that the main control scheme I'm developing for is controller which would have a terrible time with dragging so I decided to scrap the feature.

New Cauldron UI

New Cauldron UI

Bug Fixes

Most of the bugs that came up had to do with the new cauldron slots and adding quality of life features such as the ability to close both the Inventory and Crafting UI when exiting out, adding back the herbs when the Crafting UI closes, and making sure that herbs marked as a different Process Type (Distilled, Crushed, or Smoked) are sent back to the player's Inventory as the Raw form.

I debated if the player should have the other Process Types be able to be stored in their inventory however I decided that with the multiple variety of Process Types and the eventually large amount of herbs, the player's inventory would likely get too cluttered and it could become confusing for the player. Additionally if the player made a mistake and Crushed a herb instead of Distilled it, then they wouldn't have any way to get the raw form of the herb back to correct it.

Next Sprint: Work on the Herb Journal

Since one of the main goals of the player is to document the different herbs they find in the game I want to include a journal for them to store the data they find. I'd like to implement it similarly to the Pokedex in the Pokemon games where each Herb has its own entry and information about it is only obtained after the player has researched it. I think I can complete this in the next 2 weeks and if I have any extra time I might finish up the Quest Log which I still need to display to the player.