Now that 5.8 added UWorldPartitionRuntimeCellTransformer::TransformRuntimeCell we have a use case where we want some systems to be able to added some data to the Cells so they can respond before WorldPartition loads the ULevel.
We are trying to limit the size of UWorldPartitionRuntimeCell as there can be a lot in most large WP levels. I discussed with a colleague and found a way to store the user data at the in the persistent level. ULevel already implements the interface. As such, you can add one instance of your custom user data to the persistent level in the first call to TransformRuntimeCell. The custom user data could contain a map (cellID -> cell info). The data can be accessed in OnLevelStreamingTargetStateChanged
You are correct. The code I pasted executes at the wrong moment. I meant to say TransformRuntimeCell (not Transform). This one runs before the persistent level is saved. The caveat is that the info you are generating must be available at the actordesc level. It won’t work if the info is coming from the actual actors\components in the transformed level.
Can you share more details on the what type of information you want to collect\generate with that system?
FYI, we have a call scheduled next week so I’m happy to discuss it then if you can join.
Thinking about this a bit more these features would be useful for us to solve the various problems we have with trying to collapse data down in the transformers
Be able to run a transformer on the always loaded actors Cell/Level. This would let us turn a bunch of always loaded actors into single lighter weight data structures.
Have all the individual cell transformers be able to mutate the root persistent ULevel so we can collapse individual placements into a cheaper global data store.
[Attachment Removed]
We use the ULevel AssetUserData as well, but the reason we want it on the UWorldPartitionRuntimeCell is because you can access it without needing the load the ULevel. The UWorldPartitionRuntimeCell are always loaded so we can get info about the cells before we load them. The ULevel requires fulling loading it before we can access the AssetUserData so we would only get the data from the cells that are currently loaded.
We have tried that as well but the problem is the serialization order or potentially the GC during cook. The root Persistent level does not always save last so mutating it during the transformers is not guaranteed to always have your data from all the Transformers.
If the transformers could all write data into the Persistent ULevel and have it be saved after all the Transformers run that would also be a perfectly fine solution for us. Basically what we are trying to do is replace a lot of data and management actors in the game with global data that is much lighter. If the Transformers had a function like UMyCellTransformer::TransformPersistentLevel(ULevel* InPersistentLevel) that would be really nice.
That is a good tip, we might be able to get some of what we need through the actordesc, but for others we would need the full actor.
We are using a lot of transformers for optimization. The use case here is that basically want to harvest a bunch of actors data, remove them, and collapse all their data into a global data structure. I would love to have a meeting to chat about what we are doing and any help we can get with it!