Inventory, items and looting
I decided to take a break from asset creation and do something else for the game instead. I saw some interesting tutorials on inventory systems and figured I'd give it a go.
Garden 2 doesn't require a complicated inventory system as it only has a couple of consumable items for the player to use. I could have probably done it by keeping track of a few variables. However, I wanted to try out a proper system especially because I plan to use most systems created for Garden 2 in my next project, which would have a lot more items.
I chose to follow a tutorial series by LeafBranchGames since their tutorials are well-explained and easy to implement in projects. The inventory would be a grid that would fill up slots in order to check if the item to be added should be added to an existing slot or in a new one. Similar inventories can be found in games such as Minecraft or World of Warcraft. The system created in the tutorial wasn't exactly as I had planned to do Garden 2's inventory, but it does use data tables, structures, parent blueprints, etc. so I figured I'd just modify it afterward to fit my design.
![]() |
| The finished inventory in the tutorial. |
The process began by creating a structure blueprint to contain all the variables an item needs and a data table based on that structure. An actor component was created to handle most of the functions the inventory needed and it could be easily added to any character or object that required the use of the inventory system. The items are children of a base item blueprint and they fill in their information (icon, description, etc.) from the data table when they're initialized.
The tutorial also did user interface widgets to visually display the inventory. The player HUD, which would have all other user interface components later on as well, has a container widget that fills itself with inventory slot widgets. Each created slot widget holds up to one stack of an item and slots without an item would display an empty item. I wanted to make my inventory a list instead of a grid, so at this point, I reduced the number of columns to 1 and made the slot widgets wider.
![]() |
| What my inventory ended up like. |
The tutorial also included a drag-and-drop function for moving items to different slots and dropping them on the ground, which would also happen if the inventory could not hold any more of the item that was being added. Right-clicking an item would use it.
After finishing, I started thinking about what I needed to change to make it work like I intended. I already altered it so that only one stack of an item could be held and limited the maximum stack size of healing items. I also want the empty inventory slots to not show at all and when the player acquires a new item it would add it at the bottom of the list expanding the inventory list throughout the game.
I'll make a new post about the changes once I have more to show. Below is a video showing the use of the inventory in the game.


