Experimental Network Profiler in Netcode for Entities

Dear Unity Developers,

We are excited to announce that the new experimental Netcode Profiler Modules in Netcode for Entities (com.unity.netcode@1.8.0) are now available! Please note that these new modules require Unity 6 or newer.

New Profiler Modules Overview

We are introducing two new Netcode Profiler Modules, one for the client and one for the server, which bring all the diagnostic features of the old web profiler and more directly into the familiar Unity Profiler window.

This integration creates a new workflow for optimizing your multiplayer games, organized into three distinct tabs:

  • Frame Overview: Provides a high-level summary of network activity for each frame.
  • Snapshot Overview: This tab provides a detailed breakdown of your network data via a tree view that lists all ghost types and their component types. For each item, you can inspect important metrics like size, instance count, and compression efficiency, enabling you to identify the most expensive ghost types in your simulation.
  • Prediction and Interpolation: A specialized view for debugging client-side prediction and interpolation.

How to Enable and Use the Profiler Modules

As this feature is experimental, it is currently disabled by default. To enable it, please follow these steps:

  1. Ensure your project is using Unity 6 or a newer version. These modules are not compatible with older versions of the editor.
  2. Go to Project Settings > Player > Other Settings.
  3. Find the Scripting Define Symbols field.
  4. Add NETCODE_PROFILER_ENABLED to the list.
  5. After the editor recompiles, you can open the Profiler via Window > Analysis > Profiler, select the “Client World” and “Server World” modules from the dropdown, and press Record during a play session to begin capturing data.

These new Profiler Modules are currently in an experimental phase to gather early feedback. A full, stable release is planned alongside the release of Unity 6.3 and will be compatible with all Unity 6.x versions.

Important Note for Rider Users

Rider users may encounter an exception when using the Profiler due to a known issue with Rider’s experimental Unity Profiler integration.

If you experience this, you can resolve it by disabling this integration in Rider’s settings. Please follow the instructions provided in the official JetBrains documentation to disable this feature: Unity Profiler Assistance in Rider.

We Want Your Feedback

Your feedback is invaluable to us as we work to improve this feature. We encourage you to share your feedback, questions, and experiences in this thread.

We are especially interested in hearing:

  • How does the new integrated workflow feel compared to the old web profiler?
  • Is the data presented in the Snapshot View clear and easy to navigate?
  • Are there any critical metrics or visualizations you feel are missing?

Your input will help guide the future of multiplayer development in Unity and is carefully reviewed.

Stay tuned for further updates and announcements as we continue to enhance and expand our multiplayer offerings.

The Netcode for Entities Team

10 Likes

Inspecting raw network packets in Netcode for Entities:

  • How can the raw binary data of each packet be viewed (for example in Wireshark)?
  • How can the packet type be identified (e.g., InputBuffer, GhostSnapshot, RPC)?
  • How is each packet serialized internally, and how can the bits be mapped to components?
  • Is there a recommended tool or workflow to decode packets and see both their type and contents clearly?

Hi!

The current experimental implementation only has stats for the Ghostsnapshot. We will soon add RPCs and Command stats as additional tabs in the same window.

There are currently no plans to provide inspection tools for raw network packets but we’re happy to discuss this internally. Could you share specific use cases where you have the need to decode packets and inspect the raw packet data?

2 Likes

Thanks for clarifying!

The main reason I was asking about raw packet inspection is that when I monitor network traffic externally (e.g. through Wireshark), I notice a large amount of packets being sent, but I cannot identify what type of data they represent. For example, I’m not sure if the traffic is coming from input commands, ghost snapshots, RPCs, or just general network overhead.

Without a way to distinguish packet types, it becomes difficult to understand what exactly is causing the high packet rate and how to reduce it. Many multiplayer protocols I’ve worked with in the past send lightweight keep-alive messages at fixed intervals, and then sync gameplay data in small chunks only when entities move or perform actions.

That’s why I was wondering if there’s any kind of packet ID mapping or documentation planned, so we can correlate packets with their type. This would help developers diagnose whether network “spam” is caused by gameplay data, input, or something else, and then optimize accordingly.

The format of (or encoding of) netcode packets is not written in a specification anywhere, it is hand-crafted directly in C# via the DataStreamReader and DataStreamWriter, and often changes (e.g. snapshot encoding changed slightly in 1.9.0 to improve ghostId, SpawnTick, and ghost despawn performance).

EDIT: Component serialization is code-generated, as it makes heavy use of delta-compression, quantization, huffman encoding etc. You can view this code-generated output via the Default.globalconfig file setting.

At the moment, the first payload byte (mapped to the NetworkStreamProtocol enum) denotes the type of message, but we cannot guarantee that that’ll continue to be the case (e.g. we have future plans to embed specific kinds of RPCs into the snapshot stream).

We recommend reasoning about packets via the following tools:

  1. The legacy Windows > Multiplayer > Network Debugger (Browser), which describes the content of snapshot packets, and is now replaced by this Network Profiler tool (above).
  2. Via the Packet Dump Logs option in Netcode for Entities logging, toggleable via the Window > Multiplayer > PlayMode Tools window, though the contents (and meaning) of that text dump output is hard to parse.

Netcode for Entities sends two streams continuously:

  • From client to server, an input command stream (if you have any owned ghosts containing inputs), involving a small netcode-specific header.
  • From server to client, a snapshot stream, again containing a small netcode-specific header.
    Both headers are for time synchronization purposes.

I’d recommend looking at the optimizations doc pages, to understand how to reduce bandwidth consumption significantly, as it is all configurable. E.g. If you want to only send ghost data when it changes, see Ghost - Optimization Mode - Static.

1 Like

We’re happy to announce that the Network Profiler is now an official and supported feature with the release of Netcode for Entities 1.12.0!

Check the announcement here: Netcode for Entities v1.12.0 is now publicly available

1 Like