I'm trying to synchronize 3-4 thousand game objects' positions and rotations. I need performance for my Unity game to remain relatively high (30+fps) and to keep the amount of data sent as low as possible. Therefore I need a solution for sending large amounts of data from the server to the clients with as little data and overhead as possible. I don't want to be paying massive server costs and making the server lag due to too much traffic being sent.
To explain what I'm trying to do: I'm trying to synchronize the destruction of a building across clients. Also, important note, I only need to send data to the clients, I don't need to send any data back to the server (I assumed this would be simple for the server as all it had to do was mass blast all clients with the current game object transform data).
I'm aware that there are tricks to keep traffic low or reduce the need to sync as often such as "client prediction and server side reconciliation", which I plan to look into at a later point (although this could add overhead that perhaps I don't need).
I'm aware that there have been solutions in certain games (I believe) that involve using multiple servers to sync building destruction, but I'd appreciate a single server solution if possible.
I'm also aware that there are probably solutions for avoiding syncing unnecessary game objects that a client may not see such as NetworkProximityChecker, but assuming that all game objects that are being synced are visible and active, I need a solution for handling that (in the worst case scenario that clients can see all the game objects being synced at some point).
Things I've thought about doing are avoiding using NetworkTransforms or even NetworkBehaviours altogether and sending simple NetworkBase/NetworkMessage (I believe it's called) messages to the clients (to reduce data sent). Or, go even more basic and use non-Unity libraries to send data to clients (again to avoid overhead and too much data being sent that might create too much large traffic).
There may not be a solution to this that works well - there is no getting around the simple fact that Vector3s and Quaternions must be constantly sent to each client, and there isn't a way to avoid that massive amounts of data being sent.
I'm using Unity Mirror, although I could and probably will switch to Unity's netcode.
So far, I've tried using Unity Mirror's NetworkIdentity and NetworkTransforms to sync all the necessary object's transforms. With two players the performance wasn't too bad, but not great. With 4 players performance was pretty horrible, with fps around the mid teens.
I was expecting this considering how much data was being sent.
update. game details:
to give more details about the game; players will be walking around a map of destructible buildings that will cause obstacles for them. therefore i need all the broken building parts to be synced. i could only sync parts that're close to players, but in the rare event that there is a lot of destruction all occurring in close proximity to all players, this plan falls apart. I want to ensure the game can handle this uncommon occurrence.
i know that relative to other games sending a ton of data won't be cheap, but cutting the amount of data sent by half could mean reducing cost for running the game, increasing performance (fps) by a lot, and reducing network traffic by a lot. Even small efficiencies i think could come close to making or breaking the game. For example, a 15 - 20 fps game isn't really playable in my opinion but a 28 - 30 fps is. If I could increase performance during these worst case situations of massive destruction even that relatively small amount, that'd be enough.