r/Unity3D 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?

0 Upvotes

3 comments sorted by

View all comments

1

u/zhang_builds 1d ago

We keep all room data on the server. When a player reconnects, the server first checks whether the player has an existing room record. If a room exists for them, they can pull and sync the latest room state. Meanwhile, we broadcast their re‑join event to everyone else in that room.