Streaming levels - persistence

Hello,

I am looking for an advice what would be the best praxis in serializing the world state. We have a persistent level and many levels in a world composer which load as player traverses through the levels. The problem arises in streaming levels.

Let me give an example:

  1. Player comes to a level, there is an object lying on the ground
  2. Player can take that item (item disappears - destroyed actor).
  3. Player goes a few meters away (new level gets streamed)
  4. Player revisits the location (previous level gets streamed back) and the item is lying there once again as Unreal doesn’t remember that it was destroyed.

I already have own game data serialization but I am looking for the best way, how to do this in the world. As there is to my knowledge no real way how to check if the level is streaming or which objects are there, my current thought is that for such objects, I would put something in the construction script, which would simply destroy them. However this would require turning even simple meshes into blueprints.

I would be happy for any advice how to handle this properly. I have a feeling that I am missing some basic thing in the engine. :slight_smile:

Thank you!

OK. I got helped by blackfox. He suggested to hook up this delegate: FWorldDelegates::LevelAddedToWorld which gets called whenever level gets streamed. This will allow me to destroy / switched off everything, which needs to be away. So it is only a matter of manually storing information, which will tell which object should be changed,