I am making a build system where the player can “build” from a selection of pre-placed object sets. I have implemented this using data layers. This is for constructing guard towers and small buildings
The rough idea is that data layer has all the actors associated with the tower, and the player can make a selection in a UI that then triggers the server to load that data layer, thereby loading the object into the world. Instantiating a dynamic level instance isn’t suitable for this, because each buildable “plot” is uniquely anchored and integrated into the environment, and so the only real option is to use data layers that show/hide these collections of actors that make up these buildables. At a basic level, this works fine. I am telling the server to enable the chosen buildable data layers, and they load.
As an additional user experience level to this, I also wanted to use client only data layers, to facilitate client side previews of the objects that will be constructed, so the client can visualize a 3d preview of the result, before actually committing to it. This is where I am running into what seems like a bug.
To avoid data bloat and keep things simple, I include all the same actors from the authoritative data layer(unfiltered data layer), in a client only data layer. The idea is that at least on the client side, the client can load the actors via the client only data layer, and the server can load them for everyone using the other unfiltered data layer.
But this doesn’t work as I expect. If an actor is in a client only data layer, it will not unload, even if you have both data layers unloaded.
Tested the following
- Actor is just in a single “buildable” data layer. loads/unloads fine with the runtime state of that data layer properly
- Actor is in a client only data layer only. No other layer. loads/unloads with client only data layer properly
- Actor is in both the “buildable” data layer and a client only data layer. The actors are loaded completely irrespective of either data layer load state. Both layers disabled? still loaded.
Using the default EWorldPartitionDataLayersLogicOperator::Or mode, so I expect that actors would only be loaded if either of these data layers is loaded, but something about being in both is causing the whole set to be always loaded.
Some extra I think relevant information. The buildable layer is under a “plot” layer that acts as a grouping layer for all child buildable data layers, like so. There’s only 1 buildable under this for right now, but the idea is that there could be many, any one of which(or none at all) could be activated.
[Image Removed]
The client only data layer is not in a hierarchy, since you can’t parent them under non client data layers, so they exist at the root of the data layer tree
[Image Removed]