A Low-Level Networking Framework for Unity.Website | Discord | YouTube | DocumentationSee Technical Details for compatibility and dependency information.DisclaimerNodes is a low-level networking framework that handles network transmission and payload routing within an application. It does not include prebuilt gameplay systems or networked components. Instead, it provides a flexible foundation for building custom solutions.All data structures and gameplay integration must be defined by the user. Components such as 'NetworkedTransform' are beyond the scope of Nodes. Do not purchase Nodes if you want pre-built networked components.OverviewNodes was created to avoid the constraints of opinionated networking solutions. Rather than forcing predefined models for replication, prediction, serialization, or transport, it exposes modular building blocks that can be extended, combined, or replaced.Nodes uses a composable message pipeline where router objects are organized in a hierarchical structure and exchange messages through protocols.At the top of the hierarchy, a specialized router called a Node handles remote communication. At the bottom specialized routers, called Dispatchers, can be used to create and process messages. The base Router implementation can be used to add new branches to a hierarchy.A message is composed of a route, a payload buffer, and context. A route contains local routing information and the endpoint associated with the message while context refers to additional metadata, used by routers, that travels with the message through the application but is not sent over the network.Protocols are user-defined contracts that define a process for message exchange. They can be linked together to form chains of behavior, allowing multiple protocols to run on a single router. Protocols operate independently, allowing them to be added, removed, or swapped without affecting the rest of the pipeline.Nodes is intended for users who:Need full control over networking behavior and architectureWant to build custom protocols and replication/synchronization systemsPrefer to build their own abstractions instead of using prebuilt componentsNodes is best suited for experienced developers who are comfortable designing their own networking stack and want a solid, extensible base to build on.FeaturesCustom Protocol SupportAutomatic payload serialization and deserializationZero hot-path allocations for unmanaged payloads*¹Optional concurrent processing integrated with Unity’s update loopSupports both standalone classes and MonoBehaviour components*²*¹ This guarantee is limited to the core framework. Custom protocols, dispatchers, or other user-defined logic may introduce allocations depending on their implementations.*² User-defined partial implementations determine whether a type is a standalone class or a MonoBehaviour component.Automatic byte serialization for unmanaged payloads is a feature of the core framework. The Nodes/Included folder contains a Dispatcher implementation that extends this feature to support managed payloads via JSON serialization (for prototyping purposes).MiscellaneousThe default Node implementation uses UDP. The framework is otherwise transport-agnostic. Alternative transport layers (e.g., TCP) can be introduced by replacing this implementation without affecting the rest of the message pipeline, provided such implementations correctly conform to the framework’s message semantics.Messages are implemented as ref structs to eliminate heap allocations and improve throughput in hot-paths. Because ref structs are stack-only types, they cannot be boxed, captured by closures, or stored on the managed heap. As a result, message payloads and contexts are restricted to unmanaged types by default.Contents21 class files in the core framework (with xml document API)9 Implementations of abstract classes from the core frameworkAn example scene to demonstrate sending and receiving messagesPDF documentation for the core framework and included implementationsCompatibilityPlatforms: Windows and LinuxFramework Target: .NET Standard 2.1Scripting Backends: Mono and IL2CPPCore DependenciesSystem.Runtime.CompilerServices.Unsafe (included in Nodes/Core)Additional DependenciesNewtonsoft Json for Unity "com.unity.nuget.newtonsoft-json" (installed via the Unity Package Manager)JilleJr Newtonsoft.Json-for-Unity Converters for Unity (included in Nodes/Included/Dependencies)Additional dependencies only apply to content within Nodes/Included, which provides optional implementations and examples. The Nodes/Included folder can be removed without impacting the core framework.



