GML Networking Tutorials (GMS 2 and 1.4)

Bentley

Member
Excellent tutorial as usual.

I am completely new to networking. I got one game to host but the other can't join. My computer freezes at "network_connect(...)".
Maybe I'm using the wrong port number? I googled "how to get my port number" and used the command prompt and got multiple port numbers. I just picked one.

Me = bad at this stuff.

Any ideas where I'm going wrong?
 

matharoo

Udemy Instructor
Excellent tutorial as usual.

I am completely new to networking. I got one game to host but the other can't join. My computer freezes at "network_connect(...)".
Maybe I'm using the wrong port number? I googled "how to get my port number" and used the command prompt and got multiple port numbers. I just picked one.

Me = bad at this stuff.

Any ideas where I'm going wrong?
Try port forwarding. But even that isn't guaranteed to work since some ISPs use, uh, weird stuff.

Easiest way to make it work would be to host a dedicated server somewhere and have your players connect to it.
 

curato

Member
Yeah I usually find that if you are doing anything beyond basic internet usage it is best to buy your own modem to avoid issues like that, but you can't assume everyone will do that.
 

Xer0botXer0

Senpai
Excellent tutorial as usual.

I am completely new to networking. I got one game to host but the other can't join. My computer freezes at "network_connect(...)".
Maybe I'm using the wrong port number? I googled "how to get my port number" and used the command prompt and got multiple port numbers. I just picked one.

Me = bad at this stuff.

Any ideas where I'm going wrong?
As far as I'm aware the port number is the same port number you use when you're hosting the server.
Only then if you can't connect do you consider port forwarding.


@matharoo
What is the question mark parameter [? "socket"] ?
 
Last edited:

dadicool

Member
Hello,

Thank you, it helped me a lot! Saw a lot of tutorials for networking but this one was the best for me.

Is someone know a solution to launch a server app made with GMS2 but without graphics? Like a simple command line server.
Thanks!
 

matharoo

Udemy Instructor
Hello,

Thank you, it helped me a lot! Saw a lot of tutorials for networking but this one was the best for me.

Is someone know a solution to launch a server app made with GMS2 but without graphics? Like a simple command line server.
Thanks!
I don't think that's supported.
 

FrostyCat

Member
DukeSoft has reported some success in running headless: https://forum.yoyogames.com/index.php?threads/servers-question.63296/#post-379665

This is not officially sanctioned functionality, however, so don't whine at the helpdesk or here if anything goes south. People who know enough about multiplayer on GM generally advise against writing public central servers in it, for 3 main reasons:
  1. GML runs single-threaded and scales poorly
  2. GM runner performs hardware checks for 3D support
  3. Networking calls are only responsive once a step during the Network asynchronous event
 
Top