So with multiplayer games, I was wondering, if I have a destructible world with say 50,000 destructible pieces, does each piece need to be read by the server and sent to each client? Is that how that works?
What is someone’s best guess for the bandwidth used for destroying those 50,000 destructible objects with a server of 50 players?
I am fairly certain that you do not want to replicate the physics chunks themselves, only where the meshes fracture. Even the Battlefield series only replicates where objects are fractured; if you look at some footage Battlefield doesn’t really spawn many debris chunks, they quickly destroy the chunks and use smoke or particle effects to cover it up. To make it a bit easier to replicate the damage and fracture locations you should check out DENT, it is a good example of what to do regarding multiplayer.
that’s not really my question.
my question is, each client and player would have to know when something is destroyed, right? Meaning the server would be responsible for it.
For example, my friend and I are on a ten storey floor and we want to jump out of the building through the glass window, both players need to know that there is no longer glass there after destruction, so the server sends that information to all players, and the glass window is now broken for all of them, even though only one player broke that window.
Now say there are 5000 windows on each building, or 50000 on ten buildings.
What kind of bandwith am I looking at if say 50 players destroyed 1000 glass windows each?
I don’t care about cpu processing or memory or the engine calculations, I’m just concerned about the amount of bandwith usage from client to server to client among all players. As it’s expensive.
but if destroying 50k windows in say, a 24hour period only uses x bandwith, and is a relatively smaller usage, say client-server-client per Server with the 50 players uses 50kb per 20 windows broken, then it could most likely be doable?
It depends on whether its dynamic destruction or scripted…Scripted destruction would be more tedious to set up but would only require a Boolean true or false…Like Mesh01 Destroyed = true…Then just have it play an animation which could be handled client side.
If its dynamic that means that each piece of the object after destruction would have to send where it landed in xyz and each piece would have to be transferred through the server…Lots of companies are trying to find ways to allow dynamic destruction server side but it uses too much bandwidth.
But if you were to do a combination of both meaning large buildings would be scripted and only certain walls or windows were dynamic with only a few pieces to break into it is possible to get it to run smooth.
You would have to calculate how many pieces an object can break into then add up the amount of data required for a given destructible…Like a true or false would be a byte then xyz coordinates would be some amount etc.
You could even have it only send the physics of the dynamic destruction only to players closest to the destructible…Then just have it recorded that window01 = broken for players that get near it after the fact.
But yes all destruction has to be handled by the server in some way.