Alex Stevens Profile picture
Apr 28, 2020 17 tweets 6 min read Read on X
Don't know what #UE4's Asset Registry is? Wondering how to query asset data _without_ the cost of loading that asset?! Well, look no further, time for a #UETips tweetorial!
The Asset Registry caches metadata about assets under the hood of UE, and can be used to query this metadata without loading assets.
The editor uses it for gathering references, data validation, the content browser's advanced search syntax (linked), etc.
docs.unrealengine.com/en-US/Engine/C…
However, the Asset Registry can be used at runtime! When your game is cooked, asset registry data is serialised with your packages; when a package is mounted, the asset registry will load that data.

In fact, Robo Recall uses the asset registry to query packaged mods! Image
So how do we use it? We could query the entire asset registry for Static Meshes like so: Image
Or only our game's content folder: Image
Or maybe we received an array of asset data, and we need to filter assets in that? Image
"Sure Alex, but how is this useful?"
I'm glad you asked!

Well, remember when I mentioned that the registry stores metadata? You can generally see this when you hover over an asset in the content browser. For example, a Static Mesh: Image
We could then query that metadata using the asset registry, get the tag value (i.e. Triangles), and then filter based on that condition. If this asset satisfies a condition, we could then asynchronously load it! Image
The same API is used in C++, but we can also do a batch async load using the asset manager.

(The C++ API can also filter assets by tags, and optionally, their exact values. Check out FARFilter::TagsAndValues) Image
We could also get a list of all of the assets that this asset depends on: Image
Or, the opposite... find assets that depend on our asset! Image
For programmers, IAssetRegistry also contains a number of events that are useful, like OnPathAdded/Removed, OnAssetAdded/Removed/Updated/Renamed, etc.
Additionally, programmers can define their own tags for their assets by adding the AssetRegistrySearchable property specifier, or by overriding UObject::GetAssetRegistryTags ImageImageImage
Python also has exposure to the asset registry: Image
Using the asset registry can greatly speed up the querying of assets (instead of loading them), for both the editor and your game!
If you want more information, definitely check out the docs:

- Blueprint:
docs.unrealengine.com/en-US/Blueprin…

- C++:
docs.unrealengine.com/en-US/Programm…

- Python:
docs.unrealengine.com/en-US/PythonAP…
Also, if you haven't checked it out yet, definitely take a look at
@Serellan's Soft Object Refs tutorial (I used them in the async load above). Blueprints will load every hard referenced dependency and Soft Object Refs fix this!

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Alex Stevens

Alex Stevens Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @MilkyEngineer

Apr 7, 2021
Did you know @UnrealEngine 4.26 brought in the ability to extend editor menus and toolbars using Blueprints?

#UETips #UnrealEngine
1. Create an editor utility BP using the EditorUtilityToolMenuEntry class. This BP will allow us to specify where our button is created, its labels, and its behaviour. There's a little more functionality, but we'll focus on toolbar buttons for now. ImageImage
2. Set the name and label of your button, and if making a toolbar extension, set the entry type to "Tool Bar Button" Image
Read 16 tweets
Mar 9, 2021
Struggling to keep track of name/string values in @UnrealEngine for your game logic? Need a lightweight way to standardise those tags? Check out Gameplay Tags!

#UETips
Any added tag can be viewed from the Gameplay Tags window in Project Settings. Any tag that you add will be stored centrally, promoting reuse and will prevent you (or your team) from any pesky spelling mistakes. You can even store them in separate .ini files!
If later, you decide "Nah, that was a terrible name!", you can just rename the tag, and let the system redirect any assets using the old tag to the new one!
Read 9 tweets
Oct 24, 2019
Ever wondered how to define your own Data Validation rules with Editor Utility Blueprints? Here's an example to validate that material asset names are prefixed with "M_".

@UnrealEngine #UE4 #GameDev #Tutorial
1. Enable the Data Validation plugin and restart the editor.
2. Add bAllowBlueprintValidators=true to DefaultEditor.ini

(And optionally enable validate on save and cook by setting to true)
Read 9 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(