• Tutorials
  • Ultimate Multiplayer | Dedicated Server | Tutorial Series

When I started out learning Godot multiplayer myself I found a massive lack of resources that teach proper network architecture and how to set that up for dedicated servers. I understand why though, it is a deep rabbit hole to dive into. So that sounds like a perfect challenge for me :)

In this tutorial, you will not only learn how to make use of an RPC call to connect a client and a server and get some bullets flying around. I will teach you a proper, scalable network architecture, that has all the ingredients it needs for the secure handling of passwords and other private data that we as developers are responsible for keeping safe.

Couple of things to keep in mind: 1) Although scalable, and when expanded able to handle up to (tens of) thousands of connections. Don't think this is going to be a 'how to make WoW' with a million concurrent users. That requires an entire rethink of the network, but this is going to be enough for starting developers all the way up to an established IndieDevs. After that, go hire a network specialist. 2) I'm going with a Godot-only approach here. Yes, you can also throw a node.js or something else in. That is not the point of this tutorial, + Godot's ENet integration is one of the most efficient and elegant I have seen. So you will be fine. 3) I may in the future dive into SQL-tutorials for the database backbone, for now, we will take it easy. Let's first have you learn networking, security, syncing, and network patterns before we also have you learn SQL. Walk before attempting to run.

Part 1: the basic connection nearly all other tutorials teach you, got to start somewhere right :)

Part 2: how to structure all those functions on your server to not have everything clogged up within 2 months of development. Got to keep things manageable and maintainable.

Part 3: how to have a player login to the network. Although easy with one server, having only 1 server exposing your network to all sorts of attacks and it is just very very very bad practice. Don't do it, take responsibility as a dev. So we will start working on our network, and do it the proper way.

Note: this does not include security yet like hashing and salting your passwords or protecting your authentication server with, for example, VPN and/or IP filters. Those will be future videos.

Part 3B, if you don't know how to make a login screen yet, haven't dabbed into the UI creation of Godot? I got you covered, learn how to make that login screen in just a couple of minutes.

Part 4: now that I got you all bored with network stuff, let's take a break from that and learn how we are going to handle player data.

Announced in earlier video, your network architecture will have to be determined by the type of game, and the type of player interaction. Learn about server limitations, and how to take these limitations into account when you design your network.

We are going to highly secure the network from outside intruders and people that are after our player's passwords, but we can't run highly encrypted communication between our players and our game servers. That would create to much latency. Therefor we use token verification to ensure only authorized players can log onto our game servers.

Time to secure the connection between clients and gateways so packet sniffers and man in the middle attacks are a thing of the past

Give players the option to make their own accounts

Saving 'naked' passwords is always a bad idea. Use hashing and salting to ensure that if a database is leaked/stolen. The data will still be useless

Time to get into the fun stuff =) Spawning other players into the map

Syncing players up using world_state snapshots

Using interpolation to smooth the movement of other players

Extrapolating when our connection was hanging or packets were lost

7 days later

Thank you Stefan! I found all of your tutorials to be the best source for practical, in-depth and real game building with Godot. Combine with the fundamentals and theory tutorials of the channel Godot Tutorials, it is the best way for me to understand the platform. Please keep up with the good work.

@gargara said: Thank you Stefan! I found all of your tutorials to be the best source for practical, in-depth and real game building with Godot. Combine with the fundamentals and theory tutorials of the channel Godot Tutorials, it is the best way for me to understand the platform. Please keep up with the good work.

Thank you Gargara! Messages like these always make me start my day with a smile on my face :) Hope you will find future content equally useful :)

9 days later

I've added two more videos to the video list above. Already working on the next video for DTLS/SSL certificate encrypted communication for our players to login securely.

a month later

Videos for DTLS, Account Creation, and Hashing & Salting have been added