From da1204dc63b4c788160f986420cac8853ba60ba0 Mon Sep 17 00:00:00 2001 From: genxium Date: Fri, 10 Mar 2023 15:49:00 +0800 Subject: [PATCH] Minor update. --- README.md | 7 +++---- battle_srv/models/room.go | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 2db8094..25e2081 100644 --- a/README.md +++ b/README.md @@ -10,10 +10,9 @@ This project is a demo for a websocket-based rollback netcode inspired by [GGPO] ![Phone4g_battle_spedup](./charts/Phone4g_battle_spedup.gif) -**Since v1.0.12, smoothness in worst cases (e.g. turn-around on ground, in air and after dashing) is drastically improved due to update of prediction approach. The gifs and corresponding screenrecordings above are not updated because there's no big difference when network is good -- however, `input delay` is now set to `4 frames` -- while `input delay = 6 frames` was used in the screenrecordings -- and smoothness is even better now (well there's [a new screenrecording for PcWifi vs Android4g here](https://pan.baidu.com/s/1iNrQ2l_wqbWkURMIfyG88w?pwd=fe2f)).** Key changes are listed below. -- [change#1](https://github.com/genxium/DelayNoMore/blob/de9f3c90902bc6da98359be996887a55964e011e/jsexport/battle/battle.go#L647) -- [change#2](https://github.com/genxium/DelayNoMore/blob/de9f3c90902bc6da98359be996887a55964e011e/frontend/assets/scripts/Map.js#L1451) -- [change#3](https://github.com/genxium/DelayNoMore/blob/de9f3c90902bc6da98359be996887a55964e011e/battle_srv/models/room.go#L1312) +**Since v1.0.13, smoothness in worst cases (e.g. turn-around on ground, in air and after dashing) is drastically improved due to update of prediction approach. The gifs and corresponding screenrecordings above are not updated because there's no big difference when network is good -- however, `input delay` is now set to `4 frames` -- while `input delay = 6 frames` was used in the screenrecordings -- and smoothness is even better now (well there's [a new screenrecording for PcWifi vs Android4g here](https://pan.baidu.com/s/1iNrQ2l_wqbWkURMIfyG88w?pwd=fe2f)).** Key changes are listed below. +- [change#1](https://github.com/genxium/DelayNoMore/blob/ea14ced958415dbf4ec1bef89088a3c7607fd8b3/jsexport/battle/battle.go#L647) +- [change#2](https://github.com/genxium/DelayNoMore/blob/ea14ced958415dbf4ec1bef89088a3c7607fd8b3/frontend/assets/scripts/Map.js#L1446) As lots of feedbacks ask for a discussion on using UDP instead, I tried to summarize my personal opinion about it in [ConcerningEdgeCases](./ConcerningEdgeCases.md) -- **since v0.9.25, the project is actually equipped with UDP capabilities as follows**. - When using the so called `native apps` on `Android` and `Windows` (I'm working casually hard to support `iOS` next), the frontends will try to use UDP hole-punching w/ the help of backend as a registry. If UDP hole-punching is working, the rollback is often less than `turn-around frames to recover` and thus not noticeable, being much better than using websocket alone. This video shows how the UDP holepunched p2p performs for [Phone-Wifi v.s. PC-Wifi (viewed by PC side)](https://pan.baidu.com/s/1K6704bJKlrSBTVqGcXhajA?pwd=l7ok). diff --git a/battle_srv/models/room.go b/battle_srv/models/room.go index ea2d4fe..ac5bbf8 100644 --- a/battle_srv/models/room.go +++ b/battle_srv/models/room.go @@ -845,7 +845,7 @@ func (pR *Room) OnDismissed() { pR.RollbackEstimatedDtNanos = 16666666 // A little smaller than the actual per frame time, just for logging FAST FRAME dilutedServerFps := float64(58.0) // Don't set this value too small, otherwise we might miss force confirmation needs for slow tickers! pR.dilutedRollbackEstimatedDtNanos = int64(float64(pR.RollbackEstimatedDtNanos) * float64(serverFps) / dilutedServerFps) - pR.BattleDurationFrames = int32(20 * serverFps) + pR.BattleDurationFrames = int32(60 * serverFps) //pR.BattleDurationFrames = int32(20 * serverFps) pR.BattleDurationNanos = int64(pR.BattleDurationFrames) * (pR.RollbackEstimatedDtNanos + 1) pR.InputFrameUpsyncDelayTolerance = battle.ConvertToNoDelayInputFrameId(pR.NstDelayFrames) - 1 // this value should be strictly smaller than (NstDelayFrames >> InputScaleFrames), otherwise "type#1 forceConfirmation" might become a lag avalanche @@ -854,7 +854,7 @@ func (pR *Room) OnDismissed() { pR.BackendDynamicsEnabled = true // [WARNING] When "false", recovery upon reconnection wouldn't work! pR.ForceAllResyncOnAnyActiveSlowTicker = true // See tradeoff discussion in "downsyncToAllPlayers" - pR.FrameDataLoggingEnabled = true // [WARNING] DON'T ENABLE ON LONG BATTLE DURATION! It consumes A LOT OF MEMORY! + pR.FrameDataLoggingEnabled = false // [WARNING] DON'T ENABLE ON LONG BATTLE DURATION! It consumes A LOT OF MEMORY! pR.BattleUdpTunnelLock.Lock() pR.BattleUdpTunnel = nil pR.BattleUdpTunnelAddr = nil