Unity Netcode Announcements

For the latest 7.2.0 version introducing GameObject support, please see Prediction in GameObject Netcode - GhostObjects Released

Netcode for Entities 7.0.0: moving back to an independent package in Unity 6.7

Hello everyone!
We have an important update on how Netcode for Entities is delivered, starting with Unity 6.7.

The short version

  • From Unity 6000.7.0b1, Netcode for Entities ships as an independent package again, rather than a bundled core package.

  • The first independent release is 7.0.0. It includes a small set of breaking changes, most of which the script updater handles for you.

  • Unity 6.7 LTS gets the new stuff. As we build the next generation of Unity Netcode, new features land on 6.7 as they’re ready, not at the next major Editor release.

  • Nothing changes for Unity 6.0, 6.3, 6.5 and 6.6.

Moving back to an independent package in Unity 6.7

Starting with Unity 6000.7.0b1, Netcode for Entities will become an independent package again, rather than a bundled core package. The first independent version of Netcode for Entities will be package version 7.0.0.

We know this may feel like a U-turn. As explained in an earlier Discussions post, Netcode for Entities became a core package in Unity 6.5 due to difficulties integrating with the Entities package, which had itself become a core package in the same release. The team has since developed a technical solution to solve these issues.

So why move back? Being independent of the Unity Editor release cycle allows us to ship features and fixes faster to a wider range of supported Editor versions, instead of being locked to a specific Editor version. By making this change now, you can gain access to the new GameObject workflows much sooner, rather than waiting for the next Long-Term Support (LTS) release.

As we mentioned at Unite Seoul, our plan to bring Unity’s netcode solutions together under one roof is well underway. The next generation of Unity Netcode will support both data-driven and object-driven workflows on a single shared foundation, and we’ll share more details as we get closer to Unity 7.

Breaking changes in Netcode for Entities 7.0.0

The major version bump reflects changes that prepare Netcode for Entities for the next generation of Unity Netcode. The upgrade guide has the full details, here’s the summary.

  • World → NetcodeWorld. APIs that require a world containing netcode systems (such as ClientServerBootstrap.ClientWorld and ClientServerBootstrap.ServerWorld) now take or return NetcodeWorld. Passing a plain World used to fail at runtime with confusing “missing component” errors; it now fails at compile time. NetcodeWorld derives from World, so most call sites keep working. Return types and collections (List → List) need a manual edit.

  • NetCode → Netcode. To standardize naming conventions across all Unity Netcode solutions, NetCode is normalized to Netcode across namespaces and types. Additionally, NetworkTime and NetworkTimeSystem have been moved to the Unity.Netcode.NetcodeTime namespace. These changes form part of a broader, long-term initiative to unify Unity Netcode architectures, ensuring consistency and preventing potential type collisions when multiple packages are used together. Both changes carry [MovedFrom] attributes and are migrated automatically by the script updater. As we mentioned at Unite Seoul, our plan to unify and merge netcode solutions under one roof is in progress, and we’ll share more details as we get closer to Unity 7.

  • AutoConnectPort defaults to a non-zero value. ClientServerBootstrap previously defaulted to 0, which created netcode worlds but did not connect them. When using client and server worlds in a binary setup, this meant starting with nothing rendering, forcing users to set the port in code. It now defaults to a non-zero value so a new project connects and renders out of the box instead of creating worlds that never connect. You can still override it.

  • Single-world host mode is the default for new projects, and its experimental define is removed. See the single-world host mode documentation for details, including how to switch back to binary-worlds hosting.

What do you need to do?

  1. Let the script updater run when prompted. It handles the namespace changes.

  2. Fix the World → NetcodeWorld errors the compiler flags. This is usually a one-word edit.

  3. Read the upgrade guide for the full details of what’s involved in upgrading.

Editor and version support

  • Unity 6000.7.0b1 is the minimum supported Editor for Netcode for Entities 7.0.0. The package is in the Editor manifest, so projects moving to 6.7 pick it up automatically.

  • Unity 6.5 and 6.6 keep their bundled core version. Both are approaching the end of support, so no major changes or backports are planned for them.

  • Unity 6.3 continues being supported by Netcode for Entities version 1.x

FAQ

Q: Why 7.0.0 and not a 2.x release?

A: As a core package, Netcode for Entities followed Editor versioning (6.5.0, 6.6.0). Package Manager only moves versions upward, so a lower number would break every project upgrading to 6.7. 7.0.0 is the first version that works.

Q: How does this work while Entities is still a core package?

A: We’ve built tooling and validation that lets the two teams collaborate closely while releasing on different schedules.

Q: Do I need to change anything on Unity 6.0, 6.3, 6.5 or 6.6?

A: No. The change applies from 6000.7 onward.

We appreciate your support as we improve our Netcode solutions. Please provide feedback or questions in this thread and the team will be happy to respond.

9 Likes

Are there any specific update steps to consider for users who have their project built with Unity 6.5 or 6.6 (NfE core module) and wish to upgrade to 6.7 (NfE package)?

I suppose updating / adding assembly definition dependencies for the NfE package might suffice, but perhaps there’s more to it.

This “technical solution” is something that is only applicable to netcode or is something that could be extended to other areas of the engine?

Are there any specific update steps to consider for users who have their project built with Unity 6.5 or 6.6 (NfE core module) and wish to upgrade to 6.7 (NfE package)?

If your project manifest already had N4E in it (from 6.5 or 6.6), it will automatically update it because the Package Manager should correctly picks up the new (higher) package version from the editor manifest now that N4E is no longer a core package (upon installing 6000.7.0b1+ editor as we updated the editor manifest there).
Of course, it’s always worth double-checking that the N4E v7.x dependency was picked up correctly but assuming it was, the only manual step you’ll need to take is to follow the N4Ev7.0 upgrade guide to account for the breaking changes mentioned.

This “technical solution” is something that is only applicable to netcode or is something that could be extended to other areas of the engine?

In theory other core packages could also transition back to regular package now but that always depends on product needs so I can’t really say anything for the others (Netcode was in a particular situation with all the circumstances around us). Also this was very much part of internal goal of bringing all packages closer together and not affecting existing core-packages so I wouldn’t put too much focus on this right now

3 Likes

Tell us more … :smiling_face_with_sunglasses: :wink:

1 Like

There seems to be some prediction problems in Editor not sure if some API changed not listed in changelog, the movement on previous version was totally smooth, on new version it seems that client does not predict anything and gets TPd back in Time. Had no time yet to test it on live server if its just local problem or anything more.

Previous version was on 6000.7.0a6 - Package 6.7.0
This version is 6000.7.0b1 - Package 7.0.0

  1. No code was changed other than automatically updated Namespaces

  2. Global NetcodeConfig.asset was modified set Host World Mode Selection to BinaryWorlds

  3. Bootstrap disables autoConnectPort to 0:

[UnityEngine.Scripting.Preserve]
public class GameBootstrap : Unity.Netcode.ClientServerBootstrap
{
    public override bool Initialize(string defaultWorldName)
    {
        AutoConnectPort = 0;
        return false;
    }
}
  1. I am creating worlds using:
NetcodeWorld serverWorld = ClientServerBootstrap.CreateServerWorld("ServerWorld");
NetcodeWorld clientWorld = ClientServerBootstrap.CreateClientWorld("ClientWorld");
  1. Connecting Server-Client using:
using var query = serverWorld/clientWorld.EntityManager.CreateEntityQuery(ComponentType.ReadWrite<NetworkStreamDriver>());
var driver = GetSingletonRW<NetworkStreamDriver>() // Getting Driver

driver.ValueRW.Listen(endpoint); // Server World
driver.ValueRW.Connect(endpoint); // Client World several frames later

Lags/Misprediction Problem:

For a Test I also tried changing the Delta in movement system in PredictedFixedStepSimulationSystemGroup from:

ClientServerTickRate.SimulationFixedTimeStep
to
SystemState.WorldUnmanaged.Time.DeltaTime

as I heard that time is predicted and updated by Netcode but it has identital value and results in same problem.

To be honest I would like every package to be independent package. I wish we wouldn’t have core package at all

There’s a note in the upgrade guide, we have to be careful around dependencies between systems. Entities uses the hash of your system’s full name to order them when you don’t have UpdateBefore/After setup. It’s basically randomizing your system order. Netcode updated it’s namespace which means a reshuffle of netcode system hashes. If you haven’t setup proper UpdateBefore/After, you might see behaviour changes.
That’s one thing that comes to mind that could cause behaviour changes like this. Make sure to review your system order and if that doesn’t fix it, please raise a bug with “Help/Report a Bug”

2 Likes

:package: Netcode for Entities 7.1.0 is now live! :package:

The headline of this release is the new Prediction Tracing Tool, which you can use to identify prediction issues and find out which system caused a client’s predicted state to diverge from the server’s authoritative state. Refer to the Prediction Tracing Tool page in the documentation for more details.

If you’ve been using the Prediction Tracing Tool in its experimental state, you can now remove the experimental defines from your project.

The team has also been making progress towards a more cohesive Unity Netcode with fixes and improvements to existing code.

Added
  • Prediction Tracing Tool: use this tool to debug your prediction loop, diffing the client and server state per predicted tick and system for an in-Editor binary world setup.
Changed
  • Updated single-world host smoothing to be disabled by default for ghost prefabs.

  • The methods in DefaultDriverConstructor don’t need their INetworkInterface arguments to be unmanaged types anymore. This is in line with the same relaxation having been made in the Unity Transport package.

  • The snapshot synchronization system (optionally) no longer considers an unknown ghost type received on clients as an immediate fatal error. There’s a new configurable timeout value NetcodeConfig.GhostPrefabLoadingTimeout which controls when this should be considered a fatal error. It also allows the client to destroy a ghost type (like unload a subscene with ghost prefab references) ahead of the server.

  • SnapshotHistorySize is now configurable on a per-ghost-type basis, allowing you to reduce the memory consumed by a ghost’s snapshot history for ghosts sent below the default 60Hz. The recommended value (and its tooltip) is visible in the ghost authoring UI.

Fixed
  • The GhostAuthoringInspectionComponentEditor no longer throws exceptions when it’s open while exiting Play mode.

  • NetworkStreamDriver.Disconnect always disconnected on the first driver of the NetworkDriverStore instead of the driver the connection was established on. With more than one driver registered, this left the requested connection connected and could close an unrelated one instead.

  • Removed an infinite retry loop in GhostSendSystem’s snapshot send loop: a BeginSend failure other than NetworkPacketOverflow (most commonly NetworkSendQueueFull) was never treated as fatal, so the job spun forever and hung the server instead of aborting.

  • Prespawned ghosts that became irrelevant occasionally failed to become relevant again for a connection. A despawn still held for the interpolation delay could resolve onto the re-spawned entity and destroy it.

  • GhostDespawnSystem now accounts for the fractional part of NetworkTime.InterpolationTick, so interpolated ghosts no longer despawn up to one tick ahead of the timeline the rest of the interpolation pipeline uses.

As always, we’d love to hear your feedback and questions —> drop them below! :grin:
We are making the announcement here as the 6000.7 editor with which the package is compatible is still in beta phase so we will reiterate those changes once it gets released as official LTS

Happy Netcoding!

2 Likes

Hey folks, new post for this release, as it’s a big one. You can check it out here.