Posted February 15, 2025 by Good Faith Company
Hi! Ivan is here again. I am the Team Leader, Project Manager, and Senior Developer on our game Return to Divinity. Today, I would like to tell you about the refactoring of the item/inventory system for Return to Divinity.
In my previous devlog from last week, I shared the design of the inventory system. In response to my post, my connection Jazmine Chargualaf shared with me the Working with Data in Unreal Engine 5 presentation by Jack Condon. It highlighted various tools Unreal Engine 5 provides for handling data and impressed me so much that I decided to refactor the existing item implementation.
The motivation behind the refactoring was to proactively facilitate working with items for the future stages of development, where having a simple interface for adjusting item stats (and tracking their changes) would be a great time saver.
What the designs were:
What the designs have become:
First, having item data separate from item assets allows the developers to change how the item data is represented without changing what an item actually is. Simply put, I can change the facade however I want without affecting the core. It is like you dressing differently for different occasions but remaining essentially the same human being.
Second, even though presenting items as UObject assets is a valid way, it is logistically inconvenient: every item is essentially a sub-archetype of items, and to get the item data, you would need to create an instance of that archetype with its default data. Even though Unreal Engine has a convenient function UClass::GetDefaultObject() for this exact purpose, I would much prefer to have direct and easy access to item data - because those item assets are meant to be concrete instances in the first place, not archetypes.
Data Assets act as concrete instances rather than archetypes when you work with them, which allows me as a developer to reference the data I need directly.
Furthermore, Unreal Engine has a built-in feature for tracking changes to Data Assets (which allegedly also works with UObjects, too, but it did not support our kind of items).
Have we added new features to the game? Not necessarily, but refactoring is not about adding features: it is about making their implementation more stable and easier to work with. These changes will save designers time when they are creating and tweaking items later in Alpha and Beta.
Best,
Ivan Shyika
Team Leader, Project Manager, and Senior Developer of Good Faith Team