Skip to content

Releases: needle-mirror/com.unity.netcode

1.3.6

21 Oct 12:10

Choose a tag to compare

[1.3.6] - 2024-10-16

Changed

  • Improved XML document for NetworkStreamDriver.ConnectionEventsForTick.
  • Updated entities packages dependencies

Fixed

  • an issue with netcode source generated files, causing multiple Burst.CompileAsync invocation, ending up in stalling the editor and the player for long time, and / or causing crashes.
  • Issue where OverrideAutomaticNetcodeBootstrap instances in scenes would be ignored in the Editor if 'Fast Enter Play-Mode Options' is disabled (i.e. when domain reloads triggered after clicking to enter play-mode).
  • Longstanding API documentation errors across Netcode for Entities API documentation.

1.3.2

17 Sep 00:11

Choose a tag to compare

[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.2.4

15 Aug 12:10

Choose a tag to compare

[1.2.4] - 2024-08-14

Changed

  • Updated entities packages dependencies

1.3.0-pre.4

18 Jul 12:11

Choose a tag to compare

[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.3.0-exp.1

17 Jun 10:14

Choose a tag to compare

[1.3.0-exp.1] - 2024-06-11

Added

  • 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.
  • 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.
  • Further clarifications, minor improvements, and fixes to the PlayMode Tools Window.
  • DefaultRelevancyQuery to specify general rules for relevancy without specifying it ghost by ghost.
  • Tooltips and additional info for the NetCodeConfig, supporting ClientServerTickRate, ClientTickRate, and GhostSendSystemData.
  • Method EnablePacketLogging.LogToPacket, allowing user-code to add custom events to the netcode per-connection packet dump.
  • An optional connection approval procedure so you can validate that a connection is allowed to connect before a network ID is assigned to it. Connection Approval requests can be sent by client to server via an IApprovalRpcCommand RPC. The server can validate the arbitrary payload included in the RPC. No other data is processed by the server until the connection is approved.
  • More documentation on prediction, edge cases to be careful about, interpolation, compression, physics ghost setup checklist and the general update loop.
  • Increased validation applied to RPC serialization (including better error logging). We now ensure their deserialized size is the expected number of bytes.
  • Test coverage for windowSize: 64 for ReliableSequencedPipelineStage.
  • PredictedSpawnedGhostRollbackToSpawnTick property to the GhostAuthoringComponent to allow predicted ghost spawned by client to rollback and re-simulate their state starting from their spawn tick, until the authoritative spawn has been received from the server. The rollback only occurs if the client receives new snapshots from server that contains at least one predicted ghost.
  • Changed usage of NetworkParameterConstants.MTU to use user configurable NetworkParameterConstants.MaxMessageSize. This allows snapshot and command buffers to reference the correct value and scale buffers accordingly.
  • Exposed NetworkStreamDriver.DriverStore and LastEndPoint.
  • 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.
  • 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.

Changed

  • Added the full type name of the RPC component to the RPC entity name (behind "NetcodeRPC_" prefix).
  • The netcode RPC header size has now changed (from 9B to 5B per packet, plus either 10B or 4B per RPC, depending on DynamicAssemblyList).
  • The max size of a serialized RPC is now 8192 bytes (ushort.MaxValue bits), as we now send the bits written, to be able to validate that the exact number of bits were read in the RpcSystem.
  • Reduced bandwidth consumption of netcode's RpcSetNetworkId RPC payload.
  • Updated com.unity.transport dependency to version 2.2.0.
  • Fixed another issue with predicted ghosts spawned again inside the prediction loop, not rolling back to the backup or re-predicting from the spawn tick, after being initialized by the PredictedSpawnGhostSystem (because of command buffer delay), effectively mispredicting again the first full tick and subsequent partial, and making the backup also contain mispredicted information.
  • Renamed RpcSetNetworkId to ServerApprovedConnection.
  • The servers Handshake process is no longer instantaneous, resulting in a few extra ticks being required (typically) before a connection can be fully established (approximately 7 ticks, up from 4). See bug fix entry.
  • NetCodeConnectionEvents are now raised on the server for the protocol version handshake process (the ConnectionState.State.Handshake enum value). See bug fix entry.
  • Reduced bandwidth consumption of netcode's NetworkProtocolVersion RPC.

Removed

  • NoScale function delegate.

Fixed

  • Compile error when having both com.unity.netcode and com.unity.dedicated-server package together.
  • 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.
  • We now also correctly report and clean-up stale connections. I.e. Connections that are entered into invalid states by user-code.
  • Issue where the CommandSendSystem was attempting to send RPCs with stale connections.
  • 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).
  • 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.
  • Minor documentation issues.
  • InvalidOperationException: cases where EntityManager is part of an exclusive transaction we skip gathering analytics for its world.
  • Breaking change where NoScale function was removed.
  • Issue where the NetCodeDebugConfig would not reset to the LogLevel default (of Notify) if toggled ON, changed, then toggled OFF, during playmode.
  • Minor documentation errors and improving overall grammar.
  • Issue where NetCodeConfig.Global did not load correctly on first boot, if not selected in the Project assets window. If you have a global NetCodeConfig set in your PreloadedAssets Project Setting, we'll also auto-upgrade your project, moving the save to Project Settings (via NetCodeClientAndServerSettings).
  • Negative network delta time will skip updating the system group.
  • NETCODE_NDEBUG define compiler error, and related missing documentation.
  • Issue where two IInputComponentData with the same name but in different namespaces would result in conflicted generated code. Namespace is now taken into account for source gen.
  • Network emulation tooltip clarification.
  • Off-by-one error causing RPCs sent on the same tick as the ProtocolVersion RPC to be corrupted.
  • Language improvements to PredictedSimulationSystemGroup and ClientServerBootstrap.
  • Performance problems with GhostCollectionSystem, with large number of prefabs.
  • PredictedGhostSpawnSystem incorrectly set the offset for serialized buffer data inside the snapshot buffer, making that incompatible with the GhostUpdateSystem logic and causing wrong data potentially copied back to the entity buffer.
  • An issue with preserialized ghost, that were stomping component data with incorrect values.
  • an issue in GhostUpdateSystem that was incorrectly handling the GhostComponentAttribute.SendToOwner flag, causing during continuation and partial ticks replicated data being overwritten incorrectly for predicted ghosts.
  • An issue due to structural changes, that was causing a large number of prediction step performed by the client due to the fact a given ghost could not continue the current prediction from the last full ticks (either partial ticks or another full tick) because the entity data could not be found anymore in the prediction history buffer.
  • Issue where RPCs appeared on deleted connection entities, leading to user code runtime exceptions, where, occasionally, the NetworkId component could not be found on the ReceiveRpcCommandRequest.SourceConnection (as the connection was already disconnected).
  • the client was acknowledging to the server only the last received snapshot instead of the last 32 (this was used to defeat packet loss). This was affecting both the ability to correct use all the available baseline for delta compression, and multiple re-sending static optimized ghost.
  • Rendering issue in GhostAuthoringInspectionComponent, causing UI to right-clip.
  • Defensive fix for other rendering issue in GhostAuthoringInspectionComponent, causing the Refresh and auto-refresh buttons to not appear correctly.
  • Fixed check to early release allocations in the case where a ghost chunk has been reused. We now correctly free these chunks, reducing allocated memory overhead on the server.
  • Rotation glitch issue with prediction switching interpolation
  • Issue where RTT calculation would be incorrectly high when first connecting, especially with high packet loss.
  • Issue where running a netcode test would invalidate the NetworkTimeSystem.TimestampMS for subsequent play-mode runs, when Domain Reloads are disabled, leading to 0±0 ping readout (and related issues).
  • an issue with predicted spawned ghost and enableable components state not being saved correctly in the snapshot buffer when the PredictedSpawnGhostRequest is processed and the entity initialized.
  • an issue with pre-spawned ghost and enableable components state not being saved correctly in the predicted spawn baseline buffer.
  • exception thrown by the GhostPresentationGameObjectSystem when an entity is destroyed. The system was accessing the tracked GameObject list using an invalid index in cases where the removed GameObject was the last element.
  • Exceptionally rare infinite loop crash in SetupDataAndAvailableBaselines.
  • an issue in the PredictedGhostHistorySystem, that was storing the backup of newly spawned ghost using the wrong ghost type and serializer. It was causing weird problem later in the GhostUpdateSystem, in case predi...
Read more

1.2.3

05 Jun 20:57

Choose a tag to compare

[1.2.3] - 2024-05-30

Changed

  • Updated entities packages dependencies

1.2.1

02 May 10:10

Choose a tag to compare

[1.2.1] - 2024-04-26

Changed

  • Updated Burst dependency to version 1.8.13
  • Updated entities packages dependencies

1.2.0

26 Mar 14:12

Choose a tag to compare

[1.2.0] - 2024-03-22

Changed

*Release Preparation

1.2.0-pre.12

28 Feb 11:13

Choose a tag to compare

[1.2.0-pre.12] - 2024-02-13

Added

  • Optimisations for the gather-ghost-chunk by batching function pointer calls and using a better hash map.
  • 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.
  • 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.
  • AlwaysRelevantQuery to specify general rules for relevancy without specifying it ghost by ghost.

Changed

  • StreamCompressionDataModel is passed as in parameter to avoid many copy every time a WriteXXX or ReadXXX was called.
  • Updated Burst dependency to version 1.8.12

Fixed

  • UI issue disallowing the user from enabling the Network Emulator utility when upgrading with a now-deprecated EditorPref value.
  • an issue with pre-serialised ghosts, corrupting memory, crashing or copying wrong data into the snapshot buffer in certain conditions.
  • avoided GC allocation and the costly Marshal.GetDelegateFromFunctionPointer every time an FunctionPointer.Invoke is called. This is done by using directly unmanaged function pointers. All this, compatible with Burst enabled/disabled at any time.
  • lot of memory copies for loop invariants. This also reduced some SafetyChecks and costly operations.
  • avoid costly re-serialization of the whole chunk when the temp buffer can't fit all the data. This is one of the biggest costs during the serialisation loop. By default now the buffer is 8KB that reduce this possibility almost to 0.
  • Assigned InterpolationTick to always be equal ServerTick on the Server simulation (as stated in the summary for this parameter). Additionally the typos pointed out in the parameter summary were corrected.
  • Issue where prespawn failed to initialize when relevancy list was updated before replicating internal prespawn ghosts.

1.2.0-pre.6

15 Dec 15:13

Choose a tag to compare

[1.2.0-pre.6] - 2023-12-13

Changed

  • Promotion preparation