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].

What's New:

  • ReadOnly Attribute: The introduction of the ReadOnly attribute adds an extra layer of protection against accidental modification of essential fields. In the Editor, only the field labeled "Prefab Name" is editable, while all other fields are made read-only.
  • The ability add new item types is now available via Google Sheets integration. Upon configuration, new types will be automatically fetched and populated into the Godot Engine.
    • Google Sheet Page: A new Google Sheet page must be created, bearing the name identical to the new type. This sheet should be populated with default values corresponding to designated variables.
    • New Data Type Creation: A new C# class should be generated within the "Items" folder. This class must extend the "Item" class and include the [Tool] attribute for Editor functionality.
    • Folder Creation: Currently, a manual step—create a folder with the name identical to the new type. Automation for this step is underway.
    • Data Fetching: Clicking the "Download" button will fetch the newly created data from Google Sheets into its respective folder.

Next Up

  • Automatization: Work is in progress to automate folder management, facilitating the automatic creation of new folders for new types and the removal of obsolete ones.
  • Quality of Life Improvements: Enhancements are planned to eliminate the need for manual creation of resource folders and to automate the creation of root database folders.
  • Download Customization: Future updates aim to offer selective download options, allowing for the fetching of specific data types as opposed to downloading the entire dataset.