JsonLibrary + JsonAssets (.utxt)

---------- JsonLibrary Plugin ----------

Documentation: cdn.tracerinteractive.com/jsonlibrary/documentation.pdf
Download: github.com/tracerinteractive/UnrealEngine/releases
(scroll down if you get a 404 error)

The JSON library plugin allows developers to manage objects, arrays, and primitive data types using blueprints. It also provides a more robust and organized implementation than what comes with the engine to quickly and easily work with JSON in C++.

The previous example shows raw JSON text being parsed into an object. Three keys are then accessed on this object of various primitive data types.

The next example accesses a key that is an array of strings:

The following image demonstrates creating an empty object and setting key/value pairs in the object of various primitive data types. The object is then stringified into raw JSON text:

You can also convert JSON directly into native UE4 structures…

Or you can go the other direction and convert native UE4 structures into JSON…

There’s also support for translating “relaxed JSON” into “strict JSON” which allows for trailing commas and block/line comments prior to parsing:

This is very useful for loading JSON files that contain comments (such as user settings) or when downloading JSON via HTTP as well. Moreover being able to directly convert to/from native UE4 structures provides a simple yet effective means of working with JSON schemas that are frequently re-used or integral to existing game classes.

The JSON library plugin is utilized across the entire Tracer Interactive collection of plugins. It is a core piece of functionality since JSON is leveraged throughout the engine and on the web, anywhere and everywhere.

---------- GitHub ----------

Setup Instructions: unrealengine.com/ue4-on-github

You must have a GitHub account linked to your Epic Games account! Otherwise you will receive the previous 404 error if you are not signed in with a linked account.

---------- JsonAssets Plugin ----------

Documentation: cdn.tracerinteractive.com/jsonassets/documentation.pdf
Download: github.com/tracerinteractive/UnrealEngine/releases
(scroll up if you get a 404 error)

The JSON assets plugin allows developers to manage structures and dynamic objects with text-based UTXT assets. It provides “structure instance” assets (similar to material instances) that cleanly separate your data from binary assets such as blueprints.

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…well the JSON assets plugin implements a powerful data organization scheme that follows this same concept.

You start by creating a new asset under blueprints of type STRUCTURE INSTANCE. It will then ask you what structure you would like to create an instance of (these can be both blueprint-created and C++). You can now open this asset and it will look just like the “default values” section of the structure editor.

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

The best part is that these assets can be saved as either .UASSET format or as raw .UTXT format!

Here’s an example of what the UTXT format looks like for STRUCTURE INSTANCE assets:

484x382

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

Finally all these UTXT assets automatically cook into UASSET files for your PAK files. So you can keep text-based assets in your /Content directory without actually distributing these assets as raw text in your shipping builds.

Please note that this plugin is still in the early stages of development. There’s a lot that needs to be tested since it’s still an experimental feature. Plus we plan to extend this text-based functionality to other assets if the engine developers never bother to finish the UTXT and UTXTMAP formats themselves…which is most likely seeing as how this functionality has been unfinished for almost three years (how pathetic).

---------- Plugins ----------

If you like this plugin be sure to check out these other plugins as well:

2 Likes

This plugin has been updated for UE5…

JsonLibrary: 5.0

More updates can be found on the releases page:

github.com/tracerinteractive/UnrealEngine/releases/tag/5.0.0