Minor update again.

This commit is contained in:
genxium 2023-02-01 22:55:27 +08:00
parent 5cfcac6cf6
commit c75f642011
6 changed files with 7 additions and 7 deletions

View File

@ -817,7 +817,7 @@ func (pR *Room) OnDismissed() {
pR.RenderFrameId = 0
pR.CurDynamicsRenderFrameId = 0
pR.NstDelayFrames = 16
pR.NstDelayFrames = 24
serverFps := 60
pR.RollbackEstimatedDtMillis = 16.667 // Use fixed-and-low-precision to mitigate the inconsistent floating-point-number issue between Golang and JavaScript

View File

@ -461,7 +461,7 @@
"array": [
0,
0,
216.2814178905528,
209.73151519075364,
0,
0,
0,

View File

@ -547,7 +547,7 @@
"array": [
0,
0,
216.2814178905528,
209.73151519075364,
0,
0,
0,

View File

@ -80,6 +80,7 @@ NetworkDoctor.prototype.logSkippedRenderFrameCnt = function() {
}
NetworkDoctor.prototype.isTooFast = function(mapIns) {
return false;
const [sendingFps, srvDownsyncFps, peerUpsyncFps, rollbackFrames, skippedRenderFrameCnt] = this.stats();
if (sendingFps >= this.inputRateThreshold + 3) {
// Don't send too fast
@ -97,7 +98,7 @@ NetworkDoctor.prototype.isTooFast = function(mapIns) {
if (mapIns.lastIndividuallyConfirmedInputFrameId[k] >= minInputFrameIdFront) continue;
minInputFrameIdFront = mapIns.lastIndividuallyConfirmedInputFrameId[k];
}
if ((selfInputFrameIdFront > minInputFrameIdFront) && ((selfInputFrameIdFront - minInputFrameIdFront) > (mapIns.inputFrameUpsyncDelayTolerance+2))) {
if ((selfInputFrameIdFront > minInputFrameIdFront) && ((selfInputFrameIdFront - minInputFrameIdFront) > (mapIns.inputFrameUpsyncDelayTolerance >> 1))) {
// first comparison condition is to avoid numeric overflow
console.log(`Game logic ticking too fast, selfInputFrameIdFront=${selfInputFrameIdFront}, minInputFrameIdFront=${minInputFrameIdFront}, inputFrameUpsyncDelayTolerance=${mapIns.inputFrameUpsyncDelayTolerance}`);
return true;

File diff suppressed because one or more lines are too long

View File

@ -23,8 +23,7 @@ const (
GRAVITY_Y = -int32(float64(0.5) * WORLD_TO_VIRTUAL_GRID_RATIO) // makes all "playerCollider.Y" a multiple of 0.5 in all cases
INPUT_DELAY_FRAMES = int32(6) // in the count of render frames
INPUT_SCALE_FRAMES = uint32(2) // inputDelayedAndScaledFrameId = ((originalFrameId - InputDelayFrames) >> InputScaleFrames)
NST_DELAY_FRAMES = int32(16) // network-single-trip delay in the count of render frames, proposed to be (InputDelayFrames >> 1) because we expect a round-trip delay to be exactly "InputDelayFrames"
INPUT_SCALE_FRAMES = uint32(1) // inputDelayedAndScaledFrameId = ((originalFrameId - InputDelayFrames) >> InputScaleFrames)
SP_ATK_LOOKUP_FRAMES = int32(5)