TheYellowArchitect / doubledamnation

Exclusively Co-Op Metroidvania with Movement as smooth as Smash Bros Melee
GNU General Public License v3.0
19 stars 2 forks source link

Position Sync takes too much bandwidth #41

Open TheYellowArchitect opened 2 years ago

TheYellowArchitect commented 2 years ago

On a debug build, press RightShift + F10... Every timePerSnapshot (50 milliseconds), the host sends the position to client (Vector2)

This floods the network with useless snapshots, e.g. when warrior stays idle. Since the same code (NetworkPositionInterpolationController) is extended for Monsters, each monster floods the network, even if its doing absolutely nothing, and you have gone afk! It is disgusting, honestly. For those of you who dont know netcoding, its like checking some flag every frame, instead of having a callback/trigger.

tl;dr: A refactoring of Network(Enemy)PositionInterpolationController is required. Maybe I can fix jittering on sudden ping increase as well.

The benefits of this are that low-bandwidth players (rural areas) can play the game without lag, and that you can download movies/games while playing, instead of Double Damnation leeching your entire bandwidth.