Skip to content

Releases: needle-mirror/com.unity.netcode

1.2.0-pre.6

15 Dec 15:13
Compare
Choose a tag to compare

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

Changed

  • Promotion preparation

1.2.0-pre.4

04 Dec 15:14
Compare
Choose a tag to compare

[1.2.0-pre.4] - 2023-11-28

Added

  • You can now disable the automatic Entities ICustomBootstrap bootstrapping (which calls NetCode's own ClientServerBootstrap) by either; a) disabling it in the ProjectSettings (default value is enabled), or b) adding the new OverrideAutomaticNetcodeBootstrap MonoBehaviour to your first build scene (i.e. your Active scene). Thus, there is no longer any need to write a custom bootstrap just to support a Frontend scene vs a Gameplay scene.
  • A NetCodeConfig ScriptableObject, containing most NetCode configuration variables, allowing customization without needing to modify code. Most variables are live-tweakable.
  • A 'Snapshot Sequence Id' (SSId), which is used to accurately measure packet loss. It adds 1 byte of header to each snapshot, but enables us to measure Netcode-caused causes of PL (i.e. out of order snapshots being discarded, and discarding a snapshot if another arrives on the same frame). Access statistics via a new struct on the client's NetworkSnapshotAck.
  • RpcCollection.GetRpcHeaderLength and NetworkStreamDriver.GetMaximumHeaderSize to allow users to determine max safe payload sizes.

Fixed

  • Esoteric exception in MultiplayerPlaymodeWindow in server-only cases.
  • Interpolated ghosts now support IInputComponentData and AutoCommandTarget.
  • Improved UpdateGhostOwnerIsLocal to make it reactive to GhostOwner changes, thus it no longer needs to poll.
  • NetDbg ArgumentException when a predicted ghost contains a replicated enableable flag component.
  • Display-only issue where the variants for additional entities (created via baking) were calculated as if they were 'root' entities. They are - in fact - child entities, thus the variants automatically selected for them should default to child defaults.
  • QoL issue; we now allow users to opt-out of auto-baking GhostAuthoringInspectionComponents when selecting their GameObject, reducing stalls when clicking around the Hierarchy or Project.
  • QoL issue where GhostAuthoringInspectionComponent was not always modifiable in areas of the Editor where it is valid to modify them.
  • Issue where GhostAuthoringComponent was disallowed in nested prefab setups (where the root prefab is NOT a ghost).
  • Log verbiage when creating a driver in DefaultDriverConstructor read like a 'call to action'. It's not.

1.1.0-pre.3

08 Nov 20:13
Compare
Choose a tag to compare

[1.1.0-pre.3] - 2023-10-17

Changed

  • the DefaultTranslationSmoothingAction.DefaultStaticUserParams is now public and can be used by user code (to either change the defaults or use them in their own custom smoothing methods).

Fixed

  • issue when using prediction error smoothing, causing wrong component data retrieved from the backup buffer and consequently not making the smoothing function work as expected.
  • an issue in the reported elapsed time when executing the PredictedFixedStepSystemGroup in presence of partial ticks and PredictedFixedStepSimulationTickRatio grater than 1, causing problem with physics and character controller interpolation.
  • An issue with the change mask not read correctly when serializing/deserializing components with more than 32 fields.
  • InvalidOperationException: Comparison function is incorrect inside GhostComponentSerializerCollectionSystemGroup due to ComponentTypeSerializationStrategy.DefaultType being a byte flag enum (so it erroneously matched 128 - 0 the same as 0 - 128 due to wrapping).

1.1.0-exp.1

20 Sep 15:14
Compare
Choose a tag to compare

[1.1.0-exp.1] - 2023-09-18

Added

  • source generator can now be configure to enable/disable logs, report timings. It also possible to set the minimal log level (by default is now Error).
  • new public template specs and generator documentation
  • Added convenience methods for getting the clientworld / serverworld (or thin client list) added to ClientServerBootstrap
  • Additional analytics events. Multiplayer tools fields, prediction switching counters, tick rate configuration.
  • New method on the PredictedFixedStepSimulationSystemGroup class to initialise the rate as a multiple of a base tick rate.
  • Packet Fuzz % is now configurable via the Network Simulator. It's a security tool that should not be enabled during normal testing. It's purpose is to test against malicious MitM attacks, which aim to take down your server via triggering exceptions during packet deserialization. Thus, all deserialization code should be written with safeguards and tolerances, ensuring your logic will fail gracefully.
  • CopyInputToCommandBufferSystemGroup group, that contains all the system that copy IInputCommandData to the underlying ICommand buffer. This let you now target this group with the guarantee that all inputs are not copied after it run.
  • CopyCommandBufferToInputSystemGroup group, that contains all the system that copy ICommandData to their IInputCommandData representation. It runs first in the prediction loop and you can easily target it to do logic before or after the input are updated.
  • GhostSpawnClassificationSystemGroup, that is aimed to contains all your classification systems in one place.
  • Error messages to some missing NetworkDriver.Begin/EndSend locations.
  • defining ENABLE_UNITY_RPC_REGISTRATION_LOGGING will now log information about registered RPCs during netcode startup
  • We now automatically detect Application.runInBackground being set to false during multiplayer gameplay (a common error), and give advice via a suppressible error log as to why it should be enabled.
  • We introduced the new InputBufferData buffer, that is used as underlying container for all IInputComponentData.
  • conditional compilation for some public interfaces in DefaultDriverBuilder to exclude the use of RegisterServer methods for WebGL build (they can't listen). It is possible to do everything manually, but the helper methods are not present anymore.
  • new method for creating a NetworkDriver using WebSocketNetworkInterface.
  • Added two new values to the NetworkStreamDisconnectReason enum: AuthenticationFailure and ProtocolError. The former is returned when the transport is configured to use DTLS or TLS and it fails to establish a secure session. The latter is returned for low-level unexpected transport errors (e.g. malformed packets in a TCP stream).

Changed

  • relaxed public field condition for variants. When declaring a ghost component variations, the variant fields are not required to be public. This make the type pretty much unusable for any other purpose but declaring the type serialisation.
  • Increased the ThinClient cap on MultiplayerPlayModePreferences.MaxNumThinClients from 32 to 1k, to facilitate some amount of in-editor testing of high-player-counts.
  • NetcodeTestWorld updates the worlds in the same way the package does: first server, then all clients worlds.
  • When Dedicated Server package is installed, the PlayMode Type value is overridden by the active Multiplayer Role.

Deprecated

  • The public PredictedFixedStepSimulationGroup.TimeStep. You should always use the PredictedFixedStepSimulationGroup.ConfigureTimeStep to setup the rate of the PredictedFixedStepSimulationSystemGroup..
  • the IInputBufferData interface (internal for code-gen use but public) has been deprecated and will be removed in the 1.2 release.

Fixed

  • incorrect code generated serialization and calculated ChangeMask bits for component and buffers when the GhostFieldAttribute.Composite flag is set to true (in some cases).
  • wrong check for typename in GhostComponentVariation
  • missing region in unquantized float template, causing errors when used for interpolated field.
  • improper check when the ClientServerSetting asset is saved, causing worker process not seeing the changes in the settings.
  • The server world was not setting the correct rate to the group, if that was not done as part of the bootstrap.
  • Exception thrown when the NetDbg tools is connecting to either the editor or player.
  • Renamed (and marginally improved) the "Multiplayer PlayMode Tools" Window to the "PlayMode Tools" Window, to disambiguate it from "[MPPM] Multiplayer Play Mode" (an Engine feature).
  • Attempting to access internals of Netcode for Entities (e.g. via Assembly Definition References) would cause compiler errors due to MonoPInvokeCallbackAttribute being ambiguous between AOT and Unity.Entities.
  • Packet dump logging exception when using relevancy, despawns, and packet dumps enabled. Also fixed performance overhead (as it was erroneously logging stack traces).
  • An issue with variant hash calculation in release build, causing ghost prefab hash being different in between development/editor and release build.
  • GhostUpdateSystem.RestoreFromBackup does not always invalidate/bump the chunk version for a component, but only if the chunk as changed since the last time the restore occurred.
  • Issue in TryGetHashElseZero, that was using the ComponentType.GetDebugName to calculate the variant hash, leading incorrect results in a release player build
  • A NetworkDriver.BeginSend error causing an infinite loop in the RpcSystem.
  • Deprecated Analytics API when using 2023.2 or newer.
  • compilation issue when using 2023.2, caused by an ambiguous symbol (define in both Editor and in Entities.Editor assembly)
  • Errant netcode systems no longer show up in the DefaultWorld: PhysicsWorldHistory, SwitchPredictionSmoothingPhysicsOrderingSystem, SwitchPredictionSmoothingSystem, GhostPresentationGameObjectTransformSystem, GhostPresentationGameObjectSystem, and SetLocalPlayerGraphicsColorsSystem.
  • Previous was hard to retrieve the generated buffer for a given IInputComponentData. Now is easy as doing something like InputBufferData.
  • Compilation error when building for WebGL
  • SnapshotDataLookupCache not created in the correct order, causing custom classification system using the SnapshotBufferHelper to throw exceptions, because the cache was not initialised.
  • A replicated [GhostEnabledBit] flag component would throw an ArgumentException when added to a Prespawned Ghost due to ArchetypeChunk.GetDynamicComponentDataArrayReinterpret.

1.0.17

13 Sep 12:15
Compare
Choose a tag to compare

[1.0.17] - 2023-09-11

Added

  • defining ENABLE_UNITY_RPC_REGISTRATION_LOGGING will now log information about registered RPCs during netcode startup

Changed

  • NetcodePacket debug log filenames changed to include date/time and version information

Fixed

  • addressed a case where it was possible for an exception to be thrown on the server if an RPC was queued for a then dropped connection.
  • "AssetDatabase.RegisterCustomDependency are restricted during importing" exception thrown by the NetCodeClientSettings, NetCodeClientServerSettings, NetCodeServerSettings in their OnDisable method, when using 2023.2 or newer.

1.0.15

10 Aug 09:11
Compare
Choose a tag to compare

[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

21 Jun 09:12
Compare
Choose a tag to compare

[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

05 Jun 16:10
Compare
Choose a tag to compare

[1.0.11] - 2023-06-02

Fixed

  • Updated logging dependency

1.0.10

25 May 15:11
Compare
Choose a tag to compare

[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

11 May 17:11
Compare
Choose a tag to compare

[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 the DontSerializeVariant, especially in cases where Ghost Prefabs are created at runtime (via GhostPrefabCreation.ConvertToGhostPrefab).
    • "Ghost Registration" and "Default Variant Registration" Systems now use [CreateBefore(typeof(DefaultVariantSystemGroup))], so that user-code can add [CreateAfter(typeof(DefaultVariantSystemGroup))] when accessing GhostComponentSerializerCollectionData data.
    • We now also guard all of these calls, giving explicit (fatal) errors if used improperly.
  • An issue in GhostDistancePartitioningSystem, which caused Netcode to add a shared component ECB entry for every single ghost containing a LocalTransform, every single frame, when GhostDistanceImportance 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 the SupportsPrefabOverrides 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's InternalBufferCapacity 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)