# JsonLibrary + JsonAssets (.utxt)

**URL:** <https://forums.unrealengine.com/t/jsonlibrary-jsonassets-utxt/228669>\
**Category:** UE Marketplace\
**Tags:** unreal-engine\
**Created:** [May 10, 2021, 4:26pm UTC](https://forums.unrealengine.com/t/jsonlibrary-jsonassets-utxt/228669 "2021-05-10T16:26:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![spidershift](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@spidershift](https://forums.unrealengine.com/u/spidershift)\
**Post date:** [May 10, 2021, 4:26pm UTC](https://forums.unrealengine.com/t/jsonlibrary-jsonassets-utxt/228669/1 "2021-05-10T16:26:22Z")

</div>

Documentation: [cdn.tracerinteractive.com/jsonlibrary/documentation.pdf](http://cdn.tracerinteractive.com/jsonlibrary/documentation.pdf)  
Download: [github.com/tracerinteractive/UnrealEngine/releases](https://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++.

 ![](https://d3kjluh73b9h9o.cloudfront.net/original/3X/4/5/45c4cc82feef21dab062e56fd6cb0476bb0c081b.png)

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:

 ![](https://d3kjluh73b9h9o.cloudfront.net/original/3X/3/7/379e4f35fa0551c1ffbeb2fe3e3066f8b8b54ca0.png)

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:

 ![](https://d3kjluh73b9h9o.cloudfront.net/original/3X/1/9/190f92be22812aa9a57c0fdc041b11875bc3bc61.png)

You can also convert JSON directly into native UE4 structures…

![](https://d3kjluh73b9h9o.cloudfront.net/original/3X/4/c/4cf4d2621318c3354333e9125a677ca7fa03364f.gif)

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

![](https://d3kjluh73b9h9o.cloudfront.net/original/3X/e/3/e3b068439e87eae6bd22460051fbab11979a6626.gif)

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

 ![](https://d3kjluh73b9h9o.cloudfront.net/original/3X/b/e/be26f33db9425739f5a176df45cc8d3d464bb1e1.png)

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](http://unrealengine.com/ue4-on-github)

![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/a/7/6a7b863ad66ecf6a0786f2eec5c28e66c4a772f6.png)

**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](http://cdn.tracerinteractive.com/jsonassets/documentation.pdf)  
Download: [github.com/tracerinteractive/UnrealEngine/releases](https://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.

 ![](https://d3kjluh73b9h9o.cloudfront.net/original/3X/3/c/3c2443731b6102f2d002f4e2a4953c369f23b22f.png)

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.

![](https://d3kjluh73b9h9o.cloudfront.net/original/3X/6/7/67511aa44e30c136997a4149328a76f5b823466b.png)

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

![](https://d3kjluh73b9h9o.cloudfront.net/original/3X/c/c/cc67e4e9a4fb7cab340396a8660c9dc98368587e.gif)

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

![](https://d3kjluh73b9h9o.cloudfront.net/original/3X/a/9/a9151c2406424395ce505477ba947007b79cea28.gif)

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

![484x382](https://d3kjluh73b9h9o.cloudfront.net/original/3X/0/c/0c0fcf5c70931c13fd856d3a7a362c3fda66051b.png)

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.

 ![](https://d3kjluh73b9h9o.cloudfront.net/original/3X/e/4/e43d6e32637d2e30aa121688473a7ed8bef460b8.png)

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.

---

<div class="post-metadata">

**Author:** ![spidershift](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@spidershift](https://forums.unrealengine.com/u/spidershift)\
**Post date:** [April 6, 2022, 11:26am UTC](https://forums.unrealengine.com/t/jsonlibrary-jsonassets-utxt/228669/2 "2022-04-06T11:26:02Z")

</div>

This plugin has been updated for UE5…

JsonLibrary: [5.0](https://github.com/tracerinteractive/UnrealEngine/releases/download/5.0.0/JsonLibrary-5.0.zip)

More updates can be found on the releases page:

[github.com/tracerinteractive/UnrealEngine/releases/tag/5.0.0](https://github.com/tracerinteractive/UnrealEngine/releases/tag/5.0.0)
