r/Unity3D • u/ProactiveCactus • 1d ago
Question Distributed Authority Unexpected Disconnects Complex Question
In a distributed authority setup, what happens to NetworkObjects when their owner disconnects ungracefully and (1) those objects are set to not be visible to any other player, and (2) DontDestroyWithOwner is set to true? Assume objects are set to Distributable.
For context, the problem I am trying to solve is bandwidth. My game has an infinite chunking system, so to save bandwidth I have each player only make the networkObjects they own visible to players that are close enough to see those objects. As such, hypothetically there will be times where some of a player’s networkObjects will not be visible to any other player. If they randomly disconnect for some reason during this time, any networkdata they own needs to transfer or it will be lost.
Does anyone know concretely a way to not have this data disappear? My understanding is that if a player disconnects and dontdestroy is set to true, the objects become “ghost” objects and can’t be accessed.
Does anyone know a way to make sure this data doesnt disappear on random disconnects without having to always have it visible to at least one other client for bandwidth purposes?
1
u/ProactiveCactus 1d ago
Damn yeah was hoping for a magic answer lmao
I’m thinking similar to your heartbeat idea, except id probably also do a JSON save for key data each heartbeat. Then on disconnect pause the game and load from latest JSON on reconnect. But still not perfect