Best way to collect actor data for a UI map

I’m exploring building a system to gather important object locations from our worlds for our UI system to be able to query where certain key gameplay objects should be positioned on a 2D UI Map. I’d like for this to happen as seamlessly as possible so that both people running in PIE and cooked / packaged builds have the most up to date information as possible. It is a requirement that this data be available for multiple worlds regardless of the world itself being loaded at runtime.

I’ve currently got a DataAsset with a map of gameplay tags to structures for each world that I care about. The world then contains a single instance of a “MetadataGatherer” actor which points at the correct map DataAsset to populate. It then iterates through all actors in the world (using worldpartition actor iteration helpers; basically the same thing that the Resave commandlet is doing) and looks for actors with a Component on them that indicates they should be added to the metadata DataAsset. This seems to be somewhat working, but there are definitely issues with this and it seems clumsy.

I’m sure people have done something like this before, but it’s hard to know what to search for here. Any thoughts or suggestions would be greatly appreciated!

Most straightforward way I can think of: when a level is saved, write to a data file with the names, locations, etc. of key objects that should appear on the 2D map.

Then your UI could just load data from that file. (sounds like you are pretty much doing that already?)

If the objects move though that makes it a bit more complicated … :open_mouth:

Anyway, as long as you don’t actually have to load levels to find the 2D map locations, you should be good.

Appreciate the response. Diving into the actual mechanics of collection data from actors in world partition worlds a bit, I’m having trouble finding a good way to do this. Currently I have a commandlet that derives from UWorldPartitionBuilder and I’m using the FWorldPartitionHelpers::ForEachActorWithLoading to traverse over all of the actors in the world. However, this doesn’t load actors in level instances, just the level instance actors themselves. How would I go about getting the level instances loaded as well?