issues
search
ismail0234
/
Subnautica-Below-Zero-Multiplayer
Subnautica Below Zero Multiplayer Mod. An multiplayer modification for the game Subnautica BZ.
https://subnauticamultiplayer.com/
49
stars
9
forks
source link
Network - Creature Position Optimization
#182
Closed
ismail0234
closed
4 months ago
ismail0234
commented
1 year ago
It is currently possible to fit 40 fish locations in 1 packet. (
With the heaviest optimization, I can increase this value to 82.
)
On average, there are 200 fish near a player. This value can increase up to a maximum of 300 fish.
Using a dictionary instead of a class reduces the packet size by 40-80 bytes.
Creature:
Id: 4 byte + 1 byte
Position: 8 byte + 1 byte
Rotation: 8 byte + 1 byte
Packet (avg)
Total: 10 byte + Fish (24 byte)
Synchronisation of 200 positions per second (Not Optimized)
4 times per second: ((24 byte
200 fish) + 10 byte)
4 => 19.2kb/sn
3 times per second: ((24 byte
200 fish) + 10 byte)
3 => 14.4kb/sn
2 times per second: ((24 byte
200 fish) + 10 byte)
2 => 9.6kb/sn
ismail0234
commented
6 months ago
Optimized Version;
Creature:
Id: 2 byte + 1 byte
Position: 8 byte + 1 byte
Rotation: 8 byte + 1 byte
Packet (avg)
Total: 10 byte + Fish (22 byte)
Synchronisation of 100 positions per second (Optimized)
4 times per second: ((22 byte
100 fish) + 10 byte)
4 => 8.8kb/sn
3 times per second: ((22 byte
100 fish) + 10 byte)
3 => 6.6kb/sn
2 times per second: ((22 byte
100 fish) + 10 byte)
2 => 4.4kb/sn
ismail0234
commented
4 months ago
Completed.
With the heaviest optimization, I can increase this value to 82.)Using a dictionary instead of a class reduces the packet size by 40-80 bytes.Creature:
Packet (avg)
Synchronisation of 200 positions per second (Not Optimized)