Devlog 2: Jazmine Chargualaf: Weapons, Tools, and Crafting System


Another week of developing Echoes of Creation has concluded! This sprint, I focused on implementing and polishing key features for our survival game. Here's a breakdown of what I accomplished:

Weapons and Tools Are Here! ⚔️🛠️

When designing our game’s inventory system, I realized we needed a modular way to manage and expand our list of weapons and tools. Manually coding each item would be tedious and prone to errors. We also needed a system that could handle item attributes like durability and stamina cost efficiently.

In order to achieve this modularity, I created another data table to store all the information about weapon and tools. This table uses a custom FWeaponTools struct, which includes the attributes: name, icon, description, damage, speed, durability, and stamina cost. Now, adding new items is as simple as populating a new row in the data table. Using this structure I was able to create all the currently planned weapon and tool objects.

FWeaponTools struct script:

DT_WeaponTools Data Table. This table will be populated with all weapon and tools in the game as well as their unique attributes!

In addition to adding these weapon and tools, these items are now interactable! Players can pick them up in the world, and they will seamlessly integrate into the backend inventory system. This modular approach saves time and effort while ensuring scalability as we expand the item pool.

Sneak peek of weapon and tools:

Demo video showcasing Weapon and Tools integrating with the player's inventory:

Crafting System: Early Prototype 🛠️

One of the most exciting additions this week is the crafting mechanic! Crafting is a key feature for our game so this was a system that needed to be created early to give us plenty of time to expand on it throughout these next few weeks of development. One of the challenges was ensuring scalability and modularity. I needed a solution that allowed us to easily add or update crafting recipes without rewriting code or duplicating logic. 

The first thing I did was create a Crafting Component script, derived from an Actor Component, so it can be attached to any actor, such as the player or a crafting table. This component uses the data from another data table I created called DT_CraftingRecipes, which is defined by a custom FCraftingRecipe struct. I really enjoy these data tables because it's very simple to add new recipes without modifying any code!

Crafting Actor Component script:

The Crafting Component attached to the player:

FCraftingRecipe struct script:

DT_Crafting Recipes Data Table:
A sneak peek of currently planned craftable items!

After the initial crafting system was created it was time to implement the actual crafting mechanic! The crafting system needed to interact seamlessly with the player's inventory to ensure accurate removal of materials and addition of crafted items. The system also needs to show players all the recipes that available to craft in real time. (Well... they don't "show" just yet as we wait for our custom crafting UI screen, but the system is there!)

In order to craft something you want to make sure you have all the required items and if you do you'll "trade" them for the crafted item. I created a CraftItem function with two inputs: the recipe and a reference to the player's inventory. CraftItem calls another function called CanCraftRecipe which takes in the same two inputs - the recipe and a reference to the player's inventory - and returns true if the player has all the required items to successfully craft the item available in their inventory. If the player can craft the item, the function will remove all the required items and add the new crafted item into the player's inventory! 

I also added two functions GetAllRecipes and GetCraftableRecipes,  the latter dynamically checks all recipes against the player's inventory and returns those that can be crafted, setting the foundation for a dynamic crafting UI.

This system wasn't as difficult as I thought and the following image is an example of how to use all the functions together for debugging purposes.

An example of how I used the Crafting System functions. 
In this debug function, the player can craft a Crafting Table using 4 Wood, with the materials being removed and the crafted item added upon success!

Demo video showcasing the debug Crafting System:

Background Music 🎵

To make the game world feel alive, I’ve added a temporary looping background track. This is just a placeholder for now, but even this small change makes a big difference in immersing players in the game’s atmosphere. In the future, I’ll replace this with a soundtrack to match the game’s tone! You may have heard a snippet of the music in the videos above but I will also share the link here

Next Steps

This upcoming sprint is a big one, here's what I plan to focus on:

  • Expand the available crafting materials and game items: By adding new game objects that can be collected. This requires new meshes!
  • Day/Night time cycle conversion: Since I wasn't able to get to it last sprint.
  • Polish Weapon and Tool interactions: Ensure weapons and tools perform their proper functions, including refining their colliders and interactions with the environment.
  • Player Interaction Updates: Implement functionality for the player to hold and interact with items dynamically.
  • Audio Enhancements: Integrate new sound effects and background tracks to improve immersion.

Until next week, 

 Jazmine Chargualaf

Files

EchoesOfCreation_V0.0.2.exe 1.7 MB
6 days ago

Get Echoes of Creation

Leave a comment

Log in with itch.io to leave a comment.