Multiplayer Project for Production
Have you eagerly started a Unity multiplayer project after working through Netcode tutorials that made you feel like this is easy-peasy?
But then you run into inexplicable, random issues all the time?
Write Better Netcode introduces you to writing production-ready Multiplayer game code!
We’re going to re-create my MultiPal project with Statemachines:
Write Better Netcode Articles
-
1. Introduction (Write Better Netcode)
Write Better Netcode! Have you eagerly started a Unity multiplayer project after working through Netcode tutorials that made you feel…
-
2. Project Setup (Write Better Netcode)
Netcode Project Setup with Unity 6 I find it important to manage packages and settings first before starting to work…
-
3. Scene Flow (Write Better Netcode)
The Scene Flow Now we’re starting with a fundamental concept: Scene Flow. Let’s talk about when to change scenes and…
-
4. Netcode Statemachine (Write Better Netcode)
I finally cracked the flow of starting / stopping Netcode, with or without Relay, with all potential failure cases handled:(click…
-
5. Netcode With Relay (Write Better Netcode)
After I explained the Statemachine system in-depth in the previous article, it’s time to deep-dive into code details and the…
-
6. Launch Netcode Multiplayer Playmode (Write Better Netcode)
Launching a Netcode session in the Write Better Netcode project can be done in not one, not two, but three…
-
7. Launch Netcode GUI (Write Better Netcode)
I create all Unity GUIs with UI Toolkit and UI Builder because it’s so easy to use and powerful. In…
-
8. Spawn Players (Write Better Netcode)
Spawn players? Add the player prefab to NetworkManager‘s Default Player Prefab, done. Nope! We’re literally going to spawn multi-players per…
-
9. Select Player Avatar (Write Better Netcode)
Now that we can spawn players, we want to have a selectable Avatar. The Avatar is the visual representation of…
-
10. Assign Input Devices
With multiple (splitscreen) players on a single machine, each player has to have its own Input device. You may be…
Bonus Articles (Appendix)
I tend to deep-dive into specific topics while writing an article, only to find out that it would be too distracting or off-topic. I publish those articles separately from the series.
These articles explain related networking topics:
- The Components Registry
- Why Netcode Is Statemachine Code
- How NAT Hole Punching Works
- TCP, UDP, WebSocket Explained
- Unity Gaming Services Cost Calculator
These are articles I’ve written before I started the Write Better Netcode series. They are not quite as high quality as what I’m writing currently but they do contain valuable info:
Don’t Miss An Article!
Join my Patreon to get notified! New articles appear twice a month, with occassional devlogs for Patreons.
Following are more details about the Write Better Netcode series:
Not A Beginner’s Tutorial
Anyone can GameObject.Find(“Player”)
and get going. That tutorial was easy enough, so the rest can’t be that hard either. Right?
Well, no …
We game developers do not spend enough time to create a solid foundation. So the more we build on top of our game, the more it starts to crumble and fall apart.
Instead, Write Better Netcode is about building a foundation designed to support a wide variety of both networked multiplayer, splitscreen and singleplayer games.
I prefer to be very thorough, thoughtful, weigh and explain intricate details, apply discipline. As game developers, we are rarely afforded the luxury to do so.
That’s why we’re crunching so much! Among other things …
GitHub Repository
The WriteBetterNetcode GitHub repository contains the current state of the project. Tags are used to mark progress.
Please mind the project’s GNU GPL3 license. It’s a copyleft license which means the project can be used as follows:
- Privately, to study and learn.
- Publicly, provided you also publish your entire work in working form to the public under the same GPL3. (*)
- Unrestricted, by becoming a patron.
I trust you and I hope you value my work! 🙂
(*) Note: Most digital store’s terms are in violation of the GPL3 license terms, thus forbidding apps that include GPL3 software.
Project Plan
I use PivotalTracker to manage tasks and bugs and lay down a roadmap (Epics).
The MultiPal board is publicly accessible here.
PT has been my preferred tool for over ten years now, and I’ve evaluated and worked with many, many others (Jira, Bugzilla, Shotgun, Hansoft, Monday, GitHub, etc). I love PT for its simplicity and directness.