Releases: needle-mirror/com.unity.netcode
Releases · needle-mirror/com.unity.netcode
1.11.0
[1.11.0] - 2025-12-12
Added
- New Prefab List menu item and playmode tools button to quickly list all ghost prefabs in your project or scene hierarchy.
- Internal changes to support GameObject ghosts. More to come later. See Discussions post talking more about this work in progress.
- [Potential Breaking Change] Moving server side's ghost spawn writes from BeginFrame ECB to new PresentationGroup ECB.
- [Potential Breaking Change] GhostAuthoringComponent's content has been moved to a base class.
- Netcode profiler received new tooltips and warning icons. These will show if compression efficiency is low or the snapshot size is approaching max message size.
- Static ghosts now aggressively attempt to avoid looking up snapshot data (via
SnapshotData.GetDataAtTick) inside theGhostUpdateSystem.UpdateJob, and the job itself early outs if there are no ghosts needing to restore, leading to a ~90% reduction in job timings. Profiler markers have also been added to this job, denoting which ghost types (and API calls) are taking the time. - Users can now migrate non ghost data using the
IncludeInMigrationcomponent and the associatedNonGhostMigrationComponentsbuffer. - Non-Ghost Components marked for migration on a Ghost Entity will now be automatically migrated to the correct Ghost.
Changed
- Corrected ghost-types-templates docs regarding the packed vs unpacked format of
bool,byte,sbyte,float, anddouble. - Improved the
boolserialization template, improving packed and unpacked costs (~4 bits to 1 bit, and 32 bits to 8 bits, respectively).
Fixed
- An issue with static optimized ghosts, where incorrect logic in the
GhostUpdateSystemcaused them to not have theirCopyFromSnapshotcalled even once in rare cases, which led to[GhostFields]likeStaticAsteroid.SpawnTick(which need additional processing via theCopyFromSnapshotcode-gen) to be incorrect on the client. NetworkEndpointserialization inside GhostField's, which were mistakenly usingSerializeNetworkEndpointUnpackedin a packed case.- Missing average per entity column for per ghost type overhead sections in the profiler.
1.10.0
[1.10.0] - 2025-11-09
Added
- World state save can now correctly save zero sized components.
- Netcode Profiler - added a context menu in the Ghost Snapshot View's TreeView Labels to quickly access and inspect Ghost Prefabs and Components.
Changed
- Dependent version of com.unity.entities is updated to 1.4.2.
- Source generators will now only run as part of compilation within Unity, and not in IDEs (tested with Rider and Visual Studio, please report a bug if you use another IDE where they are not disabled). This will disable generated sources from showing up in your IDE, but will significantly speed up Roslyn processes in IDEs.
Removed
- Usage of obsolete entities method
GetRefRWOptional
Fixed
- Erroneous Assert in the
PredictedGhostSpawnSystemincorrectly stating that theInitJobdoes not support enableable components, despite the fact that the query itself polls for disabled entities. - Removed warning that spams console when
ClientServerTickRate.TargetFrameRateModeis set toSleep. - Rare issue where an exception would happen in the first run of the prediction loop, only happens when
PredictionUpdateLoopModeis set toAlwaysRun - You can again add multiple
Entitytypes to your ghost components and commands. - Shorts are now properly supported in components and commands.
- Missing Physics-related API docs have been re-added.
1.9.3
[1.9.3] - 2025-11-06
Fixed
- You can again add multiple
Entitytypes to your ghost components and commands. - Shorts are now properly supported in components and commands.
- Missing Physics-related API docs have been re-added.
1.9.2
[1.9.2] - 2025-10-31
Fixed
- Removed warning that spams console when
ClientServerTickRate.TargetFrameRateModeis set toSleep.
1.9.1
[1.9.1] - 2025-10-11
Changed
- Host migration system now caches the ghost component types it uses when collecting host migration ghost data, resulting in faster host migration data collections. It's updated any time the ghost prefab count changes.
GhostField.Quantizationtemplate mismatch errors are now warnings, and will resolve to working code, rather than outputting errors. As a result, we will no longer assume primitive integer types want to disable quantization, as that logic did not cover all cases (e.g. likeEntitystructs etc).- Host migration internal ghost data gathering has improved and should be faster now but add a few bytes of extra data compared to before.
Fixed
- Occasional
MultiplayerPlayModeWindow.HandleHyperLinkArgstruncation error spam. - Unsafe compiler error when using a
fixedarray as aGhostField. Note: You must implement a corresponding safe accessor method implementing ref returns. GhostFieldcompiler error when usingFixedListwith nestedstructtypes, as well as relatedInvalidOperationExceptionin aSubStringcall when using aFixedListwith a primitive type.- Code generator incorrectness when generating struct fields for
GhostFieldFixedListandfixedarray serializers (Entityfields in particular). - Incorrect
curChangeMaskBitsoffset after aFixedListfield is generated, due to incorrectaggregateChangeMaskflag. It's now forced correct viaforceComposite. FixedList's andunsafe fixed array) now correctly support non-public structs for the element type (in cases where we know the code-gen will resolve without compiler errors).GhostSnapshotValueEntitynow usesTryGetValuerather than aHasComponentcall followed by a lookup, reducing lookup costs.- Issue where specifying a
LogLevel(via theDefault.globalconfig'sunity.netcode.sourcegenerator.logging_levelproperty) did nothing.
1.9.0
[1.9.0] - 2025-09-15
Added
GenerateTestsForBurstCompatibilitytest coverage - andToStringoverloads - ofToFixedStringmethods.- Behaviour Breaking Change:
GhostSendSystemData.PercentReservedForDespawnMessagesdenoting the percentage of the snapshot capacity reserved for ghost despawn messages, with a default value of 33% (i.e. one third of the snapshot). This replaces the internal const of 100 ghosts. - A clickable link directing users where to disable Batched Tick Warnings.
- New + and - buttons for automatic thin client creation in the PlayMode Tools window.
- Bounds checks to
NetworkDriverStoreandNetworkDriverStore.Concurrentdriver accessors.
Changed
- Marginally reduced the bandwidth consumption of the
GIDandSpawnTickvalues of ghosts within snapshots, on average. - API Breaking Change: The
PrefabDebugName.Namehas now been fully deprecated, reducing archetype chunk sizes, increasing per-chunk entity capacity for ghost instances. - Best practice on GhostOwnerIsLocal usage. Server-only world behaviour is now undefined and might be changed in future versions. GhostOwnerIsLocal should only be used in client logic. To find owned ghosts in prediction logic, please make sure to strip your input components so they only appear on predicted ghosts.
- Best practice on NetcodeServerRateManage.WillUpdate. Should now use NetworkTime.NumPredictedTicksExpected server side.
- Significant internal refactoring for upcoming Single World Host feature.
- The importance visualizer setting name for "Per Entity Spatial Chunk Structure" has been changed to "Per Chunk". This does not change the behavior, the name is only changed to more accurately reflect the underlying data that is being visualized.
- Made
NetworkDriverStoremethods readonly, where possible.
Fixed
- The analyzer to warn about using the
Simulatecomponent while ignoring enabled state has been fixed to correctly warn when using SystemAPI.Query().WithAll()` and similar calls. - Issue where the ghost data writes could fail while gathering the host migration data (now it will always grow correctly).
Allocator.Persistentmemory leaks caused byImportanceDrawerSystem.cs.ClampPartialTicksThresholdnow displays correctly in theNetCodeConfig.- Behaviour Breaking Change: Ghost despawn messages are now added to the snapshot in a round-robin priority order, where up to 2 despawn messages can be "in-flight" for a single ghost at once. Old behaviour was to send up to 100 ghostIds per snapshot, where each despawn was sent up to 5 times in a row before the next 100 could be added. Delta-compression has also been significantly improved. This new approach significantly improves despawn throughput, while also significantly reducing despawn bandwidth consumption.
- Behaviour Breaking Change: The minimum
DefaultSnapshotPacketSizeis now 100 bytes, up from 1 byte. - Incorrectness in ghost despawn message handling, leading to missed despawns, and rare snapshot errors.
- Hardened snapshot receive logic to expect exact
dataStream.GetBitsRead()correctness, and used it to fix a (harmless) incorrectness when a chunk attempts to write its first ghost into the snapshot, but fails due to exceeding the stream capacity. - Potential dependency error with importance visualization.
- Broken table on PlayMode Tool documentation page.
1.8.0
[1.8.0] - 2025-08-17
Added
- The Playmode Tool's Importance Visualizer drawer that helps visualize Importance Scaling outcomes.
- The
GhostDistancePartitioningSystem.AutomaticallyAddGhostDistancePartitionSharedComponent, which allows you to opt-out of the default behaviour (of always adding aGhostDistancePartitionSharedto all valid ghost instances), enabling you to filter your importance scaling on the existence of this shared component (without having to rip out the entire implementation). - Test coverage of
GhostImportance.BatchScaleImportanceFunctionandGhostImportance.ScaleImportanceFunctionhas been improved (via NetcodeSamples tests), particularly in cases where theGhostDistancePartitionShared(or user-code equivalent) is only added to a subset of all ghosts (i.e. used as a filter). - Support for Forced Input Latency via
ClientTickRate.ForcedInputLatencyTicks, with new fieldsNetworkTime.InputTargetTickandNetworkTime.EffectiveInputLatencyTicks, and new input systemApplyCurrentInputBufferElementToInputDataForGatherSystem<TInputComponentData, TInputHelper>(which was needed to correctly handleIInputComponentDataincremental values). NetworkTime.NumPredictedTicksExpecteddenotes the (un-batched) number of predicted ticks that the client is expected to run within this prediction loop update.- [Experimental] Server and Client Profiler Modules for the Unity Profiler Window as an alternative to the web profiler. Adds new stats and includes per-component stats. Requires Unity 6 or newer. Set the script define NETCODE_PROFILER_ENABLED to enable this feature.
Changed
- Behaviour Breaking Change:
GhostDistanceImportancescale functions no longer multiply thebaseImportanceby 1000, as that is now performed automatically by theGhostSendSystem(see newGhostSystemConstants.ImportanceScalingMultiplierconstant), removing the final importance 1000x discrepancy between ghost chunks that use importance scaling, and ones that don't. - Input systems that write the
NetworkTime.ServerTickintoAddCommandDatacalls should instead useInputTargetTickfor correctness. This value only differs fromServerTickwhen input latency is encountered (seeForcedInputLatencyTicksandMaxPredictAheadTimeMS). NetworkTime.ToFixedStringoutput has been extended to reflect the new Forced Input Latency data.- Updated com.unity.transport dependency to 2.5.3 from 2.4.0
Fixed
- Instead of constantly mispredicting,
MaxPredictAheadTimeMSwill now correctly add forced input latency to the client when said clients RTT is higher than this value. - A potential crash with buffers and prediction switching stripping when your prefab contained a non-zero sized IBufferElementData that was marked for prediction/interpolation only. When restoring any buffer to their prefab value, the wrong length was used, potentially leading to a memcpy overwriting memory.
1.7.0
[1.7.0] - 2025-07-29
Added
- A warning will now appear if you have a query involving
Simulatewhile ignoring enabled state withEntityQueryOptions.IgnoreComponentEnabledStatein the prediction loop.
Changed
- Removed
ENABLE_HOST_MIGRATIONdefine which hid the host migration feature, it's now enabled by default. This also enables by default theNetworkStreamIsReconnectedcomponent which works without host migration. - Refactor host migration API
- Removed
MigrateDataToNewServerWorld/ConfigureClientAndConnecthelper functions. They'll be in the docs and sample instead. - Renamed
HostMigrationUtility->HostMigrationDataand in that class renamedGet/SetHostMigrationDatatoGet/Set(class only contains data methods) with parameters reflecting directionality of data buffer and world. RemovedTryGetHostMigrationData, useGetinstead (native list version). - Removed
DataStorageMethodas it no only has one enum value.
- Removed
- The ghost component serialization method in the host migration feature changed to a much better performing one.
Fixed
- Issue where
PreparePredictedDatawas not being called onGhostPlayableBehaviour, breakingGhostAnimationControllerfunctionality. - Issue where
NetCodeConfig.EnableClientServerBootstrapwas not visible within theNetCodeConfig. - Issue when running a webgl player where you could not connect or receive connections from non-webgl platform players.
1.6.2
[1.6.2] - 2025-07-07
Added
UnityEngine.Time.frameCountis appended to netcode packettimestamplogs using format:[Fr{0}].
Changed
- The client now sends - as part of its command data - some extra information regarding the command tick. In particular, it informs the server if the current command is for a full or partial update/tick. This ensure a more proper time-sync, and avoids mis-predictions.
Fixed
- Adding
GhostAuthoringComponentwill now work properly for a prefab that is opened (double clicked instead of just selected). - Issue preventing static-optimized, not pre-spawned ghosts from spawning on clients when their first serialization result was 'zero-change' against a baseline value of
default(T). They'd previously only be sent for the first time after changing. - Project Breaking Change: Regenerated the GUID for
Packages/com.unity.netcode/Tests/Editor/Physics/Unity.NetCode.Physics.Editor.Tests.asmdefso that it would no longer clash withPackages/com.havok.physics/Plugins/Android/Havok.Physics.Plugin.Android.asmdef. Any assemblies attempting to reference Unity.NetCode.Physics.Editor.Tests by GUIDd8342c4acf8f78e439367cff1a5e802fwill need to be changed tobec3f262d6e6466eb2c61661da550f47. - An issue - due to improper time syncing in between the client and server - especially when using IPC, causing multiple side effects:
- the client was typically only sending commands to the server for partial ticks, not full ticks, causing mis-predictions.
- the client was slightly behind the server, thus receiving new snapshots slightly in advance, and skipping running the
PredictedSimulationSystemGroupfor one frame or more, causing jittery and noticeable artefacts.
- Potential Behaviour Breaking Change: GhostInstance's GhostType is now set with the same valid value for both client and server prespawned instances. (Previously, this was always kept at an initial -1 value server side and never initialized). This way is now more consistent behaviour between client and server.
1.6.1
[1.6.1] - 2025-05-28
Added
- Two new entity command buffer systems that run at the beginning and end of the
PredictedSimulationSystemGrouprespectively:BeginPredictedSimulationCommandBufferSystemandEndPredictedSimulationCommandBufferSystem. - A new internal
PredictedSpawningSystemGroup, running after theEndPredictedSimulationCommandBufferSystem, created to guarantee that when a new snapshot is received from server, all new ghosts are spawned and ready to receive new data. - New documentation regarding the NetworkDriverStore architecture, setup and how to use it in conjunction with Unity.Relay.
- Experimental host migration feature added, enabled with the ENABLE_HOST_MIGRATION define but otherwise hidden.
- With ENABLE_HOST_MIGRATION defined, when a client reconnects to a server after disconnecting the connection entity on both sides will receive a
NetworkStreamIsReconnectedcomponent. An internal unique ID is added to connections to track this behaviour. - The ability to define a smaller
GhostSystemConstants.SnapshotHistorySizevalue via compiler defineNETCODE_SNAPSHOT_HISTORY_SIZE_6orNETCODE_SNAPSHOT_HISTORY_SIZE_16. These values are well suited for larger scale use-cases where server memory is constrained, and snapshot sends of individual ghosts are relatively infrequent. - Support for combining Ghost Relevancy with Ghost Importance Scaling via new
PrioChunks.isRelevantfield, enabling a fast-path for relevancy calculations. - Analytics to netcode tools to better understand their usage.
Changed
- Behaviour Breaking Change: Predicted spawned ghosts for partial ticks skip restoring the state from the backup (and instead continue prediction from their spawn state) when the last backup state tick is identical to the spawn tick, as no data has changed.
- Behaviour Breaking Change: Reduced the complexity (and performance overhead) of the
GhostCount.GhostCountOnServercalculations internally. Note that this value is (and always has been) an approximation. - IsReconnected split into NetworkStreamIsReconnected for reconnected connections and IsMigrated for re-spawned ghosts (Host Migration).
- Moved host migration related types into a
Unity.Netcode.HostMigrationnamespace, renamed theHostMigrationclass toHostMigrationUtilityso it works in the new namespace. - Prespawn ghost IDs will now be preserved between host migrations
- Client connection
NetworkIDsare now preserved between host migrations.
Fixed
- Behaviour Breaking Change: Incorrect state serialized inside the
SnapshotDataBufferfor predicted spawned ghost on the client when spawned inside the prediction loop. ThePredictedGhostSpawnSystemis now updated also as part of the prediction loop (inside thePredictedSpawningSystemGroup) to ensure that any predicted spawned ghosts on the client are correctly initialized at the tick they are spawned, and not with partial tick state. - Issue where predicted spawned ghosts re-simulated from the wrong tick when configured to rollback to their
spawnTickand are spawned inside the prediction loop. They are now restored using the corrected full tick state, rather than the erroneous partial tick state. - Enable creating and initializing server drivers when using WebGL to enable self-hosting cases using relay. Many methods were under conditional compilation flags and removed from the WebGL build and not usable outside the editor.
- All the unmanaged systems present in the FixedStepSimulationSystemGroup that have a direct or indirect update dependency to the PhysicsSystemGroup are now correctly moved to the PredictedFixedStepSimulationSystemGroup. This is a Behaviour Change in respect the previous versions, where all the unmanaged systems continued to stay inside the fixed update group, regardless of the dependency of update order.
- An issue with Mutiplayer PlayModeTool window, throwing exceptions when docked after a domain reload. The issue was due to because of an access to
EditorPrefsandApplication.productNamewhile restoring the window state. - Issue where, during host migration, ghosts could be migrated with a 0 id and type. Causing various issues when instantiated on the new host.
- Crash which could happen after host migrations when the server is deploying the host migration data.
- Issue with prespawn prefab entity list initialization after a host migration, the ordering of the prespawn ghosts could be shifted by one because of the internal
PrespawnSceneListentity prefab creation. This would result in invalid ghost type X (expected X+1) off by one style errors. - The prediction loop will no longer rollback too many times when one ghost is switched from predicted to interpolated, and later switched back to predicted, when that ghost is the only predicted ghost.
- If you update multiple packages, create a new section with a new header for the other package.
- The client packet dump was not being written to the
EnablePacketLogging.NetDebugPacketCachefield, thus were not usable by users and other netcode call-sites (like theNetworkStreamReceiveSystem). SnapshotHistorySizevalues below 32 uncovered an issue where a ghost chunk being written would write over its snapshot history entries for currently-in-flight snapshots, leading to a cycle of never being able to fetch a valid baseline, in perpetuity. The fix for this requires us to stall the send of this ghost chunk if the in-flight queue is full, until the in-flight snapshots are assumed to have either arrived or been lost/dropped.- Buffer serialization errors caused by incorrect pointer stepping when ghost fields are not present (i.e. surrounding
GhostComponentSerializer.State.HasGhostFields). - Buffer serialization errors caused by missing change mask invalidation when
SendToOwnerTypeorGhostSendTypeconditionally prevented sending of the buffer. - Readded
UsePreSerializationto theGhostAuthoringComponentinspector that was accidentally removed.
Obsolete
- Prefer
BatchScaleImportanceDelegatetoScaleImportanceFunctionas the latter significantly reduces the total number of function pointer calls.