Releases: needle-mirror/com.unity.netcode
Releases · needle-mirror/com.unity.netcode
1.2.1
[1.2.1] - 2024-04-26
Changed
- Updated Burst dependency to version 1.8.13
- Updated entities packages dependencies
1.2.0
[1.2.0] - 2024-03-22
Changed
*Release Preparation
1.2.0-pre.12
[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
[1.2.0-pre.6] - 2023-12-13
Changed
- Promotion preparation
1.2.0-pre.4
[1.2.0-pre.4] - 2023-11-28
Added
- You can now disable the automatic Entities
ICustomBootstrap
bootstrapping (which calls NetCode's ownClientServerBootstrap
) by either; a) disabling it in the ProjectSettings (default value is enabled), or b) adding the newOverrideAutomaticNetcodeBootstrap
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
andNetworkStreamDriver.GetMaximumHeaderSize
to allow users to determine max safe payload sizes.
Fixed
- Esoteric exception in
MultiplayerPlaymodeWindow
in server-only cases. - Interpolated ghosts now support
IInputComponentData
andAutoCommandTarget
. - Improved
UpdateGhostOwnerIsLocal
to make it reactive toGhostOwner
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
GhostAuthoringInspectionComponent
s 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
[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
insideGhostComponentSerializerCollectionSystemGroup
due toComponentTypeSerializationStrategy.DefaultType
being abyte
flag enum (so it erroneously matched128 - 0
the same as0 - 128
due to wrapping).
1.1.0-exp.1
[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
andProtocolError
. 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 thePredictedFixedStepSimulationGroup.ConfigureTimeStep
to setup the rate of thePredictedFixedStepSimulationSystemGroup.
. - 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 theRpcSystem
. - 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
, andSetLocalPlayerGraphicsColorsSystem
. - 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 anArgumentException
when added to a Prespawned Ghost due toArchetypeChunk.GetDynamicComponentDataArrayReinterpret
.
1.0.17
[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
[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.