diff --git a/Assets/Mirror/Examples/TestNT/Prefabs/Bot.prefab b/Assets/Mirror/Examples/TestNT/Prefabs/Bot.prefab index 874279d94..36a6c02ee 100644 --- a/Assets/Mirror/Examples/TestNT/Prefabs/Bot.prefab +++ b/Assets/Mirror/Examples/TestNT/Prefabs/Bot.prefab @@ -15,6 +15,7 @@ GameObject: - component: {fileID: 8096906436974498748} - component: {fileID: 6545184674585495222} - component: {fileID: 4832621091644330542} + - component: {fileID: 7961362217038480789} m_Layer: 6 m_Name: Bot m_TagString: Player @@ -123,6 +124,7 @@ MonoBehaviour: positionPrecision: 0.02 scalePrecision: 0.02 velocity: {x: 0, y: 0, z: 0} + angVelocity: {x: 0, y: 0, z: 0} --- !u!114 &6545184674585495222 MonoBehaviour: m_ObjectHideFlags: 0 @@ -138,8 +140,9 @@ MonoBehaviour: syncDirection: 0 syncMode: 0 syncInterval: 0.1 - characterController: {fileID: 365631096971600796} + NTR: {fileID: 0} animator: {fileID: 0} + characterController: {fileID: 365631096971600796} physicsMaterial: {fileID: 13400000, guid: c3ac683db06890b49a15dd5009dbd6e8, type: 2} moveSpeedMultiplier: 8 maxTurnSpeed: 100 @@ -148,6 +151,7 @@ MonoBehaviour: maxJumpSpeed: 5 jumpDelta: 0.2 groundState: 2 + moveState: 2 horizontal: 0 vertical: 0 turnSpeed: 0 @@ -173,6 +177,27 @@ MonoBehaviour: syncInterval: 0.1 nameText: {fileID: 4457544332397682606} playerName: +--- !u!114 &7961362217038480789 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 629047657802428152} + m_Enabled: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 995b66880233cda49846f5cda46330ba, type: 3} + m_Name: + m_EditorClassIdentifier: + syncDirection: 0 + syncMode: 0 + syncInterval: 0.1 + networkTransformReliable: {fileID: 0} + serverBufferText: {fileID: 2520575634317220638} + clientBufferText: {fileID: 9167280228736349983} + snapIntText: {fileID: 1649625818729847816} + serverSnapCount: 0 + clientSnapCount: 0 --- !u!1 &1296439317632248743 GameObject: m_ObjectHideFlags: 0 @@ -190,7 +215,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &3778709512122544917 RectTransform: m_ObjectHideFlags: 0 @@ -362,7 +387,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &2277275783330066836 RectTransform: m_ObjectHideFlags: 0 diff --git a/Assets/Mirror/Examples/TestNT/Prefabs/NPC.prefab b/Assets/Mirror/Examples/TestNT/Prefabs/NPC.prefab index 759e92c0a..117648fd3 100644 --- a/Assets/Mirror/Examples/TestNT/Prefabs/NPC.prefab +++ b/Assets/Mirror/Examples/TestNT/Prefabs/NPC.prefab @@ -1078,6 +1078,7 @@ GameObject: - component: {fileID: 367848704157024905} - component: {fileID: 3427814615500822403} - component: {fileID: 3915821277891986203} + - component: {fileID: -2480596454832827664} m_Layer: 6 m_Name: NPC m_TagString: Player @@ -1186,6 +1187,7 @@ MonoBehaviour: positionPrecision: 0.02 scalePrecision: 0.02 velocity: {x: 0, y: 0, z: 0} + angVelocity: {x: 0, y: 0, z: 0} --- !u!114 &3427814615500822403 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1201,8 +1203,9 @@ MonoBehaviour: syncDirection: 0 syncMode: 0 syncInterval: 0.1 - characterController: {fileID: 8094616116228944553} + NTR: {fileID: 0} animator: {fileID: 0} + characterController: {fileID: 8094616116228944553} physicsMaterial: {fileID: 13400000, guid: c3ac683db06890b49a15dd5009dbd6e8, type: 2} moveSpeedMultiplier: 8 maxTurnSpeed: 100 @@ -1211,6 +1214,7 @@ MonoBehaviour: maxJumpSpeed: 5 jumpDelta: 0.2 groundState: 2 + moveState: 2 horizontal: 0 vertical: 0 turnSpeed: 0 @@ -1236,3 +1240,25 @@ MonoBehaviour: syncInterval: 0.1 nameText: {fileID: 5231846894102171291} playerName: +--- !u!114 &-2480596454832827664 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9078678990242496461} + m_Enabled: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 995b66880233cda49846f5cda46330ba, type: 3} + m_Name: + m_EditorClassIdentifier: + syncDirection: 0 + syncMode: 0 + syncInterval: 0.1 + NTRCustomSendInterval: {fileID: 0} + NetworkTransformReliable: {fileID: 367848704157024905} + serverBufferText: {fileID: 6322424803937864235} + clientBufferText: {fileID: 756491762232780330} + snapIntText: {fileID: 7179727379187289405} + serverSnapCount: 0 + clientSnapCount: 0 diff --git a/Assets/Mirror/Examples/TestNT/Prefabs/Player.prefab b/Assets/Mirror/Examples/TestNT/Prefabs/Player.prefab index 9c7788377..95968c388 100644 --- a/Assets/Mirror/Examples/TestNT/Prefabs/Player.prefab +++ b/Assets/Mirror/Examples/TestNT/Prefabs/Player.prefab @@ -363,6 +363,7 @@ GameObject: - component: {fileID: 222851012733586747} - component: {fileID: -7969791118079622209} - component: {fileID: 3644259943796578628} + - component: {fileID: 7156468669696336682} m_Layer: 6 m_Name: Player m_TagString: Player @@ -485,6 +486,7 @@ MonoBehaviour: positionPrecision: 0.02 scalePrecision: 0.02 velocity: {x: 0, y: 0, z: 0} + angVelocity: {x: 0, y: 0, z: 0} --- !u!114 &5645625692974173159 MonoBehaviour: m_ObjectHideFlags: 0 @@ -500,8 +502,9 @@ MonoBehaviour: syncDirection: 0 syncMode: 0 syncInterval: 0.1 - characterController: {fileID: 1269623552087207629} + NTR: {fileID: 0} animator: {fileID: 0} + characterController: {fileID: 1269623552087207629} physicsMaterial: {fileID: 13400000, guid: c3ac683db06890b49a15dd5009dbd6e8, type: 2} moveSpeedMultiplier: 8 maxTurnSpeed: 100 @@ -510,6 +513,7 @@ MonoBehaviour: maxJumpSpeed: 5 jumpDelta: 0.2 groundState: 2 + moveState: 2 horizontal: 0 vertical: 0 turnSpeed: 0 @@ -584,6 +588,28 @@ MonoBehaviour: showGui: 0 hotKey: 290 passwordFile: remote_statistics.txt +--- !u!114 &7156468669696336682 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2033010110135952297} + m_Enabled: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 995b66880233cda49846f5cda46330ba, type: 3} + m_Name: + m_EditorClassIdentifier: + syncDirection: 0 + syncMode: 0 + syncInterval: 0.1 + NTRCustomSendInterval: {fileID: 0} + NetworkTransformReliable: {fileID: 7264761320023842541} + serverBufferText: {fileID: 3924467337252509263} + clientBufferText: {fileID: 7761066253652736590} + snapIntText: {fileID: 173605869538251097} + serverSnapCount: 0 + clientSnapCount: 0 --- !u!1 &2859268202770656871 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Mirror/Examples/TestNT/Scenes/OfflineWeb.unity b/Assets/Mirror/Examples/TestNT/Scenes/OfflineWeb.unity index c403056bb..40dadc5ae 100644 --- a/Assets/Mirror/Examples/TestNT/Scenes/OfflineWeb.unity +++ b/Assets/Mirror/Examples/TestNT/Scenes/OfflineWeb.unity @@ -285,6 +285,16 @@ MonoBehaviour: autoCreatePlayer: 1 playerSpawnMethod: 0 spawnPrefabs: [] + snapshotSettings: + bufferTimeMultiplier: 2 + catchupNegativeThreshold: -1 + catchupPositiveThreshold: 1 + catchupSpeed: 0.009999999776482582 + slowdownSpeed: 0.009999999776482582 + driftEmaDuration: 1 + dynamicAdjustment: 1 + dynamicAdjustmentTolerance: 1 + deliveryTimeEmaDuration: 2 timeInterpolationGui: 1 playerNinjaPrefab: {fileID: 1428992836745641328, guid: 4b4e4d1a8090c7a45bab0cbc52ccfd76, type: 3} botPrefab: {fileID: 629047657802428152, guid: 45e99b6415bfdc846bbbfc2d949d53f5, type: 3} diff --git a/Assets/Mirror/Examples/TestNT/Scripts/PlayerBuffers.cs b/Assets/Mirror/Examples/TestNT/Scripts/PlayerBuffers.cs index f84d9bdb9..04ddccf3c 100644 --- a/Assets/Mirror/Examples/TestNT/Scripts/PlayerBuffers.cs +++ b/Assets/Mirror/Examples/TestNT/Scripts/PlayerBuffers.cs @@ -9,7 +9,8 @@ public class PlayerBuffers : NetworkBehaviour Transform mainCamTransform; [Header("Components")] - public NTRCustomSendInterval networkTransformReliable; + public NTRCustomSendInterval NTRCustomSendInterval; + public NetworkTransformReliable NetworkTransformReliable; public TextMeshPro serverBufferText; public TextMeshPro clientBufferText; public TextMeshPro snapIntText; @@ -20,7 +21,8 @@ public class PlayerBuffers : NetworkBehaviour private void OnValidate() { - networkTransformReliable = GetComponent(); + NTRCustomSendInterval = GetComponent(); + NetworkTransformReliable = GetComponent(); // Force overrideColorTags true so we can change the color without tags serverBufferText.overrideColorTags = true; @@ -57,7 +59,10 @@ void Update() //serverBufferText.text = "S: " + new string('-', serverSnapCount); /////// Client - clientSnapCount = networkTransformReliable.clientSnapshots.Count; + if (NTRCustomSendInterval) + clientSnapCount = NTRCustomSendInterval.clientSnapshots.Count; + if (NetworkTransformReliable) + clientSnapCount = NetworkTransformReliable.clientSnapshots.Count; if (clientSnapCount < 2) clientBufferText.color = Color.gray;