Minor update.

This commit is contained in:
genxium 2023-01-22 14:32:32 +08:00
parent 59767c1ed5
commit b5b43bb596
4 changed files with 8 additions and 8 deletions

File diff suppressed because one or more lines are too long

View File

@ -547,7 +547,7 @@
"array": [ "array": [
0, 0,
0, 0,
216.6734179122529, 210.16474188040044,
0, 0,
0, 0,
0, 0,

View File

@ -14,7 +14,7 @@ NetworkDoctor.prototype.reset = function(capacity) {
this.inputRateThreshold = gopkgs.ConvertToNoDelayInputFrameId(60); this.inputRateThreshold = gopkgs.ConvertToNoDelayInputFrameId(60);
this.peerUpsyncThreshold = 8; this.peerUpsyncThreshold = 8;
this.rollbackFramesThreshold = 8; // Roughly the same as TurnAroundFramesToRecover this.rollbackFramesThreshold = 4; // Slightly smaller than the minimum "TurnAroundFramesToRecover".
}; };
NetworkDoctor.prototype.logSending = function(stFrameId, edFrameId) { NetworkDoctor.prototype.logSending = function(stFrameId, edFrameId) {
@ -83,8 +83,8 @@ NetworkDoctor.prototype.isTooFast = function() {
const [sendingFps, srvDownsyncFps, peerUpsyncFps, rollbackFrames, skippedRenderFrameCnt] = this.stats(); const [sendingFps, srvDownsyncFps, peerUpsyncFps, rollbackFrames, skippedRenderFrameCnt] = this.stats();
if (sendingFps >= this.inputRateThreshold && srvDownsyncFps >= this.inputRateThreshold) { if (sendingFps >= this.inputRateThreshold && srvDownsyncFps >= this.inputRateThreshold) {
// At least my network is OK for both TX & RX directions. // At least my network is OK for both TX & RX directions.
if (rollbackFrames >= this.rollbackFramesThreshold && peerUpsyncFps < this.peerUpsyncThreshold) { if (rollbackFrames >= this.rollbackFramesThreshold) {
// I got many frames rolled back while none of my peers effectively helped my preciction. // I got many frames rolled back while none of my peers effectively helped my preciction. Deliberately not using "peerUpsyncThreshold" here because when using UDP p2p upsync broadcasting, we expect to receive effective p2p upsyncs from every other player.
return true; return true;
} }
} }

View File

@ -49,7 +49,7 @@ var Characters = map[int]*CharacterConfig{
JumpingInitVelY: int32(float64(8) * WORLD_TO_VIRTUAL_GRID_RATIO), JumpingInitVelY: int32(float64(8) * WORLD_TO_VIRTUAL_GRID_RATIO),
JumpingFramesToRecover: int32(2), JumpingFramesToRecover: int32(2),
InertiaFramesToRecover: int32(8), InertiaFramesToRecover: int32(9),
DashingEnabled: false, DashingEnabled: false,
OnWallEnabled: false, OnWallEnabled: false,
@ -98,7 +98,7 @@ var Characters = map[int]*CharacterConfig{
JumpingInitVelY: int32(float64(7.5) * WORLD_TO_VIRTUAL_GRID_RATIO), JumpingInitVelY: int32(float64(7.5) * WORLD_TO_VIRTUAL_GRID_RATIO),
JumpingFramesToRecover: int32(2), JumpingFramesToRecover: int32(2),
InertiaFramesToRecover: int32(8), InertiaFramesToRecover: int32(9),
DashingEnabled: true, DashingEnabled: true,
OnWallEnabled: true, OnWallEnabled: true,
@ -154,7 +154,7 @@ var Characters = map[int]*CharacterConfig{
JumpingInitVelY: int32(float64(7.8) * WORLD_TO_VIRTUAL_GRID_RATIO), JumpingInitVelY: int32(float64(7.8) * WORLD_TO_VIRTUAL_GRID_RATIO),
JumpingFramesToRecover: int32(2), JumpingFramesToRecover: int32(2),
InertiaFramesToRecover: int32(8), InertiaFramesToRecover: int32(9),
DashingEnabled: false, DashingEnabled: false,
OnWallEnabled: false, OnWallEnabled: false,