Web UI (HTML/CSS/JS Interface Widgets)

As mentioned a new plugin is in the works which allows for JSON assets. Since the JSON library is a required part of the WebUI plugin and all of you already have it, I’m going to share the progress made so far.

However this functionality also strays away from the concept of web-based user interfaces and instead focuses on raw data. Therefore I’ll most likely make a new thread for the JSON assets plugin in order to keep the discussions separated. But until the plugin is actually finished and available for download there’s no point in making a thread just yet…

The entire concept is based around that of materials vs material instances. So just like how you create a material, and it has parameters, and then a material instance overrides the default values of those parameters; we’ve implemented a powerful data organization scheme that follows this same concept. You start by creating a new asset under blueprints of type STRUCTURE INSTANCE.

1

It will then ask you what structure you would like to create an instance of (similar to how the Data Table asset does). These can be both blueprint-created structures and C++ structures.

2

You can now open this asset and it will look just like the “default values” section of the structure editor.

3

It also dynamically updates when you make changes to the parent structure…

struct_instance

Then you can create a variable of type “structure instance” in your blueprints. It can reference the JSON asset directly and then operate on it as either raw JSON or an organized structure.

5

Plus a great optimization is that this data only calls the parse/stringify functions once during loading and saving of the asset. That means you can reuse a piece of data over and over in different blueprints without needing to constantly instantiate the data.

It also means you don’t have to use blueprints to actually store default values or game settings and can instead move these out into separate “structure instance” assets.

Finally the best part is that these assets can be saved as either .UASSET format or as raw .UTXT format instead…

4

There’s some other annoying UE4 data that surrounds the custom JSON but it doesn’t take up that much space and most of it is located below your data anyway.

7

But this is a significant piece of functionality for anyone that uses source control. Right now with everything being binary .UASSET files it can become quickly annoying when needing to constantly upload entirely new files to source control, even if you only changed one small piece of information such as a default value.

Now instead you can feasibly utilize .UTXT files in the course of your everday development and simplify your assets in source control by properly separating text vs binary data. It’s as easy as right clicking and changing the asset type…

text_asset

So again this is just a preview of the JSON assets plugin and what is to come. I will be making a new thread for the JSON assets plugin once it is available for download.