From c104ad8df734f91e2006fd7a8a5d6f005f5b3963 Mon Sep 17 00:00:00 2001 From: Jens Pitkanen Date: Tue, 11 Aug 2020 01:43:24 +0300 Subject: [PATCH] Tweak anti-lag values --- Assets/GameObjects/Prefabs/LocalPlayer.prefab | 2 +- Assets/GameObjects/Prefabs/Player.prefab | 1 + Assets/Scripts/Interface/TerminalStdio.cs | 3 ++- Assets/Scripts/Players/Player.cs | 3 ++- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Assets/GameObjects/Prefabs/LocalPlayer.prefab b/Assets/GameObjects/Prefabs/LocalPlayer.prefab index d2ff9e8..18ff583 100644 --- a/Assets/GameObjects/Prefabs/LocalPlayer.prefab +++ b/Assets/GameObjects/Prefabs/LocalPlayer.prefab @@ -239,7 +239,7 @@ MonoBehaviour: m_EditorClassIdentifier: DisableInput: 0 SyncInterval: 0.5 - MovementUpdateInterval: 0.03 + MovementUpdateInterval: 0.016 --- !u!114 &3537472584083277103 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/Assets/GameObjects/Prefabs/Player.prefab b/Assets/GameObjects/Prefabs/Player.prefab index 60841b5..fa07d4a 100644 --- a/Assets/GameObjects/Prefabs/Player.prefab +++ b/Assets/GameObjects/Prefabs/Player.prefab @@ -1840,6 +1840,7 @@ MonoBehaviour: serializedVersion: 2 m_Bits: 8192 Cooldown: 1 + LerpedDesyncDistance: 2 Lerpables: - {fileID: 6585337033203946896} Lean: 0 diff --git a/Assets/Scripts/Interface/TerminalStdio.cs b/Assets/Scripts/Interface/TerminalStdio.cs index cbcf2aa..eb6ba9f 100644 --- a/Assets/Scripts/Interface/TerminalStdio.cs +++ b/Assets/Scripts/Interface/TerminalStdio.cs @@ -7,7 +7,7 @@ namespace NeonTea.Quakeball.Interface { public class TerminalStdio : UnityEngine.MonoBehaviour { public int SleepBeforeInputMillis; public Terminal Terminal; - +#if UNITY_SERVER private Thread StdioThread; private int MessageIndex = 0; private ConcurrentQueue Commands = new ConcurrentQueue(); @@ -48,5 +48,6 @@ namespace NeonTea.Quakeball.Interface { } } } +#endif } } diff --git a/Assets/Scripts/Players/Player.cs b/Assets/Scripts/Players/Player.cs index fb04f50..9d4a401 100644 --- a/Assets/Scripts/Players/Player.cs +++ b/Assets/Scripts/Players/Player.cs @@ -36,6 +36,7 @@ namespace NeonTea.Quakeball.Players { public float Cooldown; [Header("Visuals")] + public float LerpedDesyncDistance; public DesyncLerper[] Lerpables; public float Lean; public GameObject LaserPrefab; @@ -127,7 +128,7 @@ namespace NeonTea.Quakeball.Players { } if (ShouldApply) { Vector3 Delta = transform.position - syncPckt.Location; - if (Delta.magnitude < 1) { + if (Delta.magnitude < LerpedDesyncDistance) { // Player is close enough to the sync packet, lerp them over. foreach (DesyncLerper Lerper in Lerpables) { Lerper.Offset(Delta);