Closed NuclearC closed 8 years ago
because it affects server performance dramatically and increase network traffic significantly. In other words, it add very high lags when there are a lot of players on the server. In average it will increase server traffic for additional 2-4 megabytes per second and will leads to extreme lags on multisplit. Because multisplit increase view range, so most largest player will see a lot of players with skins and all these skins also should be send to all spectators (10-20 in average). For example 10 split players with 16 cells for each player will take 160 skinned cells, each cell can take up to 34 bytes for skin name. 10 * 16 * 34 = 5440 additional bytes * 20 spectators * 25 updates per second = 2720000 bytes = 2,7 megabytes per second just to send skin names and it doesn't include cell updates which should be send. Cell update takes minimum 15 bytes per cell => 160 cells * 15 bytes * 20 spectators * 25 updates per second = 1200000 bytes per second.
As you can see, your suggestion will increase traffic from 1,2 megabytes per second to 1,2 + 2,7 = 3,9 megabytes per second
@Barbosik i mean just fix 'skin' command to change skin even when player already spawned. It'll not decrease server performance much, right? And network traffic won't be so much, just your 3,9 MB will be sent in one tick (it'll not be even 3 MB because not every player sees changed nodes). It also will fix 'name' command to change name in-game (how did old version of Ogar). But it's your project if you dont want to do that. Maybe you are right, because that server I showed above is written in C++ and is Running on localhost.
sending name and skin update in each update packet leads to high lags, the game will be completely unplayable due to extreme high lags. It works ok for single player and localhost, but it doesn't works ok for real server with a lot of real players. With such change you will get high multisplit lags even with 10-20 players.
what about sending name and skin only when name or skin changed?
it requires algorithm to track what name/skin was sent to each client and to find if clients needs update or not. It will slow down the server, consume additional memory and will not provide any benefit for server. I don't think it's good idea to add lags just to support some console commands which is actually don't needed for server.
Why 'skin' command is not working when already spawned? Server just needs to add 'isSkinPresent' flag if that flag doesnt exist on current node and send 'addNode' again for that node. Here is what I got on my server: