- Edited
Hello everyone, I had some free time so I decided to create a way to import all of my data (Resources, Units, Buildings, etc.) into the engine as an extention of its base "Item" (Resource class).
You can see it in action on the video below:
Key Features:
- Unbounded Data Types: Create unlimited instances of different types of game items.
- Extensible Structure: Each derived item type inherits the base Item structure, allowing for specialized fields and functionalities to be added with ease.
- Centralized Management: Centralized database within the editor for hassle-free item management.
- CRUD: (Create, Read, Update, Delete) operations are seamless, ensuring that your game data is always up-to-date without leaving any redundant elements.
Core Data Fields for Every Item Data:
- Name: Unique identifier for each item.
- DisplayName: User-facing name of the item.
- Prefab: A scene node associated with the item.
- Sprite: A graphical icon to represent the item.
- MaxStackSize: Maximum number of identical items that can be stored in a single inventory slot.
Specialized Data Fields:
For example, the "Resource" item type includes an additional field:
- Description: A brief description of the resource item.
This is just as an exmaple, adding them is very easy but does require going into the code a bit.
Workflow:
There isn't much to say about it. Single press on "Download" button downloads all of the data and these are the functionalities:
- Delete Operation: Removes the item from the centralized database and deletes its corresponding data in the editor.
- Update Operation: Edits the attributes of an existing item without altering its ID or removing any data.
- Create Operation: Generates a new item and stores it in the "Resources" folder within the editor (default path, might change later).
- Duplicate data: Automatically removed from the array and from its [ext_resource].
Challenges and Limitations:
- Editor Refresh Issue: Currently, the editor needs to be restarted for it to reflect any updated values from the Google Sheet or the centralized database. As of now, an efficient way to refresh the UI dynamically has not been implemented.
- Editor Crash on Data Deletion: Deleting an item from the centralized database will result in the editor crashing, making it crucial to handle item deletions cautiously.
- Null Value Handling: Changing any value to null, except for the last field, will cause the editor to crash. This limits the flexibility of the system when dealing with optional or incomplete data.
- Automatic but Risky Duplicate Removal: The system is capable of automatically purging duplicate entries from the database. However, this operation comes with inherent risks. The system accesses the .tres file to identify and eliminate duplicate [ext_resource] entries. While efficient, this process carries the potential risk of database corruption, which could result in the inability to reopen the database. In that case you have to manually open the .tres file and remove all [ext_resource].