Sunday, April 2, 2023

Marching Into Crafting

March is in the history books.  I made significant progress on my crafting engine.  I will demo it on my YouTube channel shortly.  But I would like to share with you my first design concept and why I felt it ultimately failed.  Then, I will show you my second one and why I feel it is a much better design.

First Concept:  Craftwork With Integrated Inventory Window

In this initial design, I thought to allow the player to open the Inventory window and the Craftwork window so that ingredients and tools could be dragged and dropped based on the recipe requirements. In order to provide for the drag-and-drop feature, I modified the inventory window code to hide buttons and other pieces of the inventory window so that I could instantiate an inventory window within the Craftwork window.  The result looked like this.

Instantiating the Inventory window scene was easy enough and the hidden controls were only hidden when the Inventory scene was instantiated by the Craftwork scene.  What I hoped to provide was selective ingredients.  By that, I mean I wanted the player to be able to choose the specific inventory items to be used in the crafting recipe by providing drag-and-drop capability.  Once that part of the design was implemented, I starting thinking about the user experience and the coding needed to pull it all together.  The user experience was first and foremost the most important concern in the design.  So, I thought through it carefully.  The steps were as follows.

1. The player opens the Craftwork window

2. The player opens the Inventory window.

3. The player chooses the recipe from the list on the left.  Line 1 and Line 2 give details about the recipe such as ingredients and tools required.  

4. The player then drags over from Inventory the ingredients and tools into the corresponding slot sizes.  The colored bars have not yet been coded, but they will be Percentage of Success, Resulting Quality, Amount of Focus applied (more time means a better outcome), and horizontally a progress bar.  The hammer tabs will provide lists of recipes by category.  

5. The player clicks the Craft button and the crafting process begins providing the items in the slots matched the recipe selected.

It all looked really fine to me until I realized how draggy and clicky it was.  There was so much the user had to do just to craft something.  But also, behind the scenes I had to manage two sets of inventory containers, coordinate passing back to the Inventory all non-consumable tools and items along with the crafted item and clean up if the user decided to cancel the session.  It was a huge lift for the player and fairly complicated for the developer.  I wasn't satisfied with it at all.

Focusing my attention on the draginess and clickiness (are those even words?) I decided to toss out the Inventory window and replace it with an image of the crafted item.  I did away with drag-and-drop altogether.  I also eliminated the necessity of opening Inventory unless the player just wants to.  Here is the second design.

Second Concept: Independent Craftwork Window With Auto-Ingredient Tracking


The second concept is much less work for the user and the developer.  The steps are as follows:

1. The Player opens the Craftwork window.

2. The Player selects a recipe.

3. The Player clicks the Craft button.

Behind the scenes when the player selects a recipe, the code checks for the existence of the ingredients and tools in the Inventory and holds a reference to their object id's.  There are two additional buttons above the Craft button.  The Down arrow allows the player to indicate he wants to use the lowest quality ingredients and tools from Inventory.  The Up arrow will select the highest quality ingredients and tools.  While not as specific as the first design, I think I can bake in some additional features to the Inventory window to allow more precise selection, such as active tool slotting.  When the player clicks the Craft button, all ingredients are immediately removed from Inventory and the timer and associated crafting sounds are presented.  Upon success, the item displayed in the Craftwork window is deposited in Inventory.  If the player does not have the proper ingredients and tools, a message is presented in the message window.  This solution is smaller, easier on the player and much easier to maintain.  I feel it is a superior design all around.

In the month of April, I intend to focus on building out the features of the Craftwork system and provide many new recipes.  If you have any suggestions for me, please feel free to post them here.  You can also check out my YouTube channel for the latest Dev Blog videos.

Until next time...