uni-networking is my personal attempt at building a custom networking library. The idea originally came from wanting to develop a multiplayer game. While working on the design and architecture of the code, I started looking into existing third-party networking packages. But as I compared them to the structure I had in mind, I kept running into limitations. None of the options I found really aligned with the workflow or architecture I envisioned. So, rather than trying to force an existing solution to fit, I figured it might be worth trying to build something from scratch, something that could match my specific goals more closely.
As a starting point, I wanted the library to behave similarly to a signals package I had previously built. That package allowed for sending local signals within a project, and the idea here was to take that same concept and expand it so that the messages could be sent over a network. This would allow for a clean separation between events that happen locally and those that need to be communicated across clients or between client and server.
With that concept in mind, I began by adapting the event functionality from the signals package. Once that core part was working, I moved on to laying the foundation for the networking layer itself. The initial setup came together relatively quickly, and before long, I had a basic prototype up and running. The first version used TCP for all network communication, which was totally fine for the original purpose, it was meant to be used in a turn-based game, where speed and real-time responsiveness aren't as critical.
However, alongside the library, I was building a demo/test project that happened to be a first-person shooter. That’s when the limitations of TCP became clear. It was just too slow and inconsistent for handling constant real-time movement, which led me to rethink the architecture a bit. The next step was to abstract the transport layer so I could swap out the underlying protocol more easily. This led to building a separate UDP transport that could be plugged in as a drop-in replacement for the TCP logic, giving me more flexibility depending on the needs of the game.
The library originally started with Unity in mind, so the structure and layout followed what you’d expect from a Unity package. But as I kept working on it, I realized that none of the code actually relied on Unity-specific functionality. That discovery opened the door to making the library usable in other .NET environments as well. With a few adjustments, it now compiles and runs independently of Unity, making it a more versatile solution overall.
The package and source code can be found here.