Skip to content

Commit ea77e1e

Browse files
author
Unity Technologies
committed
com.unity.netcode@1.3.0-pre.4
## [1.3.0-pre.4] - 2024-07-17 ### Added * Optional UUID5GhostType property to the GhostCreation.Config struct, which allows you to provide your own unique UUID5 identifier when creating a ghost prefab at runtime, instead of relying on the auto-generated one (which uses the SHA1 of the ghost name). * NetworkStreamDriver.ResetDriverStore to properly reset the NetworkDriverStore ### Changed * All Simulate component enable states are reset to using a job instead of doing that synchronously on the main thread. Reason for the change is the fact this was inducing a big stall at the end of the Prediction loop. However, the benefits is only visible when there are a large number of jobified workload. * Corrected incorrect/missing CHANGELOG entries across many previous versions. * Updated Burst dependency to version 1.8.16 * Unified Multiplayer Project settings. * Moved menu items to a collective place to improve workflows. This removes the Multiplayer menu and integrates into common places Window, Assets/Create, right-click menus, etc. * The dependency on Unity Transport has been updated to version 2.2.1 * Re-exposed `TryFindAutoConnectEndPoint` and `HasDefaultAddressAndPortSet`, with small documentation updates. * ConcurrentDriverStore and NetworkDriverStore.Concurrent are now public and you can use the NetworkDriverStore.Concurrent in your jobs to send/receive data.
1 parent 508c5b1 commit ea77e1e

24 files changed

+427
-142
lines changed

CHANGELOG.md

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,30 @@ uid: changelog
44

55
# Changelog
66

7+
## [1.3.0-pre.4] - 2024-07-17
8+
9+
### Added
10+
11+
* Optional UUID5GhostType property to the GhostCreation.Config struct, which allows you to provide your own unique UUID5 identifier when creating a ghost prefab at runtime, instead of relying on the auto-generated one (which uses the SHA1 of the ghost name).
12+
* NetworkStreamDriver.ResetDriverStore to properly reset the NetworkDriverStore
13+
14+
### Changed
15+
16+
* All Simulate component enable states are reset to using a job instead of doing that synchronously on the main thread. Reason for the change is the fact this was inducing a big stall at the end of the Prediction loop. However, the benefits is only visible when there are a large number of jobified workload.
17+
* Corrected incorrect/missing CHANGELOG entries across many previous versions.
18+
* Updated Burst dependency to version 1.8.16
19+
* Unified Multiplayer Project settings.
20+
* Moved menu items to a collective place to improve workflows. This removes the Multiplayer menu and integrates into common places Window, Assets/Create, right-click menus, etc.
21+
* The dependency on Unity Transport has been updated to version 2.2.1
22+
* Re-exposed `TryFindAutoConnectEndPoint` and `HasDefaultAddressAndPortSet`, with small documentation updates.
23+
* ConcurrentDriverStore and NetworkDriverStore.Concurrent are now public and you can use the NetworkDriverStore.Concurrent in your jobs to send/receive data.
24+
25+
726
## [1.3.0-exp.1] - 2024-06-11
827

928
### Added
1029

1130
* The Multiplayer PlayMode Tools Window now calls synchronous `Connect` and `Disconnect` methods, and now shows the `Handshake` connection step. Handshake occurs when the client connection has been accepted by the server, but said client is awaiting a `NetworkId` assignment RPC from said server.
12-
* Possibility to optimise the ghost serialization and pre-serialization by registering a custom chunk serialization function pointer that will let users reason on a per-archetype and write the serialization code without requiring virtual methods (function pointer call indirection) and optimised for the use case.
1331
* Further clarifications, minor improvements, and fixes to the PlayMode Tools Window.
1432
* `DefaultRelevancyQuery` to specify general rules for relevancy without specifying it ghost by ghost.
1533
* Tooltips and additional info for the NetCodeConfig, supporting `ClientServerTickRate`, `ClientTickRate`, and `GhostSendSystemData`.
@@ -47,7 +65,6 @@ uid: changelog
4765
* Issue where disconnecting your own client (via a direct `Disconnect` call) would fail to recycle the `NetworkId` component, and fail to dispose of the Entity.
4866
* We now also correctly report and clean-up stale connections. I.e. Connections that are entered into invalid states by user-code.
4967
* Issue where the `CommandSendSystem` was attempting to send RPCs with stale connections.
50-
* some slow path in the normal ghost serialization that was causing many re-serialization of the same chunk, in case the chunk data was not fitting inside the temporary stream buffer. That was almost the norm in many cases, when the serialised entities are large enough (either because of the number of components or because of the size of them).
5168
* NetworkStreamConnection now holds an accurate connection state right after the call to driver's Connect, instead of having to wait a frame to get it updated.
5269
* Minor documentation issues.
5370
* InvalidOperationException: cases where EntityManager is part of an exclusive transaction we skip gathering analytics for its world.
@@ -115,6 +132,8 @@ uid: changelog
115132
* BatchScaleImportanceDelegate, a new version of the importance scaling function that work in batches. It is not required to set both the ScaleImportance and the BatchScaleImportance function pointers. If the BatchScaleImportance is set, it is the preferred.
116133
* TempStreamInitialSize, a new parameter in the GhostSendSystemData for tuning the initial size of the temporary buffer used by server to serialise ghosts. By default now the size is 8KB.
117134
* AlwaysRelevantQuery to specify general rules for relevancy without specifying it ghost by ghost.
135+
* Added support for `NetCodeConnectionEvents` (accessed via singleton `NetworkStreamDriver`, `ConnectionEventsForFrame` property), allowing users an alternative to the `ConnectionState` component for tracking client connection and disconnection events.
136+
* When single-stepping the Unity Editor, you'll see `NetCodeConnectionEvent`s in our Multiplayer PlayMode Tools Window.
118137

119138
### Changed
120139

@@ -158,7 +177,7 @@ uid: changelog
158177
* QoL issue where `GhostAuthoringInspectionComponent` was not always modifiable in areas of the Editor where it is valid to modify them.
159178
* Issue where `GhostAuthoringComponent` was disallowed in nested prefab setups (where the root prefab is NOT a ghost).
160179
* Log verbiage when creating a driver in DefaultDriverConstructor read like a 'call to action'. It's not.
161-
180+
* Internal driver clobbering error when calling `NetworkDriverStore.Disconnect` leading to rare exceptions in esoteric situations.
162181

163182
## [1.2.0-exp.3] - 2023-11-09
164183

@@ -174,7 +193,6 @@ uid: changelog
174193
* mostly for maintenance, code-generation for the component and buffer serialiser, using helper methods living all inside the package. No user visible changes
175194
* Updated Transport dependency to version 2.1.0.
176195
* The minimum supported editor version is now 2022.3.11f1
177-
* all Simulate component enable states are reset to using a job instead of doing that synchronously on the main thread. Reason for the change is the fact this was inducing a big stall at the end of the Prediction loop. However, the benefits is only visible when there are a large number of jobified workload.
178196
* components, command, buffers and rpc are now replicated also if they are private or internal
179197

180198
### Removed
@@ -193,6 +211,8 @@ uid: changelog
193211
* `IndexOutOfRangeException` in the `GhostCollectionSystem` when ghost hash mismatches are present (a common error during dev).
194212
* An issue accessing the m_PredictionSwitchingSmoothingLookup buffer when multiple ghosts change their owner and they need to switch prediction mode.
195213
* GhostPrefabCreation.ConvertToGhostPrefab api that incorrectly replicated and assign to child entity components the root entity variant.
214+
* Possibility to optimise the ghost serialization and pre-serialization by registering a custom chunk serialization function pointer that will let users reason on a per-archetype and write the serialization code without requiring virtual methods (function pointer call indirection) and optimised for the use case.
215+
* some slow path in the normal ghost serialization that was causing many re-serialization of the same chunk, in case the chunk data was not fitting inside the temporary stream buffer. That was almost the norm in many cases, when the serialised entities are large enough (either because of the number of components or because of the size of them).
196216

197217

198218
## [1.1.0-pre.3] - 2023-10-17
@@ -468,11 +488,6 @@ MetricsMonitorComponent: MetricsMonitor,
468488
* It is not necessary anymore to define a custom `DefaultGhostVariant` system if a `LocalTransform` (`Rotation` or `Position` for V1) or `PhysicsVelocity` variants are added to project (since a `default` selection is already provided by the package).
469489
* Updated `com.unity.transport` dependency to 2.0.0-pre.2
470490

471-
472-
### Deprecated
473-
474-
* `ProjectSettings / NetCodeClientTarget` was not actually saved to the ProjectSettings. Instead, it was saved to `EditorPrefs`, breaking build determinism across machines. Now that this has been fixed, your EditorPref has been clobbered, and `ClientSettings.NetCodeClientTarget` has been deprecated (in favour of `NetCodeClientSettings.instance.ClientTarget`).
475-
476491
### Removed
477492

478493
* Removing dependencies on `com.unity.jobs` package.
@@ -497,18 +512,8 @@ MetricsMonitorComponent: MetricsMonitor,
497512
* Removed CSS warning in package.
498513
* A problem with baking and additional ghost entities that was removing `LocalTransform`, `WorldTransform` and `LocalToWorld` matrix.
499514
* Mismatched ClientServerTickRate.SimulationTickRate and PredictedFixedStepSimulationSystemGroup.RateManager.Timestep will throw an error and will set the values to match each other.
500-
* An issue with pre-spawned ghost baking when the baked entity has not LocalTransform (position/rotation for transform v1) component.
501-
* "Ghost Distance Importance Scaling" is now working again. Ensure you read the updated documentation.
502-
* Missing field write in `NetworkStreamListenSystem.OnCreate`, fixing Relay servers.
503-
* Code-Generated Burst-compiled Serializer methods will now only compile inside worlds with `WorldFlag.GameClient` and `WorldFlag.GameServer` WorldFlags. This improves exit play-mode speeds (when Domain Reload is enabled), baking (in all cases), and recompilation speeds.
504-
* Fixed an issue where multiple ghost types with the same archetype but difference data could sometime trigger errors about ghosts changing type.
505515
* Improvements to the `GhostAuthoringInspectionComponent`, including removing the freeze when a baker creates lots of "Additional" entities, better display of Inputs, and fixed bug where the EntityGuid was not being saved (so modifying additional Entities is now supported). We now also detect (but don't destroy) broken ComponentOverrides, making it easier to switch from TRANSFORMS_V1 (for example).
506-
* Fix a mistake where the relay sample will create a client driver rather than a server driver
507-
* Fix logic for relay set up on the client. Making sure when calling DefaultDriverConstructor.RegisterClientDriver with relay settings that we skip this unless, requested playtype is client or clientandserver (if no server is found), the simulator is enabled, or on a client only build.
508-
* Fixed `ArgumentException: ArchetypeChunk.GetDynamicComponentDataArrayReinterpret<System.Byte> cannot be called on zero-sized IComponentData` in `GhostPredictionHistorySystem.PredictionBackupJob`. Added comprehensive test coverage for the `GhostPredictionHistorySystem` (via adding a predicted ghost version of the `GhostSerializationTestsForEnableableBits` tests).
509516
* Fixed serialization of components on child entities in the case where `SentForChildEntities = true`. This fix may introduce a small performance regression in baking and netcode world initialization.
510-
* `GhostUpdateSystem` now supports Change Filtering, so components on the client will now only be marked as changed _when they actually are changed_. We strongly recommend implementing change filtering when reading components containing `[GhostField]`s and `[GhostEnabledBit]`s on the client.
511-
* Fixed input component codegen issue when the type is nested in a parent class
512517
* Exposed NetworkTick value to Entity Inspector.
513518
* Fixed code-gen error where `ICommandData.Tick` was not being replicated.
514519
* Fixed code-gen GhostField error handling when dealing with properties on Buffers, Commands, and Components.
@@ -534,7 +539,6 @@ MetricsMonitorComponent: MetricsMonitor,
534539
* added some sanity check to prevent updating invalid ghosts
535540
* Added a new method, `GhostPrefabCreation.ConvertToGhostPrefab` which can be used to create ghost prefabs from code without having an asset for them.
536541
* Added a support for creating multiple network drivers. It is now possible to have a server that listen to the same port using different network interfaces (ex: IPC, Socket, WebSocket at the same time).
537-
* Hybrid assemblies will not be included in DOTS Runtime builds.
538542
* code generation documentation
539543
* RegisterPredictedPhysicsRuntimeSystemReadWrite and RegisterPredictedPhysicsRuntimeSystemReadOnly extension methods, for tracking dependencies when using predicted networked physics systems.
540544
* Support for runtime editing the number of ThinClients.

Documentation~/entities-list.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ This singleton is a special kind of ghost without a prefab asset.
211211
### GhostStats
212212
| Component | Description |
213213
|-----------------------------------------|---------------------------------------------------------------------|
214-
| __GhostStats__ | State if the NetDbg tools is connected or not. |
214+
| __GhostStats__ | State if the Network Debugger tools is connected or not. |
215215
| __GhostStatsCollectionCommand__ | Internal stats data for commands. |
216216
| __GhostStatsCollectionSnapshot__ | Internal stats data used to track sent/received snapshot data. |
217217
| __GhostStatsCollectionPredictionError__ | Record the prediction stats for various ghost/component types pair. |

Documentation~/ghost-snapshots.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,11 +405,11 @@ to be added to all ghost types, sent for all ghost types, and serialized using t
405405

406406
## Snapshot visualization tool
407407

408-
To understand what is being put on the wire in the Netcode, you can use the snapshot visualization tool, __NetDbg__ tool.
408+
To understand what is being put on the wire in the Netcode, you can use the snapshot visualization tool, __Network Debugger__ tool.
409409

410410
<img src="images/snapshot-debugger.png" width="1000" alt="net debug tool">
411411

412-
To open the tool, go to menu: __Multiplayer &gt; Open NetDbg__, and the tool opens in a browser window. It displays a vertical bar for each received snapshot, with a breakdown of the snapshot’s ghost types, size etc.
412+
To open the tool, go to menu: __Window &gt; Multiplayer &gt; Network Debugger__, and the tool opens in a browser window. It displays a vertical bar for each received snapshot, with a breakdown of the snapshot’s ghost types, size etc.
413413

414414
To see more detailed information about the snapshot, click on one of the bars.
415415

Documentation~/metrics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Metrics
22

3-
There are 2 ways of gathering metrics about the netcode simulation. The simplest and most straight forward way is to use the NetDbg from the Multiplayer Menu in the Editor. This will provide you with a simple web interface to view the metrics.
3+
There are 2 ways of gathering metrics about the netcode simulation. The simplest and most straight forward way is to use the Network Debugger from the Multiplayer Menu in the Editor. This will provide you with a simple web interface to view the metrics.
44

55
The second way is to create a Singleton of type [MetricsMonitorComponent](https://docs.unity3d.com/Packages/com.unity.netcode@latest/index.html?subfolder=/api/Unity.NetCode.MetricsMonitor.html)
66
and populate it with the data points you want to monitor.

Documentation~/time-synchronization.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ The tick the client estimates the server will apply the commands on is called th
1919
For interpolated objects, the client should present them in a state it has received data for. This time is called **interpolation tick**. The `interpolation tick` is calculated as an offset in respect the `predicted tick`.
2020
That time offset is called **prediction delay**. <br/>
2121
The `interpolation delay` is calculated by taking into account round trip time, jitter and packet arrival rate, all data that is generally available on the client.
22-
We also add some additional time, based on the network tick rate, to make sure we can handle some packets being lost. You can visualize the time offsets and scales in the snapshot visualization tool, [NetDbg](ghost-snapshots#Snapshot-visualization-tool).
22+
We also add some additional time, based on the network tick rate, to make sure we can handle some packets being lost. You can visualize the time offsets and scales in the snapshot visualization tool, [Network Debugger](ghost-snapshots#Snapshot-visualization-tool).
2323

2424
The `NetworkTimeSystem` slowly adjusts both `prediction tick` and `interpolation delay` in small increments to keep them advancing at a smooth rate and ensure that neither the
2525
interpolation tick nor the prediction tick goes back in time.

Editor/CodeGenMenu.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
using UnityEditor;
22
using UnityEngine;
3-
using UnityEditorInternal;
43

54
namespace Unity.NetCode.Editor
65
{
76
class CodeGenMenu
87
{
9-
[MenuItem("Multiplayer/Force Code Generation", priority = 10)]
10-
static private void ForceRunCodeGen()
8+
[MenuItem("Assets/Multiplayer/Force Code Generation", priority = 1000)]
9+
private static void ForceRunCodeGen()
1110
{
1211
EditorApplication.delayCall += () =>
1312
{
@@ -29,8 +28,8 @@ static private void ForceRunCodeGen()
2928
};
3029
}
3130

32-
[MenuItem("Multiplayer/Open Source Generated Folder", priority = 12)]
33-
static private void OpenSourceGeneratedFolder()
31+
[MenuItem("Assets/Multiplayer/Open Source Generated Folder", priority = 1000)]
32+
private static void OpenSourceGeneratedFolder()
3433
{
3534
if (!System.IO.File.Exists("Temp/NetCodeGenerated"))
3635
{

Editor/MultiplayerPlayModeWindow.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ internal class MultiplayerPlayModeWindow : EditorWindow, IHasCustomMenu
141141
static GUILayoutOption s_RightButtonWidth = GUILayout.Width(120);
142142
private int m_PreviousFrameCount;
143143

144-
[MenuItem("Multiplayer/Window: PlayMode Tools", priority = 50)]
144+
[MenuItem("Window/Multiplayer/PlayMode Tools", priority = 3007)]
145145
private static void ShowWindow()
146146
{
147147
GetWindow<MultiplayerPlayModeWindow>(false, k_Title, true);
@@ -227,7 +227,7 @@ void PlayModeUpdate()
227227
}
228228
}
229229

230-
[MenuItem("Multiplayer/Toggle Lag Spike Simulation _F12", priority = 51)]
230+
[MenuItem("Window/Multiplayer/Toggle Lag Spike Simulation _F12", priority = 3007)]
231231
static void ToggleLagSpikeSimulatorShortcut()
232232
{
233233
if (ClientServerBootstrap.ClientWorld != null)

Editor/NetcodeConfigEditor.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System;
22
using System.Collections.Generic;
3-
using System.Diagnostics;
43
using System.Linq;
54
using Unity.Collections;
65
using Unity.NetCode.Hybrid;
@@ -39,7 +38,6 @@ private static NetCodeConfig SavedConfig
3938
}
4039
}
4140

42-
[MenuItem("Multiplayer/Create NetcodeConfig Asset", priority = 100)]
4341
internal static void CreateNetcodeSettingsAsset()
4442
{
4543
var assetPath = AssetDatabase.GenerateUniqueAssetPath("Assets/NetcodeConfig.asset");
@@ -84,10 +82,10 @@ public static SettingsProvider CreateNetcodeConfigSettingsProvider()
8482
{
8583
// First parameter is the path in the Settings window.
8684
// Second parameter is the scope of this setting: it only appears in the Project Settings window.
87-
var provider = new SettingsProvider("Project/NetCodeConfig.asset", SettingsScope.Project)
85+
var provider = new SettingsProvider("Project/Multiplayer", SettingsScope.Project)
8886
{
8987
// By default the last token of the path is used as display name if no label is provided.
90-
label = "NetCode for Entities",
88+
label = "Multiplayer",
9189
// Create the SettingsProvider and initialize its drawing (IMGUI) function in place:
9290
guiHandler = (searchContext) =>
9391
{

Editor/SourceGeneratorSettings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ static class SourceGeneratorSettings
1111
/// Create the Default.globalconfig file in the Assets folder root.
1212
/// </summary>
1313
/// <returns></returns>
14-
[MenuItem("Multiplayer/Create SourceGenerator AnalyzerConfig", priority = 101)]
14+
[MenuItem("Assets/Create/Multiplayer/SourceGenerator AnalyzerConfig", priority = 1)]
1515
static void CreateGlobalConfig()
1616
{
1717
var assetPath = Path.Combine(Application.dataPath, "Default.globalconfig");

Runtime/Authoring/Hybrid/NetCodeServerSettings.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ internal class ServerSettings : DotsPlayerSettingsProvider
123123
{
124124
VisualElement m_BuildSettingsContainer;
125125

126+
public override string ProviderPath => "Project/Multiplayer/Build";
127+
126128
public override int Importance
127129
{
128130
get { return 1; }
@@ -140,6 +142,8 @@ protected override IEntitiesPlayerSettings DoGetSettingAsset()
140142

141143
public override void OnActivate(DotsGlobalSettings.PlayerType type, VisualElement rootElement)
142144
{
145+
DotsGlobalSettings.Instance.ServerProvider.ProviderPath = "Project/Multiplayer/Build";
146+
143147
rootElement.RegisterCallback<AttachToPanelEvent>(OnAttachToPanel);
144148
rootElement.RegisterCallback<DetachFromPanelEvent>(OnDetachFromPanel);
145149

0 commit comments

Comments
 (0)