Skip to content

Commit 3f59dff

Browse files
fluong6NoelStephensUnityDSchroer
authored
chore: NGO 2.0.0-exp.4 merge back to develop NGO 2.0.0 (#2940)
* chore: distributed authority UI displays dependent upon multiplayer SDK package (#2875) * update Renaming Session Mode to Network Topology. This includes any related properties or XML API documentation references. Adding package dependent conditional define MULTIPLAYER_SDK_INSTALLED that is defined when the com.unity.services.multiplayer package is installed to the editor assembly definition file. This removes the custom property drawer since it appears the default enum flag drawer visual bug is resolved in Unity 6. incrementing the version change * feat: expose the UTP connect (#2935) * feat: expose the UTP connect payload * pass accept payload * fix formatting * make Connect and m_Driver protected * remove payload output * chore: Merge develop 2.0.0 into exp.3 (#2933) * feat: enum ordered message versioning (#2929) * chore: migrate tests from public to internal (#2930) * update Added the MessageTypeDefines ordering class that orders messages based on the NetworkMessageType. Use tick offset. Change the ticks ago based on whether DAHost or CMBService. Changing all test public api to internal Adding FixedJoint attach and detach methods to NetworkRigidbodyBase. * test Fixing issue with tests using their own message provider. Fixing a few more tests that don't need the message ordering or count verification stuff to be running. Removed the message ordering related tests since this it was no longer needed. --------- Co-authored-by: Noel Stephens <noel.stephens@unity3d.com> * update Migrated non-authority NetworkTransform updates to the pre late update to more align with how it is handled in v1.x. Added NetworkRigidbodyBase reference to NetworkObject. For now, added the ability to add a fixed joint when parenting two NetworkObjects with NetworkTransforms and NetworkRigidbodies that both have UseRigidBodyForMotion set to true (i.e. Rigidbody has no concept of "local space" motion). * update Change the FixedJoint approach so it does not require parenting. The "parent" rigid body now updates its children in NetworkTransform when the "parent's" state is updated in order to keep both parent and children state updates synchronized on the same network tick. Added NetworkObject.CurrentParent that is set when a NetworkObject is parented. NetworkObject.NetworkTransform is now NetworkObject.NetworkTransforms (a single NetworkObject can have many NetworkTransforms). NetworkObject.NetworkRigidbodybase is now NetworkObject.NetworkRigidbodies (a single NetworkObject can have many NetworkRigidbodybase components). * fix Adding COM_UNITY_MODULES_PHYSICS wrappers around NetworkObject.NetworkRigidbodies. * fix wrapping some physics dependent properties in #if COM_UNITY_MODULES_PHYSICS. * fix Last missed NetworkRigidbodies needed wrapping in #if COM_UNITY_MODULES_PHYSICS * fix Only invoke DetachFromFixedJoint if HasAuthority is true during despawn. * fix Fixing issue where NetworkTransforms updated during FixedUpdate can have a render time that is slightly earlier than the start time. The delta between the two is typically in the nano to pico seconds range. This first pass approach to resolve this issue is to just cast the two double properties to floats prior to subtracting one from the other in order to reduce that level of granularity of the delta between the two. --------- Co-authored-by: Frank Luong <100299641+fluong6@users.noreply.github.com> * chore: add NGO 2.0.0-exp.3 version and date to changelog (#2937) adding release version and date to changelog * removing "unreleased" tag * chore: update changelog in ngo 2.0.0 exp.4 (#2939) * updating changelog * bumping ngo version in package json * adding unreleased section back --------- Co-authored-by: Noel Stephens <noel.stephens@unity3d.com> Co-authored-by: Dominick <dominick@schroer.ca>
1 parent 0060d33 commit 3f59dff

41 files changed

Lines changed: 544 additions & 150 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

com.unity.netcode.gameobjects/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,18 @@ Additional documentation and release notes are available at [Multiplayer Documen
88

99
## [Unreleased]
1010

11+
## [2.0.0-exp.4] - 2024-05-31
12+
1113
### Added
1214

15+
- Added `NetworkRigidbodyBase.AttachToFixedJoint` and `NetworkRigidbodyBase.DetachFromFixedJoint` to replace parenting for rigid bodies that have `NetworkRigidbodyBase.UseRigidBodyForMotion` enabled. (#2933)
1316
- Added `NetworkBehaviour.OnNetworkPreSpawn` and `NetworkBehaviour.OnNetworkPostSpawn` methods that provide the ability to handle pre and post spawning actions during the `NetworkObject` spawn sequence. (#2912)
1417
- Added a client-side only `NetworkBehaviour.OnNetworkSessionSynchronized` convenience method that is invoked on all `NetworkBehaviour`s after a newly joined client has finished synchronizing with the network session in progress. (#2912)
1518
- Added `NetworkBehaviour.OnInSceneObjectsSpawned` convenience method that is invoked when all in-scene `NetworkObject`s have been spawned after a scene has been loaded or upon a host or server starting. (#2912)
1619

1720
### Fixed
1821

22+
- Fixed issue where non-authoritative rigid bodies with `NetworkRigidbodyBase.UseRigidBodyForMotion` enabled would constantly log errors about the renderTime being before `StartTimeConsumed`. (#2933)
1923
- Fixed issue where in-scene placed NetworkObjects could be destroyed if a client disconnects early and/or before approval. (#2924)
2024
- Fixed issue where a `NetworkObject` component's associated `NetworkBehaviour` components would not be detected if scene loading is disabled in the editor and the currently loaded scene has in-scene placed `NetworkObject`s. (#2912)
2125
- Fixed issue where an in-scene placed `NetworkObject` with `NetworkTransform` that is also parented under a `GameObject` would not properly synchronize when the parent `GameObject` had a world space position other than 0,0,0. (#2898)
@@ -24,6 +28,9 @@ Additional documentation and release notes are available at [Multiplayer Documen
2428

2529
- Change all the access modifiers of test class from Public to Internal (#2930)
2630
- Changed messages are now sorted by enum values as opposed to ordinally sorting the messages by their type name. (#2929)
31+
- Changed `NetworkClient.SessionModeTypes` to `NetworkClient.NetworkTopologyTypes`. (#2875)
32+
- Changed `NetworkClient.SessionModeType` to `NetworkClient.NetworkTopologyType`. (#2875)
33+
- Changed `NetworkConfig.SessionMode` to `NeworkConfig.NetworkTopology`. (#2875)
2734

2835
## [2.0.0-exp.2] - 2024-04-02
2936

com.unity.netcode.gameobjects/Editor/NetworkManagerEditor.cs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ public class NetworkManagerEditor : UnityEditor.Editor
3030
private SerializedProperty m_ProtocolVersionProperty;
3131
private SerializedProperty m_NetworkTransportProperty;
3232
private SerializedProperty m_TickRateProperty;
33-
private SerializedProperty m_SessionModeProperty;
33+
#if MULTIPLAYER_SDK_INSTALLED
34+
private SerializedProperty m_NetworkTopologyProperty;
35+
#endif
3436
private SerializedProperty m_ClientConnectionBufferTimeoutProperty;
3537
private SerializedProperty m_ConnectionApprovalProperty;
3638
private SerializedProperty m_EnsureNetworkVariableLengthSafetyProperty;
@@ -100,7 +102,9 @@ private void Initialize()
100102
m_ProtocolVersionProperty = m_NetworkConfigProperty.FindPropertyRelative("ProtocolVersion");
101103
m_NetworkTransportProperty = m_NetworkConfigProperty.FindPropertyRelative("NetworkTransport");
102104
m_TickRateProperty = m_NetworkConfigProperty.FindPropertyRelative("TickRate");
103-
m_SessionModeProperty = m_NetworkConfigProperty.FindPropertyRelative("SessionMode");
105+
#if MULTIPLAYER_SDK_INSTALLED
106+
m_NetworkTopologyProperty = m_NetworkConfigProperty.FindPropertyRelative("NetworkTopology");
107+
#endif
104108
m_ClientConnectionBufferTimeoutProperty = m_NetworkConfigProperty.FindPropertyRelative("ClientConnectionBufferTimeout");
105109
m_ConnectionApprovalProperty = m_NetworkConfigProperty.FindPropertyRelative("ConnectionApproval");
106110
m_EnsureNetworkVariableLengthSafetyProperty = m_NetworkConfigProperty.FindPropertyRelative("EnsureNetworkVariableLengthSafety");
@@ -138,7 +142,9 @@ private void CheckNullProperties()
138142
m_ProtocolVersionProperty = m_NetworkConfigProperty.FindPropertyRelative("ProtocolVersion");
139143
m_NetworkTransportProperty = m_NetworkConfigProperty.FindPropertyRelative("NetworkTransport");
140144
m_TickRateProperty = m_NetworkConfigProperty.FindPropertyRelative("TickRate");
141-
m_SessionModeProperty = m_NetworkConfigProperty.FindPropertyRelative("SessionMode");
145+
#if MULTIPLAYER_SDK_INSTALLED
146+
m_NetworkTopologyProperty = m_NetworkConfigProperty.FindPropertyRelative("NetworkTopology");
147+
#endif
142148
m_ClientConnectionBufferTimeoutProperty = m_NetworkConfigProperty.FindPropertyRelative("ClientConnectionBufferTimeout");
143149
m_ConnectionApprovalProperty = m_NetworkConfigProperty.FindPropertyRelative("ConnectionApproval");
144150
m_EnsureNetworkVariableLengthSafetyProperty = m_NetworkConfigProperty.FindPropertyRelative("EnsureNetworkVariableLengthSafety");
@@ -177,9 +183,12 @@ public override void OnInspectorGUI()
177183
serializedObject.Update();
178184
EditorGUILayout.PropertyField(m_RunInBackgroundProperty);
179185
EditorGUILayout.PropertyField(m_LogLevelProperty);
180-
EditorGUILayout.PropertyField(m_SessionModeProperty);
186+
181187
EditorGUILayout.Space();
182188
EditorGUILayout.LabelField("Network Settings", EditorStyles.boldLabel);
189+
#if MULTIPLAYER_SDK_INSTALLED
190+
EditorGUILayout.PropertyField(m_NetworkTopologyProperty);
191+
#endif
183192
EditorGUILayout.PropertyField(m_ProtocolVersionProperty);
184193
EditorGUILayout.PropertyField(m_NetworkTransportProperty);
185194
if (m_NetworkTransportProperty.objectReferenceValue == null)

com.unity.netcode.gameobjects/Editor/NetworkObjectEditor.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
using System.Collections.Generic;
2+
#if MULTIPLAYER_SDK_INSTALLED
23
using System.Linq;
4+
#endif
35
using UnityEditor;
46
using UnityEngine;
57

@@ -144,7 +146,9 @@ private void OnDestroy()
144146
}
145147
}
146148

147-
149+
// Keeping this here just in case, but it appears that in Unity 6 the visual bugs with
150+
// enum flags is resolved
151+
#if BYPASS_DEFAULT_ENUM_DRAWER && MULTIPLAYER_SDK_INSTALLED
148152
[CustomPropertyDrawer(typeof(NetworkObject.OwnershipStatus))]
149153
public class NetworkObjectOwnership : PropertyDrawer
150154
{
@@ -188,4 +192,5 @@ public override void OnGUI(Rect position, SerializedProperty property, GUIConten
188192
EditorGUI.EndProperty();
189193
}
190194
}
195+
#endif
191196
}

com.unity.netcode.gameobjects/Editor/com.unity.netcode.editor.asmdef

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@
5353
"name": "com.unity.transport",
5454
"expression": "2.0",
5555
"define": "UTP_TRANSPORT_2_0_ABOVE"
56+
},
57+
{
58+
"name": "com.unity.services.multiplayer",
59+
"expression": "0.2.0",
60+
"define": "MULTIPLAYER_SDK_INSTALLED"
5661
}
5762
],
5863
"noEngineReferences": false

com.unity.netcode.gameobjects/Runtime/Components/Interpolator/BufferedLinearInterpolator.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,9 @@ public T Update(float deltaTime, double renderTime, double serverTime)
195195
double range = m_EndTimeConsumed - m_StartTimeConsumed;
196196
if (range > k_SmallValue)
197197
{
198-
t = (float)((renderTime - m_StartTimeConsumed) / range);
198+
var rangeFactor = 1.0f / (float)range;
199+
200+
t = ((float)renderTime - (float)m_StartTimeConsumed) * rangeFactor;
199201

200202
if (t < 0.0f)
201203
{

0 commit comments

Comments
 (0)