0 votes

Hi,
I have made a game and it uses peer to peer and it's working fine in local host on my pc using 192.168.1.2 etc but when i export it and use it on different Network other than my wifi network it doesn't work. It works only if i connect both devices to same wifi. How do i connect via internet. What is the ip that should be used to connect to ?

Thanks !

asked Dec 25, 2018 in Engine by Abhi4124 (12 points)

I used my Private ip to test within my network and it works perfectly fine. The only problem is over the internet connection. If i have to do a port forward then what about other users who will be using the final build. Not everyone had a modem too some uses mobile data

First, the port forwarding is only done in your router... Other people just need to put the public IP you give them, and the port which is forwarded to the port of the game on your local machine. So your router has a PublicIP and your machine has a PrivateIP, and the server started in your game has a ServerPORT. You CAN'T reach your private IP and ServerPORT on it, if you are not in the same network. So what you do is foward a port of your choice between the private ports (lets call it RouterPORT), to the PrivateIP of your machine and the ServerPORT. Then, the user has to connect to the PublicIP and RouterPORT, and the router will forward it to PrivatIP and ServerPORT.

what about other users who will be using the final build

This is explained above, but, are you saying that you are going to give the game to other users you don't know? I mean, are you going to distribute this game? If so, i would say you definitly need a dedicated server, install ther the server instance of the game, and the users should connect there. If a lot of work if you are not quite familiar with servers and TCP/IP connections.

Okay that's why i asked for some tutorial. I need to setup a server build of the game but the game is a 1v1 game and there will be users in a particular match and only 2 players in a single game. how can i achieve that?

Do you know how to use Firebase Real time Database with Godot? If yes can you tell

Setting up a server is nothing trivial. But may be this link i provided before helps you. You should get a dedicated server and then do that.

If i manage to do this anytime i will post it here.. I hope i can!

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.