setting a master server in goddot

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By soulldev

Hello!

I looked through Godot high level networking API, and got it working on my local network, i also tried port forwarding/upnp and it worked too. Although i want to set my game to a VPS server like AWS/Azure VPS, i didn’t see anything about how to connect all the players to that server and manage them, is it as simple as getting that server IP, PORT and using it with NetworkedMultiplayerENet ? or does it require Network Programming, setting a database for players…etc.

:bust_in_silhouette: Reply From: Asheraryam

You can setup a godot server on AWS or Google Could with no extra work, you only have to open a port in the cloud and give the server IP to the client. You can open the ports from the GUI setup before launching the server, so it is very easy.

This tutorial series I found has an example on how to use Google Cloud to put your server online in less than 5 minutes. I use AWS and it’s also very easy, let me know if you get lost.

You do not need networking programming since all of that is handled by godot, and you only need a database if you want a database, but it is not necessary since you can store the data regularly using serialization: how to save games.

Thank you for your answer, i followed the tutorial but with Microsoft azure instead of Google cloud and installed godot server on my VM.

Now i’m confused about the pck file, i tried to export the Server project as pck and moved it to my VM, it has the exact same name and directory but after running

./Godot_v3.1.1-stable_linux_server.64 --main-pack Server.pck

I got the error :

    ERROR: _setup: Condition ' !ok ' is true. returned: ERR_CANT_OPEN
   At: core/project_settings.cpp:327.
Error: Could not load game data at path '.'. Is the .pck file missing?
ERROR: Error: Could not load game data at path '.'. Is the .pck file missing?

soulldev | 2019-11-07 16:14

instead of typing --main-pack Server.pck try --main-pack ./Server.pck

Asheraryam | 2019-11-07 17:35

tried to change it to

./Godot_v3.1.1-stable_linux_server.64 --main-pack ./Server.pck

the same error appeared, maybe there’s some problem with exporting…

soulldev | 2019-11-07 19:46

If you type ls in the terminal and the file Server.pck is there in the directory and it’s not reading it, then I’m not sure yeah it could be a problem with exporting.

Asheraryam | 2019-11-07 19:55

Finally, it worked! … don’t know how exactly but that’s what i did :

  • I changed my SSH program to MobaXterm

  • then i renamed Godot_v3.1.1-stable_linux_server.64 to godot.64

  • i made sure that i type the command correctly from the first time, if there was an error i had to restart the VM machine
    then, i ran :

    $ chmod u+x godot.64
    $ ./godot.64 --main-pack server.pck

soulldev | 2019-11-08 07:09

Hey bro can you write up about how to deploy your server on aws?

Ca1 | 2020-12-17 00:52

:bust_in_silhouette: Reply From: Hamad Marri

you need to install godot-server in your server. And I believe you need godot-headless (no gui) to compile your game in the server. Read more about godot-server and godot-headless