Networking help to understand the whole concept thanks :3

T

theraje3

Guest
  • Hello. Few days ago I started to learn how networking works in game maker studio 2. I think I pretty much understand how buffer works but still need much more information about that can´t find anywhere. I watched a lot of tutorials on YT and forums But I dont understand everything right.

  • As long as I know for a 2 multiplayer game when one player is the host and the other is the client I need to create a socket (tcp for me), create a conection between with ip and port and then set some buffers with the information you want to send.

  • After that I found a problem... when I connect my 2 proyects (identicals) with the ip and port it connects right (anyway I couldnt make send data between) but when my partner run the proyect in a diferent PC and we try to connect It dont works...

Can someone explain me the full process for networking when only 2 players needed 1 host and 1 client?​

Thank you so much guys you are the best!

PD: srry for my english :s hope is understandable >.<


Media:
tutorial I mainly follow to make my game work:
 

jo-thijs

Member
  • Hello. Few days ago I started to learn how networking works in game maker studio 2. I think I pretty much understand how buffer works but still need much more information about that can´t find anywhere. I watched a lot of tutorials on YT and forums But I dont understand everything right.
  • As long as I know for a 2 multiplayer game when one player is the host and the other is the client I need to create a socket (tcp for me), create a conection between with ip and port and then set some buffers with the information you want to send.

  • After that I found a problem... when I connect my 2 proyects (identicals) with the ip and port it connects right (anyway I couldnt make send data between) but when my partner run the proyect in a diferent PC and we try to connect It dont works...

Can someone explain me the full process for networking when only 2 players needed 1 host and 1 client?​

Thank you so much guys you are the best!

PD: srry for my english :s hope is understandable >.<


Media:
tutorial I mainly follow to make my game work:
Was your partner on the same local network?
If not, you have to do even more work to establish a connection.
What's screwing you up is probably the NAT-boxes.
You'll need to do some port forwarding to get around that.
How you forward ports depends on your setup (I do it through the website of my internet provider).
Once you've forwarded the correct ports on the computer running the server, you can make a connection.
Be sure though to use the correct IP addresses for the server host (the one of the network it is on from which the ports get forwarded, not of the machine itself).
 

The-any-Key

Member
Connection is one of the challenges network coders face.
To try connect one device with another can be frustrating.
There a many variables that need to be checked.
  • Is it a 3G/4G mobile network?
  • What OP does the devices have?
  • Is the router/NAT symmetrical?
  • Hardware and software firewalls?
  • Do someone use a proxy?
  • Distance to the other computer?
  • Antivirus programs?
  • LAN network?
  • WAN network?
  • Hamachi?
  • Is the other computer in a school or workplace?
  • How fast is the internet connection?
And each connection can have a different setup of the above things. And each setup need a specific solution.
You may need to disable firewalls and antivirus. You may need portforward. You may need a relay server. Tips is to Google: how networks works, how sockets works, can windows 8 game connect to windows 8... and so on.
 
T

theraje3

Guest
Was your partner on the same local network?
If not, you have to do even more work to establish a connection.
What's screwing you up is probably the NAT-boxes.
You'll need to do some port forwarding to get around that.
How you forward ports depends on your setup (I do it through the website of my internet provider).
Once you've forwarded the correct ports on the computer running the server, you can make a connection.
Be sure though to use the correct IP addresses for the server host (the one of the network it is on from which the ports get forwarded, not of the machine itself).
my parner was on another network.. I will dig more info on the port forwarding as you said. Thank you so much for the info and the reply :)
 
T

theraje3

Guest
Connection is one of the challenges network coders face.
To try connect one device with another can be frustrating.
There a many variables that need to be checked.
  • Is it a 3G/4G mobile network?
  • What OP does the devices have?
  • Is the router/NAT symmetrical?
  • Hardware and software firewalls?
  • Do someone use a proxy?
  • Distance to the other computer?
  • Antivirus programs?
  • LAN network?
  • WAN network?
  • Hamachi?
  • Is the other computer in a school or workplace?
  • How fast is the internet connection?
And each connection can have a different setup of the above things. And each setup need a specific solution.
You may need to disable firewalls and antivirus. You may need portforward. You may need a relay server. Tips is to Google: how networks works, how sockets works, can windows 8 game connect to windows 8... and so on.
Im going to google right now to search more info about that! GML is more difficult than people said :p thank you for the tips and the reply you guys are the best! :3
 

andev

Member
GML is more difficult than people said
That is a really conclusive checklist but it's not as complicated as it's made out to be.

Is it a 3G/4G mobile network?
If yes, it just means that the speed will fluctuate and the IP could change any time. Gaming over 3G is not recommended and isn't something you usually have to code for.

Is the router/NAT symmetrical?
If you are using a server, this is not something to worry about when starting out.

Hardware and software firewalls? / Antivirus programs?
If yes, turn them off, or allow the program through.

Do someone use a proxy?
If you're lucky, it will be configured to direct all traffic through it and you won't need to do anything. I don't think there are any functions in GML to abide by proxy settings.

Distance to the other computer?
If the computer is not on the same network, the physical distance doesn't make too much difference. I could connect to someone on the other side of the world with good internet faster than I could connect to my neighbor on his lowest internet tier at peak time. Either way, the difference is connection reliability, which you should be programming to deal with anyway.

LAN network?
It just means the IP will look like 192.168.0.X
 

The-any-Key

Member
If yes, it just means that the speed will fluctuate and the IP could change any time. Gaming over 3G is not recommended and isn't something you usually have to code for.
Lucky for us is that suddenly changes in IP is something that wont be a problem for the network at all.

If you are using a server, this is not something to worry about when starting out.
Changing a project to use a dedicated server instead in the end is super easy. I personally recommend this.

If yes, turn them off, or allow the program through.
So tell your network administrator at your school, workplace or your internet provider to stop with that security thingi that prevent you from live your life and play games.

If you're lucky, it will be configured to direct all traffic through it and you won't need to do anything. I don't think there are any functions in GML to abide by proxy settings.
Hope you are lucky then. Network coding is most about luck anyway.

If the computer is not on the same network, the physical distance doesn't make too much difference. I could connect to someone on the other side of the world with good internet faster than I could connect to my neighbor on his lowest internet tier at peak time. Either way, the difference is connection reliability, which you should be programming to deal with anyway.
I notice that all programmers know lag compensation methods so no problems here.

It just means the IP will look like 192.168.0.X
You will notice how true this is when you try it yourself.
 

andev

Member
Is every single one of those responses sarcastic? :D Because some of them seem like valid responses.

You will notice how true this is when you try it yourself.
You are correct in assuming I've never done LAN networking. Can you expand on what you mean by this?
 

FrostyCat

Redemption Seeker
You are correct in assuming I've never done LAN networking. Can you expand on what you mean by this?
If you've ever administrated a router, you should know that your "the IP will look like 192.168.0.X" advice simply isn't true.

The actual form for Class C NAT private addresses is 192.168.x.x, the third octet doesn't have to be 0. You can see for yourself with ipconfig on Windows or ifconfig on Mac/Unix what yours actually looks like. Certain larger setups instead assign Class A or B addresses, which range in 10.x.x.x and 172.16.x.x.-172.31.x.x respectively.

And in case you're still wondering, every one of The-any-Key's responses is sarcastic.
 

andev

Member
If you've ever administrated a router, you should know that your "the IP will look like 192.168.0.X" advice simply isn't true.

The actual form for Class C NAT private addresses is 192.168.x.x, the third octet doesn't have to be 0.
Ok, how about "The IP will usually look like 192.168.x.x" :p

And in case you're still wondering, every one of The-any-Key's responses is sarcastic.
Well then:

Lucky for us is that suddenly changes in IP is something that wont be a problem for the network at all.
As I said, the most common situation where this would occur is gaming over a mobile network, which is advised against, and not something most people need to worry about, let alone someone just starting out. Take clash royale, one of the top grossing games on the store. If you switch IPs, you lose connection and have to sign in again. Massive games do not worry about this.

Changing a project to use a dedicated server instead in the end is super easy. I personally recommend this.
I literally said "when starting out" lol, of course making any big change to a project is not going to be easy.

So tell your network administrator at your school, workplace or your internet provider to stop with that security thingi that prevent you from live your life and play games.
What other solution is there to firewalls and antivirus, other than to advise the end user to let your program through? I would not suggest testing your network code on an already complicated set up, that's asking for problems.

Hope you are lucky then. Network coding is most about luck anyway.
Again, what other solution is there to proxy settings?

I notice that all programmers know lag compensation methods so no problems here.
This has nothing to do with my response. The physical distance between the computers is irrelevant unless they're on the same network.
 
Top