Skip to content

Commit 55e467f

Browse files
author
Unity Technologies
committed
com.unity.netcode@1.3.2
## [1.3.2] - 2024-09-06 ### Changed * Updated entities packages dependencies ### Added * Significantly reduced bandwidth consumption of command packets (i.e. input packets), by a) converting the first command payload in each packet to use delta-compression against zero, b) by making the number of commands sent (per-packet) tied to the `TargetCommandSlack`, c) by delta-compressing the NetworkTicks using the assumed previous tick (which is a correct assumption in the common case), and d) by using a single `changeBit` if the previous command is exactly the same. * `ClientTickRate.NumAdditionalCommandsToSend` is a new field allowing you to configure how many additional commands to send to the server in each command (i.e. input) packet. * Support for dumping input commands into the `NetDebugPacket` dump, helping users visualize and diagnose bandwidth consumption. Implement the optional, burst-compatible method `ToFixedString` on your input components to see field data in your packet dumps, too. * A `NetworkSnapshotAck.CommandArrivalStatistics` struct, documenting (on the server, for each client) how many commands arrive, and how many commands arrive too late. These statistics can be used to inform and tweak `TargetCommandSlack` and `NumAdditionalCommandsToSend`. * Significantly expanded our automated test coverage for Lag Compensation. We now detect off-by-one-tick errors between the client and server's lag compensation resolutions. * `LagCompensationConfig.DeepCopyDynamicColliders` (defaulting to true) and `LagCompensationConfig.DeepCopyStaticColliders` (defaulting to false) configuration values, enabling you to control whether or not colliders are deep copied during world cloning, preventing runtime exceptions when querying historic worlds during Lag Compensation. Also see the specialized `PhysicsWorldHistorySingleton.DeepCopyRigidBodyCollidersWhitelist` collection. ### Changed * `PhysicsWorldHistory` now clones collision worlds *after* the `BuildPhysicsWorld` step for the given `ServerTick`. This fixes an issue where the `CollisionWorld` returned by `GetCollisionWorldFromTick` is off-by-one on the server. It is now easier to reason about, as the data stored for `ServerTick` T now actually corresponds to the `BuildPhysicsWorld` operation that occurred on tick T (rather than T-1, which was the previous behaviour). We strongly recommend having automated testing for lag compensation accuracy, as this may introduce a regression, and is therefore a minor breaking change. * `PhysicsWorldHistory` now deep copies dynamic colliders by default (see fix entry). Performance impact should be negligible. ### Fixed * Corrected `seealso` usage in XML package documentation. * Documentation improvements and clarifications on the following pages: command stream, ghost snapshots, spawning ghosts, logging, network connection, networked cube, prediction, and RPCs. * Lag Compensation issue in the case where an Entity - hit by a query against a historic lag compensation `CollisionWorld` fetched via `GetCollisionWorldFromTick` - has since been deleted. The colliders of dynamic ghosts are now deep cloned by default, preventing the blob asset assertions which would have otherwise been encountered here. You can also opt-into copying static colliders via the `LagCompensationConfig` or `NetCodePhysicsConfig` authoring (although the recommendation is to instead query twice; once against static geometry exclusively, using the latest collision world, then again using the hit position of the static query, against lag compensated dynamic entities). * Issue where non-power-of-2 History Buffer sizes would return incorrect entries when `ServerTick` wraps around. * an issue with iOS and WebGL AOT, causing the player throwing exceptions while trying to initialize the Netcode generated ghost serializer function pointers. The issue is present when using Burst 1.8 and Unity 6.0+ * an issue with GhostGroup serialization, incorrectly accessing the wrong ghost prefab type in the GhostCollectionPrefab array. * an issue with buffer serialization when using GhostGroup, causing memory stomping at runtime (and exception thrown in the editor), due to the fact the required size for storing the buffer in the snapshot was calculated incorrectly. The root cause was the incorrect index used to access the GhostCollectionPrefab collection.
1 parent ea77e1e commit 55e467f

File tree

138 files changed

+4404
-2366
lines changed

Some content is hidden

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

138 files changed

+4404
-2366
lines changed

CHANGELOG.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,37 @@ uid: changelog
44

55
# Changelog
66

7+
8+
## [1.3.2] - 2024-09-06
9+
10+
### Changed
11+
* Updated entities packages dependencies
12+
13+
### Added
14+
15+
* Significantly reduced bandwidth consumption of command packets (i.e. input packets), by a) converting the first command payload in each packet to use delta-compression against zero, b) by making the number of commands sent (per-packet) tied to the `TargetCommandSlack`, c) by delta-compressing the NetworkTicks using the assumed previous tick (which is a correct assumption in the common case), and d) by using a single `changeBit` if the previous command is exactly the same.
16+
* `ClientTickRate.NumAdditionalCommandsToSend` is a new field allowing you to configure how many additional commands to send to the server in each command (i.e. input) packet.
17+
* Support for dumping input commands into the `NetDebugPacket` dump, helping users visualize and diagnose bandwidth consumption. Implement the optional, burst-compatible method `ToFixedString` on your input components to see field data in your packet dumps, too.
18+
* A `NetworkSnapshotAck.CommandArrivalStatistics` struct, documenting (on the server, for each client) how many commands arrive, and how many commands arrive too late. These statistics can be used to inform and tweak `TargetCommandSlack` and `NumAdditionalCommandsToSend`.
19+
* Significantly expanded our automated test coverage for Lag Compensation. We now detect off-by-one-tick errors between the client and server's lag compensation resolutions.
20+
* `LagCompensationConfig.DeepCopyDynamicColliders` (defaulting to true) and `LagCompensationConfig.DeepCopyStaticColliders` (defaulting to false) configuration values, enabling you to control whether or not colliders are deep copied during world cloning, preventing runtime exceptions when querying historic worlds during Lag Compensation. Also see the specialized `PhysicsWorldHistorySingleton.DeepCopyRigidBodyCollidersWhitelist` collection.
21+
22+
### Changed
23+
24+
* `PhysicsWorldHistory` now clones collision worlds *after* the `BuildPhysicsWorld` step for the given `ServerTick`. This fixes an issue where the `CollisionWorld` returned by `GetCollisionWorldFromTick` is off-by-one on the server. It is now easier to reason about, as the data stored for `ServerTick` T now actually corresponds to the `BuildPhysicsWorld` operation that occurred on tick T (rather than T-1, which was the previous behaviour). We strongly recommend having automated testing for lag compensation accuracy, as this may introduce a regression, and is therefore a minor breaking change.
25+
* `PhysicsWorldHistory` now deep copies dynamic colliders by default (see fix entry). Performance impact should be negligible.
26+
27+
### Fixed
28+
29+
* Corrected `seealso` usage in XML package documentation.
30+
* Documentation improvements and clarifications on the following pages: command stream, ghost snapshots, spawning ghosts, logging, network connection, networked cube, prediction, and RPCs.
31+
* Lag Compensation issue in the case where an Entity - hit by a query against a historic lag compensation `CollisionWorld` fetched via `GetCollisionWorldFromTick` - has since been deleted. The colliders of dynamic ghosts are now deep cloned by default, preventing the blob asset assertions which would have otherwise been encountered here. You can also opt-into copying static colliders via the `LagCompensationConfig` or `NetCodePhysicsConfig` authoring (although the recommendation is to instead query twice; once against static geometry exclusively, using the latest collision world, then again using the hit position of the static query, against lag compensated dynamic entities).
32+
* Issue where non-power-of-2 History Buffer sizes would return incorrect entries when `ServerTick` wraps around.
33+
* an issue with iOS and WebGL AOT, causing the player throwing exceptions while trying to initialize the Netcode generated ghost serializer function pointers. The issue is present when using Burst 1.8 and Unity 6.0+
34+
* an issue with GhostGroup serialization, incorrectly accessing the wrong ghost prefab type in the GhostCollectionPrefab array.
35+
* an issue with buffer serialization when using GhostGroup, causing memory stomping at runtime (and exception thrown in the editor), due to the fact the required size for storing the buffer in the snapshot was calculated incorrectly. The root cause was the incorrect index used to access the GhostCollectionPrefab collection.
36+
37+
738
## [1.3.0-pre.4] - 2024-07-17
839

940
### Added
@@ -41,6 +72,7 @@ uid: changelog
4172
* Exposed `NetworkStreamDriver.DriverStore` and `LastEndPoint`.
4273
* Copy-free accessors for `NetworkStreamDriver` instances (via `GetDriverInstanceRW` and `GetDriverInstanceRO`) and underlying drivers (via `GetDriverRW` and `GetDriverRO`), which are also now used internally. The struct copy originals have been weakly deprecated.
4374
* Support for serializing non-byte-aligned RPCs. I.e. You can now delta-compress RPC fields using the `IRpcCommandSerializer` by delta-compressing against hardcoded baseline values.
75+
* Added a way to detect if a server world will execute a tick or not through NetcodeServerRateManager.WillUpdate. This can be used to execute expensive operations when in BusyWait mode in off frames. See the Optimizations doc page https://docs.unity3d.com/Packages/com.unity.netcode@latest/index.html?subfolder=/manual/optimizations.html
4476

4577
### Changed
4678

@@ -104,6 +136,12 @@ uid: changelog
104136
* Removed the hardcoded 'Protocol Version' RPC logic, simplifying RPC sending and receiving. Netcode's handshake RPCs now use the existing `IApprovalRpcCommand` flows.
105137

106138

139+
## [1.2.4] - 2024-08-14
140+
141+
### Changed
142+
* Updated entities packages dependencies
143+
144+
107145
## [1.2.3] - 2024-05-30
108146

109147
### Changed
@@ -139,6 +177,7 @@ uid: changelog
139177

140178
* StreamCompressionDataModel is passed as in parameter to avoid many copy every time a WriteXXX or ReadXXX was called.
141179
* Updated Burst dependency to version 1.8.12
180+
* The `EntityCommandBuffer` used by netcode in the destruction of disconnected 'NetworkConnection' entities has been changed from the `BeginSimulationEntityCommandBufferSystem` to the `NetworkGroupCommandBufferSystem`, allowing connections to be disposed on the same frame that `Disconnect` is invoked (in the common case of `Disconnect` being called before the `NetworkGroupCommandBufferSystem` executes), rather than being delayed by one frame. However, this will therefore lead to runtime exceptions if user-code depends upon this single frame delay, and is therefore a minor breaking change.
142181

143182
### Fixed
144183

@@ -458,7 +497,6 @@ MetricsMonitorComponent: MetricsMonitor,
458497
* Fix a mistake where the relay sample will create a client driver rather than a server driver
459498
* 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.
460499
* 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).
461-
* 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. Contact us with all performance related issues.
462500
* `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.
463501
* Fixed input component codegen issue when the type is nested in a parent class
464502

Documentation~/TableOfContents.md

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,35 @@
11
* [Netcode for Entities package](index.md)
2-
* [Get started](getting-started.md)
3-
* [Installation](installation.md)
4-
* [Networked Cube](networked-cube.md)
5-
* [Netcode Project Settings reference](project-settings.md)
6-
* [Basics](basics.md)
7-
* [Networking Model](client-server-worlds.md)
8-
* [Connection](network-connection.md)
9-
* [Communication (RPCs)](rpcs.md)
10-
* [Synchronization (State and Inputs)](synchronization.md)
11-
* [Ghost Synchronization](ghost-snapshots.md)
12-
* [Ghost Spawning](ghost-spawning.md)
2+
* [Installing](installation.md)
3+
* [Setting up client and server worlds](set-up-client-server-worlds.md)
4+
* [Client and server worlds networking model](client-server-worlds.md)
5+
* [Network protocol checks](network-protocol-checks.md)
6+
* [Creating multiplayer gameplay](creating-multiplayer-gameplay.md)
7+
* [Connecting server and clients](network-connection.md)
8+
* [Communicating with RPCs](rpcs.md)
9+
* [Synchronizing states and inputs](synchronization.md)
10+
* [Ghost synchronization](ghost-snapshots.md)
11+
* [Ghost spawning](ghost-spawning.md)
1312
* [Commands](command-stream.md)
14-
* [Interpolation](Interpolation.md)
15-
* [Managing latency with client prediction](prediction.md)
16-
* [Client prediction high-level explanation](prediction-high-level-explanation.md)
17-
* [Prediction edge cases and known issues](prediction-details.md)
1813
* [Time synchronization](time-synchronization.md)
19-
* [Netcode specific Components and Types](entities-list.md)
20-
* [Advanced](advanced.md)
21-
* [Ghost Type Templates](ghost-types-templates.md)
14+
* [Interpolation](interpolation.md)
15+
* [Prediction](prediction.md)
16+
* [Introduction to prediction](intro-to-prediction.md)
17+
* [Prediction in Netcode for Entities](prediction-n4e.md)
18+
* [Prediction smoothing](prediction-smoothing.md)
19+
* [Prediction switching](prediction-switching.md)
20+
* [Prediction edge cases and known issues](prediction-details.md)
2221
* [Physics](physics.md)
23-
* [Optimizations](optimizations.md)
24-
* [Data compression](compression.md)
25-
* [Source Generators](sourcegenerators.md)
26-
* [Debugging and Tools](debugging.md)
27-
* [PlayMode Tool](playmode-tool.md)
22+
* [Ghost type templates](ghost-types-templates.md)
23+
* [Testing and debugging your game](debugging.md)
2824
* [Logging](logging.md)
29-
* [Metrics](metrics.md)
30-
* [Generator Debugging](sourcegenerators.md#how-to-debug-generator-problems)
25+
* [Using the PlayMode Tool](playmode-tool.md)
26+
* [Gathering metrics with MetricsMonitorComponent](metrics.md)
27+
* [Using source generators](source-generators.md)
28+
* [Optimizing performance](optimizing.md)
29+
* [Optimizing your game](optimizations.md)
30+
* [Data compression](compression.md)
31+
* [Samples](samples.md)
32+
* [Networked cube](networked-cube.md)
33+
* [Reference](reference.md)
34+
* [Netcode-specific components and types](entities-list.md)
35+
* [Netcode Project Settings reference](project-settings.md)

Documentation~/advanced.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

Documentation~/basics.md

Lines changed: 0 additions & 16 deletions
This file was deleted.

Documentation~/client-server-worlds.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Client and server worlds
1+
# Client and server worlds networking model
22

33
The Netcode for Entities package has a separation between client and server logic, and splits logic into multiple worlds (the "client world", and the "server world").
44
It does this using concepts laid out in the [hierarchical update system](https://docs.unity3d.com/Packages/com.unity.entities@1.0/manual/systems-update-order.html) of Unity’s Entity Component System (ECS).

0 commit comments

Comments
 (0)