UnifiedNetcodeTransport refactor#3976
Merged
NoelStephensUnity merged 9 commits intoMay 18, 2026
Merged
Conversation
…odeTransport to not use entities (#3943) Refactor sending and receiving of RPCs to not use entities, thereby preserving send/receive order without having to encode an order value and reorder messages on the receive side.
…ybrid_spawn_integration_tests
…ental/v3-x-x/hybrid_spawn_integration_tests
…migration' into experimental/v3-x-x/hybrid_spawn_integration_tests # Conflicts: # com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs # com.unity.netcode.gameobjects/Tests/Runtime/TestHelpers/NetcodeIntegrationTest.cs # testproject/Assets/Tests/Manual/DontDestroyOnLoad/ObjectToNotDestroyBehaviour.cs
Comment on lines
+474
to
+482
| #if UNIFIED_NETCODE | ||
| if (!NetworkConfig.Prefabs.HasGhostPrefabs) | ||
| { | ||
| #endif | ||
| // Process outbound messages | ||
| MessageManager.ProcessSendQueues(); | ||
| #if UNIFIED_NETCODE | ||
| } | ||
| #endif |
Member
There was a problem hiding this comment.
Suggested change
| #if UNIFIED_NETCODE | |
| if (!NetworkConfig.Prefabs.HasGhostPrefabs) | |
| { | |
| #endif | |
| // Process outbound messages | |
| MessageManager.ProcessSendQueues(); | |
| #if UNIFIED_NETCODE | |
| } | |
| #endif | |
| #if !UNIFIED_NETCODE | |
| // Process outbound messages | |
| MessageManager.ProcessSendQueues(); | |
| #endif |
Member
There was a problem hiding this comment.
Perhaps leave an XML comment with a cref to UnifiedNetcodeUpdateSystem.Update saying something about messages being processed prior to when N4E sends them?
NoelStephensUnity
approved these changes
May 8, 2026
Member
NoelStephensUnity
left a comment
There was a problem hiding this comment.
Other than the minor define suggestion and comment about where the send queue is processing, it looks very nice Kitty!
![]()
1d4e514
into
experimental/v3-x-x/unified-poc-migration
7 checks passed
NoelStephensUnity
added a commit
that referenced
this pull request
Jun 2, 2026
* update Adjusting namespaces to get NGO running with N4E * update - wip This is a "still messy" version that is working but needs more thought on the namespace collision fixes. * update Some additions and modifications to finalize the hybrid prefab concept. * update cleaning up some of the POC adjustments. wrapping some debug within loglevel developer. * update Getting unified working with the initial synchronization when scene management is enabled. * update Providing a temporary way to remove the NetworkObjectBridge. * update Adding support within NetworkPrefabs and NetworkPrefab to handle the registration of hybrid spawned objects (i.e. no more hacky-way of registering). Moving the hybrid spawn registration into the Start method of the NetworkObject to provide time for everything to run through Awake. Added some script (defined out) that was helping to debug why NetworkObject was being disabled sometimes (moving the initialization to Start resolved the issue). * update NetworkRigidbodyBase and NetworkTransform classes are destroyed during runtime initialization of a prefab instance if they still remain and the instance is a hybrid prefab instance (i.e. unified handles transform synchronization and physics related stuff). * fix Fixing issue where there are no NetworkTransforms or NetworkRigidbodyBase derived components. * fix Issue with AnimatorOverrideController not being handled which could cause improper processing of the animator's layers and parameters. Issue with clients sending state changes from the NetworkAnimatorStateChangeHandler due to added HasAuthority check. When using a server authoritative animation model, owner Clients should still be able to send trigger updates to the server. * update Migrated the unique world setup into this branch. The world is created prior to starting NetworkManager completely. When using hybrid prefabs (i.e. mixed mode), the final portion of the NetworkManager's start logic (i.e. endpoint connection, etc.) is not invoked until the hybrid prefabs have been registered. Hybrid prefabs wait until the World is finished starting/being initialized. * update Migrating unified things into helpers * update Exit early if trying to start in hybrid mode but not configured for a single world. * update Added an experimental "NetworkObjectBridge" icon (programmer art alert). Added some additional script to handle moving the GhostAdapter and NetworkObject bridge to the top of the GameObject's components where GhostAdapter is first and then NetworkObjectBridge is 2nd. Removed silly code to get the root transform. * update Fixing some merge issues. * update Making some minor modifications to assure we can make stand alone builds. * update Fixing issue where Unity.NetCode was not wrapped by UNIFIED_NETCODE. * fix Issue with detecting unified ghost mode. * update Automatically handle removing the Rigidbody on non-authority instances when running in client-server mode. * update - child network behaviours This update is the first pass to making ChildNetworkBehaviours a table keyed off of the NetworkBehahviour identifiers. This allows for the removal of a NetworkBehaviour without it impacting the remaining NetworkBehaviours. This could most likely be optimized by generating the initial table ahead of time on each prefab. In-scene placed that are not registered prefabs would need to do this upon being instantiated. * fix Removing the update registration when cleaning out NetworkRigidbody. * fix Putting back the default world initialization. * fix The type of world is now handled by the NGO side UnifiedBootStrap. Removing the need to use the MPPM stuff. * fix Fixing issue with temporary buffer not being copied over properly when synchronizing. * update Updating runtimetests to the changes in ChildNetworkBehaviours. * fix & update Fixing test project not being able to load without an AnalyticsTests compilation error. Making ObjectNameIdentifier just use the new way we handle ChildNetworkBehaviours (i.e. it is a table now). Marking NetworkObject.ChildNetworkBehaviours comment above as having finished the migration to a table. Noting we should find a better place/way to initialize this stuff. * update Adding additional log information only displayed when the log level is Developer. * update Possible fix for an edge case scenario during synchronization. * Transport sharing WIP * update preserve hybrid objects pending spawn. * update Temporary fix for missed sync. * update Delay in-game state for new connections to provide NGO time to start synchronization. * update * update Removing a hack work around that is no longer needed due to recent fixes merged in the dots repo side. * update Lowering the in-game connection delay. * update Fixing hybrid prefab registration and world initialization order. * update Some fixes that should accompany the N4E POC branch. * - Delay connections from going in game in N4E until initial NGO sync has finished - Handle messages too large to be sent as a single RPC in N4E (using BatchedSendQueue and BatchedReceiveQueue) - Handle RPCs being received out of order - Switched connection flow so that connection is initialized by the transport (typical NGO flow) rather than using AutoConnectPort. * Got RTT working correctly. * update Fixes for connection sequence where clients don't announce they are ready to receive snapshots until fully synchronized by NGO. Fixes for removing pending ghosts and ghost spawn data (especially when being destroyed). Fixes for NetworkSceneManager detecting pending ghosts as in-scene placed. Fixes for NetworkSpawnManager.RegisterGhostPendingSpawn trying to double process triggers and/or process triggers when it should not. * update & fixes Some adjustments to the POC Transport. Some fixes. * fix Wrapping reference to namespace that only exists when in unified mode. * update fixing spelling of UNIFIED_NETCODE * update Increasing max RPC size to 1340. Re-enabling the UnifiedBootStrap.AutoConnectPort. (N4E handles the connection) Removing the initial listen and/or connection within the UnifiedTransport (N4E handle this). Moving unified validation invocation to be after OnValidation early exit checks. * update Lowering max packet size to 1300. * Switched TransportRpc to use the Out-Of-Band RPC pipeline * update - OUT_OF_BAND_RPC Wrapping the OutOfBoundRpc stuff until we can get that migrated over. * update Adding conditional to determine if we want to use the UnifiedTransport or not. * chore: merge ngo and n4e with poc transport and updates (#3889) * update Fixes for connection sequence where clients don't announce they are ready to receive snapshots until fully synchronized by NGO. Fixes for removing pending ghosts and ghost spawn data (especially when being destroyed). Fixes for NetworkSceneManager detecting pending ghosts as in-scene placed. Fixes for NetworkSpawnManager.RegisterGhostPendingSpawn trying to double process triggers and/or process triggers when it should not. * update & fixes Some adjustments to the POC Transport. Some fixes. * fix Wrapping reference to namespace that only exists when in unified mode. * update fixing spelling of UNIFIED_NETCODE * update Increasing max RPC size to 1340. Re-enabling the UnifiedBootStrap.AutoConnectPort. (N4E handles the connection) Removing the initial listen and/or connection within the UnifiedTransport (N4E handle this). Moving unified validation invocation to be after OnValidation early exit checks. * update Lowering max packet size to 1300. * Optimizations of the UnifiedNetcodeTransport. * Added support for surfacing disconnect messages * fix Fixing a missed namespace, formatting, and some minor style related issues with newly added private statics. * fix Delay the sorting of the GhostAdapter and NetworkObjectBridge to avoid from sorting while updating the AssetDatabase. * Update NetworkObject.cs * temp-fix Temporary fix for automatically adding the NetworkObjectBridge and not causing warnings to be logged about sending messages during Awake, OnValidate, etc. * update improving how NetworkObjectBridge is added and then sorted to the top with the GhostAdapter. * update Adding a base project that can be used to continue development on the unified branch. * fix NetworkBehaviour entry fix for the child behaviours being converted to a table. * Integration tests WIP * Removed SetActive calls * update Some potential fixes (etc) for hybrid spawn integration testing. * style removing unused namespace directives. * update Adjustments based on earlier discussion. * update Resolving merge issues. * fix: We need to initialize prefabs prior to checking if we have Ghosts and need to use UnifiedNetcodeTransport. Fixing the logging and handling for users parenting NetworkManager during runtime. * update removing debug log message that causes some tests to fail. * test-fix Handling a new scenario where a subSystemList can be null. * test-fix Commenting out log message in CreateObjectMessage (leaving it there for potential debug purposes while working on Unified stuff). * fix Some left over merge fixes. * update Removing legacy component marker from early POC. * fix When no player prefab, don't throw an exception (needs a test) * update - remove NGO-N4E-Example Removing the example from this specific branch to make reviewing easier. * update Removing experimental component helpers (part of the ComponentMarkers stuff that is no longer used). * update Adding develop-3.x.x to the triggers. * update Reverting test project manifest changes. Removing the packages-lock.json file (should never be added). * update Placing the UnifiedBootstrap into its own file. * update & style White space removal. UnifiedBootstrap name update. * test Wrapping the unified test within the UNIFIED_NETCODE define. * style Adding CR/LF. * update - Multiprocess Runtime Removing this from test project as we have never come back to use it. (It will still be on the develop-2.0.0 branch) * fix Wrapping some unified stuff in defines. * update Adding develop-3.x.x to conventional PR branches. * update Missed one spot for triggers. * style - PVP-124-2 Removing trailing whitespaces. * update: PVP-Exceptions Adding some exceptions to the v3.x.x branch until we determine if we want to rename those assemblies or have them all in one assembly. * fix Fixing typo. * fix Fixing json formatting issue. * fix Cleaning up the player prefab hash logical flow a bit and making it easier to determine if one was even found. * style removing additional whitespace from comment * update Updating the package version * style indented endregion. * revert Reverting changes to manifest for now. * style Adding new line. * style adding some additional comments. * update Updating the project to 6000.3.14f1 * Update Project version * update Making the minimal editor version 6000.3 and removing 6000.0. * style Adding comments * update Updating triggers to use no less than 6000.3 * Added hybrid spawning to a bunch of existing tests and fixed most of the issues that fell out of that. * update Resolving minor issues related to merge. * style - PVP Fixing some trailing whitespace issues and PVP missing XML API. * style Fixing formatting issues. * update Trunk merge updates * Update & Fix Some comments and minor adjustments. Fixing issue where the auto-sort was disabled when using inspector view. * small merge fixes * test Fixing the hybrid spawning test for tests. * update Remove duplicate UNIFIED_NETCODE usages * update Only assign the server or host world to NetCode.Netcode.Instance.m_ActiveWorld * fix Don't run hybrid yet until we merge our N4E changes into trunk. This also requires modifying anything in CI that automatically creates a test project such that the N4E NetcodeConfig exists and the build settings are set to Client and Server. * Remove uneeded changes * update - clean up Cleaning up some areas. Wrapping all of the original network prefab unified work where NGO handles the timing for hybrid prefab registration. (We might remove this prior to release but keeping it for reference purposes in case there are changes on N4E side that require us to use the original approach) Fixing issue with not removing Rigidbody on clients automatically. (for now until we can make it an opt-in) * style - fixes Fixing some style related issues. Updating the UnifiedBootstrap comment. * style Adding some additional comments in various places to help clarify a bit more what is happening. * style removing xml-api trailing space. * UnifiedNetcodeTransport refactor (#3976) * Fix DontDestroyOnLoadTest * [MTT-14843] Refactor sending and receiving of N4E RPCs in UnifiedNetcodeTransport to not use entities (#3943) Refactor sending and receiving of RPCs to not use entities, thereby preserving send/receive order without having to encode an order value and reorder messages on the receive side. * Post-merge fixes * Fix remaining errors. * Revert unnecessary change from bad merge. * Accidentally deleted a line. * style Fixing issue with improperly formatted script when UNIFIED_NETCODE is not defined. * style - APV fix Removing all trailing spaces from UnifiedNetcodeTransport. * Fixed disconnects not being processed correctly in the unified transport * update Part of the hybrid spawned parenting fixes. * Move ghost spawning to GhostSpawnManager * Fix standards check * Update com.unity.netcode.gameobjects/Runtime/Configuration/NetworkPrefabs.cs Co-authored-by: Emma <emma.mcmillan@unity3d.com> * Apply suggestions from code review Co-authored-by: Emma <emma.mcmillan@unity3d.com> * update Updating CreateObjectMessage to use the new GhostSpawnManager. Removing unused local/cached NetworkSpawnManager var. * update Re-enabling log level catch * update Moved `PendingGhostSpawnEntry` into the GhostSpawnManager.cs file. Made `PendingGhostSpawnEntry` implement `IDisposable` for simplification and best practices purposes. * Update com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransform/UnifiedNetworkTransformTest.cs Co-authored-by: Emma <emma.mcmillan@unity3d.com> --------- Co-authored-by: Kitty Draper <kitty.draper@unity3d.com> Co-authored-by: Emma <emma.mcmillan@unity3d.com> Co-authored-by: Kitty Draper <284434+ShadauxCat@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Basically just #3943 with some fixes to issues exposed by unit tests.