I have followed at least half a dozen tutorials like this:
Here is that one on github. No game code, only network code. I want to see "player connected" or whatever before I start making it more complicated with game code.
A few things I have done:
- Run
netstat -a -p UDP
to verify that the port is being listened on. (More on this below)
- Verified that file names and paths are the same on client and server (I don't know how much this matters, but people keep saying it)
- Verified that I can connect to the port I want to use (3234) by running
netcat -l 3234
on the digital ocean droplet, and then connecting to that with telnet <ip> 3234
on my windows machine.
- Enabled+opened ports with ufw, as well as attempted with ufw completely disabled. No difference
- Tried specifying binding ip address in the server code, no difference
- Moved all variables inside the relavant connection function, no difference. (Idk why this would make a difference but someone mentioned it somehwhere so I tried it)
- Verified that running the server and client on the local machine with ip=127.0.0.1 works (used different network debug ports in the projects to view both logs)
The only difference I have noticed is this:
The first line is when I ran the server on port 3234. The second line is when I ran a netcat udp server on 3234 instead. You can see one has [::]:3234, and the other has 0.0.0.0:3234. It seems the 0.0.0.0 option works (netcat) and the [::] option does not work (server).
I REALLY want to use Godot's High Level Multiplayer functionality, but at this point I feel I may need to try a 3rd party game hosting solution.
If anyone can help me solve this, I would greatly appreciate it, and I hope this can help someone in the future. If I solve this, I will make a quick tutorial on YouTube demonstrating how to do this WITH A REMOTE SERVER, as that is the part every online tutorial neglects. They just leave you at the localhost step and never address a remote host, which is the only reason anyone would want to make a multiplayer game.