In the articy importer for Unreal Engine, a data asset called “global variables” exist. Upon starting the game, that asset is duplicated as a transient object for runtime data changes. It’s relatively straight forward; it is organized into variable sets, which each include variables of type int, bool and string, and runtime delegates to listen for changed values. This can be used for things like inventories, quest state and so on. Debugging these values however wasn’t as nice as it should have been.
Introducing a custom asset editor for the “global variables” data asset, registered as a tool to summon while the game is running:
While the technicalities aren’t super complex, it is a good example of how to visualize runtime data that exists outside of the usual details panel system.
If you have some slate experience yourself, you might ask: “Why didn’t you just create a details panel for that transient data asset via FPropertyEditorModule and summoned that inside that window?!”
I’m glad you asked. There is a hierarchy of instanced UObjects in that asset, which messes with the categories. This way, variables of different variable sets can be listed next to each other, or two variables with the same names but of different sets end up being grouped! So I ended up writing my own widgets, and tried to write a details customization first. This backfired in an interesting way too; the search function of a details panel is not customizable. Individual property rows of a details panel are considered to be the finest granularity you can search for.
In my case, I had an expandable widget for a variable set and additional widget rows of variable below; for the details panel, this was considered a single row as the row itself contained the parent widget! It made the search function unuseable.
That’s why a custom editor was needed. It closely mimicks the default editor style for data assets; which is a toolbar and a large details panel below with the search bar. Here, a new search function filters for the contained variable widgets instead so it works as one would expect. The variable widgets themselves were made to look like default widgets, but were tailored towards the intended use, to fire delegates when changing a value. This way, if the global variables are used as trigger points rather than just to track state, one can start quests, complete quests, spawn enemies, open doors etc. just by clicking the relevant checkboxes.