Unreal peeps - I'm looking into idiomatic and performant ways to iterate over all actors in a map and extract certain properties. E.g. I want all static mesh components and need to know their pos in the world. What's the fastest way that works with level instances?
re-toots welcome! #UnrealEngine5 #unreal
Current approach in a world portioned map is to use loader adaptors to load subsections of the world and wait for everything to be fully loaded. This seems to currently be the bottleneck - any recommended readings?
@RichardKogelnig my save game system does this, however it does it reactively (restores state as levels load, saves it as levels unload) so may not be what you want https://github.com/sinbad/SPUD/blob/3f8d1ae3f7667002526ff5fcdb2ec007694ed767/Source/SPUD/Private/SpudState.cpp#L42
@sinbad thanks! as far as I understand from the snippet that's for an already loaded level or?
What I'm trying to do is to process sub-AABBs of a world portioned level. Start from nothing but the actor descriptors (and whatever is not streaming enabled), load a single Grid AABB, wait for it to load (which could mean waiting for level instances), and then do something similar to your saving code.
The waiting for fully the level to be fully loaded seems to be the current bottleneck.
@sinbad and current I don't know if I can load multiple AABBs and know which have finished loading.
In addition I think I'd want to not load all components and everything in them if I'm only interested in certain components. I think there might not be a good way to do this?
@RichardKogelnig not that I know of, but in my case I’m mostly reactive to the level streaming system so I’ve not had to dig into that. The only time I trigger a load is on load game, but that loads the persistent level which has a much clearer life cycle