NETWORKING - How to set up a large networking system? (Large general question)

CastorCastor Posts: 1Member

Hello, fellow Godoters! I've been playing around with the networking features of Godot lately and I've build my first multiplayer game. It's a 5-in-a-row game where one player can host a game and another can connect, by pressing a "host" and a "join" button respectively. It works fine! but now I want to expand! I've done a lot of research but I haven't found anything that could help me to achieve what I want with my game, so maybe some of you might know what I should do. Here is what I'm thinking:

Imagine the 5-in-a-row game (or any other simple PvP game): I want people starting the game to be able to log in to their own client of the game so that they join a dedicated server set up for the whole game, sending them to a lobby where they can see who else is online. Then they should be able to host their own 1v1 games which anyone else online can join if they want. People should be able to interact with each other by joining each other's games and chatting with each other.

To achieve this I imagine some steps:

  1. Actually build the game (done)
  2. Set up an auth-system for login/registration of users (done with Firebase)
  3. Set up the server so that it fits the description of functionality above (NOT DONE)
  4. Move the server to some form of hosted service so that I don't have to run it on my computer (NOT DONE)

I know this is a large question and it might not be possible to answer it on a forum like this, but maybe some of you could point me in the right direction for achieving this and solving all of these steps? Thank you in advance!

Comments

  • BimbamBimbam Posts: 20Member
    edited June 25

    I have no experience with setting up networking in Godot specifically, but as an ex(mostly)-devops type I would imagine one solution would be to setup a REST/CRUD SQL API and then query this from within Godot which I assume it can do. If it can't specify request method in the HTTP header that's not really an issue, you just make a specific character in the URL perform the same task such as /r/ for read and so on and catch this in the API server code).
    Could achieve this with postgresql for the DB (or mysql, mongo, whatever, I just prefer postgres myself), and Python/Flask to handle the API layer for a lightweight Linux solution (all free), and host in AWS on their free tier and scale as required. There are plenty of other ways this could be done though from a platform perspective if your preference is something like PHP or Node for example.

    Essentially all the server is doing is storing endpoint information and acting as an arbiter between players to make their own game as in the days of old, so the actual 'cost' of the server should be tiny.

    Depending on how many players you expect to get and just how global you are expecting, you could then scale to multiple geographies as required, which would make the lobby more responsive and ensure players are generally only connecting with other people from their locality to mitigate ping/language issues, though this would be part of the Python API server code anyway if well thought out.

    However, bear in mind the above is basically unicorn stuff. I.E, it's rare for one person to know how to do the entire thing as each step is in itself it's own career path (DB design/management/configuration, Python API development and to some degree web design or at least web security principles, and cloud server management).
    That's not to say one person can't do it, I can and have, and it is not necessarily even hard; but to be fair I also worked in the field for 5-10 years. If you don't know what any of the above is though.... urghhh.... maybe wait for someone else to comment with a better solution ^^. Otherwise your more likely to do more harm than good leaving an unsecured AWS instance exposed to SQL injection and such for dem hungry hackers.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file