Releases: needle-mirror/com.unity.netcode
Releases · needle-mirror/com.unity.netcode
1.0.15
[1.0.15] - 2023-07-27
Changed
- Updated com.unity.entities dependency to 1.0.14
- Use of non required TempJob allocation and use Allocator.Temp instead.
Fixed
- Runtime EntityQuery leaks and reduce runtime memory pressure due to continuously allocating queries without disposing.
- Reduced memory usage in Editor tests, by avoiding allocating queries continuously in hot paths.
1.0.12
[1.0.12] - 2023-06-19
Changed
- Updated com.unity.entities dependency to 1.0.11
Fixed
MultiplayerPlayModeWindow > Dump Packet Logs
now works more reliably, now works with NUnit tests, and dump files are named with more context.- Fixed bug in
GhostSendSystem
that caused it to not replicate ghosts when enabling packet dumps.GhostValuesAreSerialized_WithPacketDumpsEnabled
test added.
1.0.11
[1.0.11] - 2023-06-02
Fixed
- Updated logging dependency
1.0.10
[1.0.10] - 2023-05-23
Added
- What's New and Upgrade Guide section in the docs.
- New NetworkRequestListenResult cleanup component, that can be used to track the result of a listen request.
Changed
- documentation index page with up-to-date info and links.
- Removed forcing local client/server to alway use the loopback address to connect.
- It is now possible to listen to the NetworkEndPoint.Any also for IPC connection.
- The NetworkStreamDriver.GetRemoteAddress always return a consistent address for the connection when the NetworkDriver is configured to use the Unity Relay. Before, an invalid address was returned after the connection has been established, that was incorrect.
- Exposed all the internal state of the NetworkTimeSystem as public API
Fixed
- exceptions when NetworkRequestListen and/or. NetworkRequestConnect are handled and proper handling of multiple (erroneous) requests presents.
- A problem with InterpolatedTick, going back and not recovering correctly in presence of large application, either the server or the client, stalls (i.e after loading).
1.0.8
[1.0.8] - 2023-04-17
Changed
- Reduced the amount of memory allocated by allocating based on the maximum number of worker threads the running platform requires rather than defaulting to using a theoretical upper-bound of 128 worker threads.
- Removed the additional entity created for each predicted ghost prefab, that was necessary to support predicted spawning. This has the addition benefit to cut almost in half (in case all ghost prefabs support all modes) the number of required archetypes.
Fixed
- An issue with pre-spawned ghost not working correctly because sub-scene hash is calculated differently for client and server
- an issue when sub-scene are opened for live-conversion and baking, causing spawned ghosts to contains invalid blob asset references (i.e colliders), introducing potential crashes and other problems (i.e missing collision and mis-prediction)
- An issue with baking, not using the correct NetCodeClientTarget (either client or client/server) when baking a sub-scene for a client standalone build.
- An issue with the Entities/Build project settings UI that was not updating the ClientTarget to use is the ProjectSettings window was not closed, or another settings "tab" was selected.
- An issue with HasServerWorld reporting the presence of a server world even though no server was created.if it's not needed.
- A sporadic InvalidOperationException: GetSingleton<Unity.NetCode.LowLevel.SnapshotDataLookupCache>() thrown when retrieving the Unity.NetCode.LowLevel.SnapshotDataLookupCache.
- GhostCollectionSystem InvalidOperationException thrown when Ghost prefab validation fails, trying accessing invalidated DynamicBuffer.
- An issue in the GhostChunkSerializer, that was overwriting the snapshot data with some enable bits masks.
- An issue in the GhostUpdateSystem, that was reading and applying the wrong enable bits.
- An issue when restoring enable bits state from the predicted ghost history buffer.
- Fixed a "System Creation Order" bug causing components with
[GhostField]
fields (or the[GhostEnableBit]
attribute) to silently default to theDontSerializeVariant
, especially in cases where Ghost Prefabs are created at runtime (viaGhostPrefabCreation.ConvertToGhostPrefab
).- "Ghost Registration" and "Default Variant Registration" Systems now use
[CreateBefore(typeof(DefaultVariantSystemGroup))]
, so that user-code can add[CreateAfter(typeof(DefaultVariantSystemGroup))]
when accessingGhostComponentSerializerCollectionData
data. - We now also guard all of these calls, giving explicit (fatal) errors if used improperly.
- "Ghost Registration" and "Default Variant Registration" Systems now use
- An issue in
GhostDistancePartitioningSystem
, which caused Netcode to add a shared component ECB entry for every single ghost containing aLocalTransform
, every single frame, whenGhostDistanceImportance
was enabled in a users project.
Deprecated
- Now that the
GhostAuthoringInspectionComponent
shows all replicated components, you shouldn't have to opt-into prefab overrides. Thus, deprecated theSupportsPrefabOverrides
attribute.
[1.0.0-pre.66] - 2023-03-21
Added
- Validate and sanitise connect and listen addresses when using IPCNetworkInterface. That was causing some nasty crash in the Transport without users understanding the actual problem.
Changed
- The following components have been renamed:
NetworkSnapshotAckComponent: NetworkSnapshotAck,
IncomingSnapshotDataStreamBufferComponent: IncomingSnapshotDataStreamBuffer,
IncomingRpcDataStreamBufferComponent: IncomingRpcDataStreamBuffer,
OutgoingRpcDataStreamBufferComponent: OutgoingRpcDataStreamBuffer,
IncomingCommandDataStreamBufferComponent: IncomingCommandDataStreamBuffer,
OutgoingCommandDataStreamBufferComponent: OutgoingCommandDataStreamBuffer,
NetworkIdComponent: NetworkId,
CommandTargetComponent: CommandTarget,
GhostComponent: GhostInstance,
GhostChildEntityComponent: GhostChildEntity,
GhostOwnerComponent: GhostOwner,
PredictedGhostComponent: PredictedGhost,
GhostTypeComponent: GhostType,
SharedGhostTypeComponent: GhostTypePartition,
GhostCleanupComponent: GhostCleanup,
GhostPrefabMetaDataComponent: GhostPrefabMetaData,
PredictedGhostSpawnRequestComponent: PredictedGhostSpawnRequest,
PendingSpawnPlaceholderComponent: PendingSpawnPlaceholder,
ReceiveRpcCommandRequestComponent: ReceiveRpcCommandRequest,
SendRpcCommandRequestComponent: SendRpcCommandRequest,
MetricsMonitorComponent: MetricsMonitor,
Removed
- internal ListenAsync/ConnectAsync methods (no visible API changes for users)
Fixed
- a very unfrequent exception thrown in presence of a ghost with a replicated component that does not present any prediction errors names (i.e an Entity reference).
- source generator crash when logging missing assembly dependency.
- source generator requiring Unity.Transport package dependency for generating serialization code.
- Snapshot history buffer not restore correctly, causing entities component to be stomped with random data.
- Fixed an issue when ClientServerBootstrap.AutoConnectPort is 0 indicating autoconnecting should be disabled and you will connect manually via the driver connect API, but the playmode tools ip/port fields would still triggering (so you get two connections set up and errors). We also now prevent attempts to make a connection while one is already established.
- an issue with source generator, validating incorrectly custom templates that uses overrides.
- removed warning for old temp allocation when converting sub-scene with pre-spawned ghosts.
- Forced all
ICommandData
'sInternalBufferCapacity
to be zero, because we were constantly wasting hundreds of bytes per entity to store data that we know for certain will not fit into the internal capacity (as the dynamic buffer required length is hardcoded to 64, for netcode input buffers). - Fixed potential crash in players when send queue is full
- Fixed exceptions when trying to use invalid interpolation ticks (could happen during snapshot updates or in predicted spawning system on disconnection)
1.0.0-pre.65
[1.0.0-pre.65] - 2023-03-21
Added
- validate and sanitise connect and listen addresses when using IPCNetworkInterface. That was causing some nasty crash in the Transport without users understanding the actual problem.
Changed
- the following components has been renamed: | Original Name | New Name | | ---------------| ---------------| |NetworkSnapshotAckComponent| NetworkSnapshotAck | |IncomingSnapshotDataStreamBufferComponent| IncomingSnapshotDataStreamBuffer | |IncomingRpcDataStreamBufferComponent| IncomingRpcDataStreamBuffer | |OutgoingRpcDataStreamBufferComponent| OutgoingRpcDataStreamBuffer | |IncomingCommandDataStreamBufferComponent| IncomingCommandDataStreamBuffer | |OutgoingCommandDataStreamBufferComponent|OutgoingCommandDataStreamBuffer| |NetworkIdComponent|NetworkId| |CommandTargetComponent|CommandTarget| |GhostComponent|GhostInstance| |GhostChildEntityComponent|GhostChildEntity| |GhostOwnerComponent|GhostOwner| |PredictedGhostComponent|PredictedGhost| |GhostTypeComponent|GhostType| |SharedGhostTypeComponent|GhostTypePartition| |GhostCleanupComponent|GhostCleanup| |GhostPrefabMetaDataComponent|GhostPrefabMetaData| |PredictedGhostSpawnRequestComponent|PredictedGhostSpawnRequest| |PendingSpawnPlaceholderComponent|PendingSpawnPlaceholder| |ReceiveRpcCommandRequestComponent|ReceiveRpcCommandRequest| |SendRpcCommandRequestComponent|SendRpcCommandRequest| |MetricsMonitorComponent|MetricsMonitor|
Removed
- internal ListenAsync/ConnectAsync methods (no visible API changes for the users)
Fixed
- a very unfrequent exception thrown in presence of a ghost with a replicated component that does not present any prediction errors names (i.e an Entity reference).
- source generator crash when logging missing assembly dependency.
- source generator requiring Unity.Transport package dependency for generating serialization code.
- Snapshot history buffer not restore correctly, causing entities component to be stomped with random data.
- Fixed an issue when ClientServerBootstrap.AutoConnectPort is 0 indicating autoconnecting should be disabled and you will connect manually via the driver connect API, but the playmode tools ip/port fields would still triggering (so you get two connections set up and errors). We also now prevent attempts to make a connection while one is already established.
- an issue with source generator, validating incorrectly custom templates that uses overrides.
- removed warning for old temp allocation when converting sub-scene with pre-spawned ghosts.
- Forced all
ICommandData
'sInternalBufferCapacity
to be zero, because we were constantly wasting hundreds of bytes per entity to store data that we know for certain will not fit into the internal capacity (as the dynamic buffer required length is hardcoded to 64, for netcode input buffers). - Fixed potential crash in players when send queue is full
- Fixed exceptions when trying to use invalid interpolation ticks (could happen during snapshot updates or in predicted spawning system on disconnection)
1.0.0-pre.47
[1.0.0-pre.47] - 2023-02-28
Fixed
- Snapshot history buffer not restore correctly, causing entities component to be stomped with random data.
1.0.0-pre.44
[1.0.0-pre.44] - 2023-02-13
Added
- Validation checks to the
GhostDistanceData
TileSize
to prevent invalid tile assignment or DivideByZeroException. - Added a HelpURL (linking to docs) for
DisableAutomaticPrespawnSectionReportingAuthoring
,GhostAuthoringComponent
,GhostAuthoringInspectionComponent
,DefaultSmoothingActionUserParamsAuthoring
,GhostPresentationGameObjectAuthoring
,NetCodeDebugConfigAuthoring
,GhostAnimationController
,GhostPresentationGameObjectEntityOwner
, andNetCodePhysicsConfig
. - New GetLocalEndPoint API to NetworkStreamDriver
Changed
- Make EnablePacketLogging component public to allow for per connection debug information.
- Updated
com.unity.transport
dependency to version 2.0.0-pre.6.
Fixed
- An issue with the
NetworkEmulator
in the editor when enabling domain reload (while switching play-mode) that was causing the game to forcibly immediately exit the the play state. - An issue with pre-spawned ghost baking when the baked entity has not LocalTransform (position/rotation for transform v1) component.
- "Ghost Distance Importance Scaling" is now working again. Ensure you read the updated documentation.
- Missing field write in
NetworkStreamListenSystem.OnCreate
, fixing Relay servers. - Code-Generated Burst-compiled Serializer methods will now only compile inside worlds with
WorldFlag.GameClient
andWorldFlag.GameServer
WorldFlags. This improves exit play-mode speeds (when Domain Reload is enabled), baking (in all cases), and recompilation speeds. - Fixed an issue where multiple ghost types with the same archetype but difference data could sometime trigger errors about ghosts changing type.
- Fix a mistake where the relay sample will create a client driver rather than a server driver
- 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.
- Fixed
ArgumentException: ArchetypeChunk.GetDynamicComponentDataArrayReinterpret<System.Byte> cannot be called on zero-sized IComponentData
inGhostPredictionHistorySystem.PredictionBackupJob
. Added comprehensive test coverage for theGhostPredictionHistorySystem
(via adding a predicted ghost version of theGhostSerializationTestsForEnableableBits
tests). - 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. 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.- Fixed input component codegen issue when the type is nested in a parent class
- Exposed NetworkTick value to Entity Inspector
1.0.0-pre.15
[1.0.0-pre.15] - 2022-11-16
Added
- A "Client & Server Bounding Boxes" debug drawer has been added to the package (at
Packages\com.unity.netcode\Editor\Drawers\BoundingBoxDebugGhostDrawerSystem.cs
), allowing you to view the absolute positions of where the client thinks a Ghost is, vs where it actually is on the server. This drawer can also be used to visualize relevancy logic (as you can see widgets for server ghosts that are "not relevant" for your client). Enable & disable it via theMultiplayer PlayMode Tools Window
. - FRONTEND_PLAYER_BUILD scripting define added to the NetCodeClientSetting project setting.
- new GhostSpawnBufferInspectorHelper and GhostSpawnBufferComponentInspector structs, that permit to read from the ghost spawn buffer any type of component. They can be used in spawn classification systems to help resolving predicted spawning requests.
- GhostTypeComponent explicit conversion to Hash128.
- Templates for serialising
double
type. - A
TransformDefaultVariantSystem
that optionally setup the default variant to use forLocalTransform
, (Rotation
,Position
for V1) if a user defined default is not provided. - A
PhysicsDefaultVariantSystem
that optionally setup the default variant to use forPhysicVelocity
if a user defined default is not provided.
Changed
- Updated com.unity.transport dependency to 2.0.0-exp.4
- SharedGhostTypeComponent is also added to the client ghost prefab to split ghosts in different chunks.
- GhostTypeComponent equals/match the prefab guid.
- Removed
CodeGenTypeMetaData
, and made internal changes to howVariantType
structs are generated. We also renamedVariantType
toComponentTypeSerializationStrategies
to better reflect their purpose, and to better distinguish them from the concept of "Variants". - Support for replicating "enable bits" on
IEnableableComponent
s (i.e. "enableable components") via new attributeGhostEnabledBitAttribute
([GhostEnabledBit]
), which can be added to the component struct.
Note: If this attribute is not added, your enabled bits will not replicate (even on components marked with[GhostField]
s).
This is a breaking change. Ensure all your "enableable components" with "ghost fields" on them now also have[GhostEnabledBit]
on the struct declaration. - All
DefaultVariantSystemBase
are all grouped into theDefaultVariantSystemGroup
. - It is not necessary anymore to define a custom
DefaultGhostVariant
system if aLocalTransform
(Rotation
orPosition
for V1) orPhysicsVelocity
variants are added to project (since a default selection is already provided by the package). - Updated com.unity.transport dependency to 2.0.0-pre.2
Removed
- Removing dependencies on
com.unity.jobs
package.
Fixed
- Error in source generator when input buffer type was in default namespace
- Always pass SystemState by ref to avoid UnsafeLists being reallocated in a copy but not the original.
- Use correct datatype for prespawned count in analytics.
- Use EditorAnalytics to verify whether it is enabled.
- exception thrown by the hierarchy window if a scene entity does not have a SubScene component.
- Issue with the GhostComponentSerializerRegistrationSystem and the ghost metadata registration system trying accessing the GhostComponentSerializerCollectionData before it is created.
- A crash in the GhostUpdateSystem, GhostPredictionHistorySystem and others, when different ghost types (prefab) share/have the same archetype.
- A NetCodeSample project issue that was causing screen flickering and entities rendered multiple times when demos were launched from the Frontend scene.
- an issue in the GhostSendSystem that prevent the DataStream to be aborted when an exception is throw while serialising the entities.
- InvalidOperationException in the
GhostAuthoringInspectionComponent
when reverting a Variant back to the default. - UI layout issues with the
GhostAuthoringInspectionComponent
. - Hashing issue with
GhostAuthoringInspectionComponent.ComponentOverrides
during baking, where out-of-date hashes would still be baked into the BlobAsset. You now get an error, pointing you to the offending (i.e. out-of-date) Ghost prefab. - quaternion cannot be added as field in ICommandData and/or IInputComponentData. A new region has been added to the code-generation templates for handling similar other cases.
- Fixed hash generation when using
DontSerializeVariant
(orClientOnlyVariant
) onDefaultVariantSystemBase.Rule
. They now use the constant hashes (DontSerializeHash
andClientOnlyHash
). - NetDbg will now correctly show long namespaces in the "Prediction Errors" section (also: improved readability).
- Removed CSS warning in package.
- A problem with baking and additional ghost entities that was removing
LocalTransform
,WorldTransform
andLocalToWorld
matrix. - Mismatched ClientServerTickRate.SimulationTickRate and PredictedFixedStepSimulationSystemGroup.RateManager.Timestep will throw an error and will set the values to match each other.
Upgrade Guide
NetCodeClientTarget
moved from namespaceAuthoring.Hybrid
toUnity.NetCode.Hybrid
VariantType
has been renamed toSerializationStrategy
, in an attempt to disambiguate the roles of “Variants” vs “Serialization Strategies”.ComponentTypeSerializationStrategy
- Denotes the rules used to serialize a specific Component, on a specific GhostType.- “Variant” (via
GhostComponentVariation
) - The name for a custom struct modifying the serialization rules for a singleComponentType
.
- Defining
DefaultVariantSystemBase
rules has changed. You now must pass in aDefaultVariantSystemBase.Rule
rather than theSystem.Type
of the VariantType. VariantHash
es for ghost variants may have changed. Make sure that there are no errors when baking all GhostTypes (in subscenes and prefabs), and use theGhostAuthoringInspectionComponent
to debug and validate that the “default rules” (for yourComponentTypes
) are correct. Note that GhostFields on components on child entities are no longer replicated (i.e. serialized) by default.- TRANSFORMS_V2 will break all Variant modifications made to (now legacy)
Translation
andRotation
Components. You'll need to either:- a) reimplement these custom Variants yourself (targeting
LocalTransform
) or - b) use one of the new built-in
LocalTransform
Variants provided. - Note that currently, these invalid "Component Overrides" on
GhostAuthoringInspectionComponents
are not automatically updated for you. They are simply force-deleted (with an associated error message, which should provide some useful context).
- a) reimplement these custom Variants yourself (targeting
1.0.0-exp.13
[1.0.0-exp.13] - 2022-10-19
Fixed
- quaternion cannot be added as field in ICommandData and/or IInputComponentData. A new region has been added to the code-generation templates for handling similar other cases.
- Removed the deprecated NativeList to NativeArray implicit cast and use NativeList.AsArray instead.
- fixed a NotImplementedException thrown in standalone player client build.