Explore the latest tech available within the Unity ecosystem to create your multiplayer game – from netcode SDKs to tooling support.
Multiplayer game development has been on the rise for years, and Unity developers are right there with it. According to our 2022 Multiplayer Report, there has been 150% growth in PC multiplayer titles and 40% in mobile multiplayer titles made with Unity since January 2021.
However, support for multiplayer game creation within Unity has often required third party tools to support certain game types.
As of today, developers have access to Netcode for GameObjects (NGO) 1.0, going hand in hand with the new Multiplayer Solutions from Unity Gaming Services, including Game Server Hosting (Multiplay) and Matchmaker. These tools, combined with our samples and guides, will accelerate your multiplayer game development with Unity.
At Unity, we aim to contribute to the rise of online games with a series of out-of-the-box solutions – however, like any multiplayer framework, these solutions are not one-size-fits-all.
That’s why we designed our solutions to mix and match with third party tools so you can build the tech stack that fits your team’s needs. For instance, feel free to check our Battle Royale sample with Photon.
Now let’s dive into Unity’s multiplayer game development solutions – covering netcode SDKs, tooling support, low-level networking, and server runtime capabilities.
Whether you are a GameObjects developer or an Entities early adopter, we have an out-of-the-box netcode solution for your next multiplayer project.
Netcode for GameObjects is a networking library built for the Unity game engine. This release primarily focuses on creating small scale cooperative games, and Netcode for GameObjects pairs well for P2P games in this category with the Unity Relay and Unity Lobby solutions.
This is a foundational release that you can rely on to keep your simulations synchronized with support for scene management, animation, physics, and more.
As we work on new scenarios, we would love to hear what you need from us for your project. You can view and vote on our roadmap items to get involved in the development journey of Netcode for GameObjects.
Get started with Netcode for GameObjects by following our installation guide.
“Leaving the source code open and being active on their Discord helped build a strong community that shares experiences and support which in return helped them drive NGO's development from real life video game project needs. In my opinion, NGO is a real open source development success story." – Marc-Antoine Fortier, CTO, Fika Productions
At the other end of the multiplayer development spectrum is Netcode for Entities. This ships as part of our DOTS ECS (Entity-Component-System) feature set, empowering you to create scalable multiplayer worlds for your players.
ECS for Unity is a new framework enabling you to build more ambitious and larger scale games with Unity and will be available with Unity 2022.2 Tech Stream. Check out the latest progress in our DOTS Beta Forum, where you’ll find a roadmap and information about the latest release, DOTS 0.51.
Multiplayer game developers have to navigate network design and reliability challenges, and it’s critical to have simple ways to ensure that any potential issue is tracked, identified, and diagnosed as fast as possible.
Now, you have access to the following updates in our tooling space:
Stay tuned as we bring you more consistency across the GameObjects and Entities experiences, an enhanced network latency simulator for networking novices, and more features to improve your multiplayer development experience.
For developers that want to maintain fine-grain control over the network operations, you can rely on the Unity Transport (UTP) package. Both Netcode for GameObjects and Netcode for Entities leverage UTP under the hood, but UTP is netcode-agnostic and can be used directly or with other netcode solutions.
UTP extends the conventional user datagram protocol (UDP) with advanced features such as support for Unity Relay, datagram transport layer security (DTLS), and pipelines.
Out of the box, it comes with a large range of supported platforms, including:
UTP can also be easily configured to offer secure data transmission over the network.
Ready to dive in? See how some of our offerings work together and get started exploring our networking tools in production-ready environments with our multiplayer samples.
Boss Room is a 3D small scale cooperative game sample project – built with Netcode for GameObjects, Relay, and Lobby – designed to be used in its entirety to help you explore the concepts and patterns behind a multiplayer game flow. The combination of these tools from UGS give a solid foundation for cooperative game development, and developers can dive into Boss Room’s open source code to see how it all fits together.
Explore Boss Room’s code to learn more about how to implement character abilities, using casting animations to hide latency, replicating objects, leveraging RPCs, and more.
Blast off to space in Galactic Kittens to explore networking patterns in a 2D fixed shooter game. Galactic Kittens uses basic Network Manager settings and is designed to help you learn how to apply and synchronize sprite animations, particle effects, and basic 2D movement.
Eager developers can get more granular with our bitesize samples to pull apart different aspects of Netcode for GameObjects.
Our Invaders Sample is a simple networked cooperative game where players work together to defend against alien invaders. This sample helps you understand game flow and modes with Netcode for GameObjects (NGO); use Scene Management, Unconventional Movement Networked, and a shared timer between clients updated client-side with server-side seeding.
These techniques allow, for example, a simple way to implement a game lobby where players can join before the game starts.
Also built on NGO, our 2D Space Shooter Sample provides examples of physics, player health, and status effects. The sample's technical features include NetworkVariables and ObjectPooling. Using these NetworkVariables, you can easily synchronize states between your server and your clients, such as players' health. ObjectPooling allows for frequent reuse of objects, creating performance benefits in a networked environment.
Multiplayer development is complex, and we aim to build out our multiplayer tools and solutions to support any type of game your team dreams of creating.
If you have any feedback or suggestions for what features and tools we invest in next, don’t hesitate to vote on and share your ideas on our roadmap. Plus, check out our other multiplayer tools to get your players online, connected, and communicating with Unity Gaming Services.