Ultimate Multiplayer | Dedicated Server | Tutorial Series

Stefan_GameDevStefan_GameDev Posts: 89Member
edited October 2020 in Tutorials

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.

Comments

  • Stefan_GameDevStefan_GameDev Posts: 89Member

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

  • Stefan_GameDevStefan_GameDev Posts: 89Member

    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.

  • Stefan_GameDevStefan_GameDev Posts: 89Member

    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.

  • Stefan_GameDevStefan_GameDev Posts: 89Member

    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.

  • Stefan_GameDevStefan_GameDev Posts: 89Member

    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.

  • Stefan_GameDevStefan_GameDev Posts: 89Member
    edited October 2020

    I will add to this list as more episodes come out, currently doing one a week.

    Make sure to subscribe
    https://www.youtube.com/c/GameDevelopmentCenter/?sub_confirmation=1
    Or join the community on YouTube to support the tutorial creation process and get access to the code
    https://www.youtube.com/c/GameDevelopmentCenter/join

  • Stefan_GameDevStefan_GameDev Posts: 89Member
    edited October 2020

    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.

  • Stefan_GameDevStefan_GameDev Posts: 89Member
    edited October 2020

    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.

  • Stefan_GameDevStefan_GameDev Posts: 89Member
    edited November 2020

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

  • Stefan_GameDevStefan_GameDev Posts: 89Member
    edited November 2020

    Give players the option to make their own accounts

  • Stefan_GameDevStefan_GameDev Posts: 89Member
    edited November 2020

    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

  • Stefan_GameDevStefan_GameDev Posts: 89Member
    edited December 2020

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

  • Stefan_GameDevStefan_GameDev Posts: 89Member
    edited December 2020

    Syncing players up using world_state snapshots

  • Stefan_GameDevStefan_GameDev Posts: 89Member
    edited December 2020

    Using interpolation to smooth the movement of other players

  • Stefan_GameDevStefan_GameDev Posts: 89Member
    edited December 2020

    Extrapolating when our connection was hanging or packets were lost

  • gargaragargara Posts: 3Member

    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.

  • Stefan_GameDevStefan_GameDev Posts: 89Member

    @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 :)

  • Stefan_GameDevStefan_GameDev Posts: 89Member

    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.

  • Stefan_GameDevStefan_GameDev Posts: 89Member

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

  • Stefan_GameDevStefan_GameDev Posts: 89Member

    Synchronizing the clocks of all clients to the server clock

  • Stefan_GameDevStefan_GameDev Posts: 89Member

    Videos for

    • Spawning players
    • syncing players
    • Interpolation
    • Extrapolation
    • Clock Synchronization

    have all been added to the list

  • Stefan_GameDevStefan_GameDev Posts: 89Member

    Spawning server-side enemies that are governed by the server

  • Stefan_GameDevStefan_GameDev Posts: 89Member

    Syncing the animations across clients for both idle/walk/shoot

  • Stefan_GameDevStefan_GameDev Posts: 89Member

    Creating server maps to remove hit detection from the client (this way the player can't fool the server anymore about what it hits)

  • Stefan_GameDevStefan_GameDev Posts: 89Member

    And the implementation of that server-side hit detection

Sign In or Register to comment.