Having Trouble Testing Multiplayer. Any Help Is Appreciated!

Hello,
This may be a rather stupid question and very simple but i am having trouble and must be doing something wrong.

Basically, at the moment i have my level blueprint that in its ‘Play’ settings, has ‘2 Number of clients’, and when i click play, everything seems fine, 2 windows and 2 different players. However i didn’t really know how i can make sure that this is actually working and would work with 2 separate connections. So, i looked at the recent ‘CouchKnights’ project that was released with 4.3 and packaged the ‘CouchKnights’ game and followed the instructions within the level editor which say…

With this, i created 2 shortcuts of my game executable, one the client and one the server.
The target for the server shortcut was this :

F:\WindowsNoEditor\CouchKnights\Binaries\Win64\CouchKnights.exe CouchKnights Room?Listen -Game

and the target for the client shortcut was this :

F:\WindowsNoEditor\CouchKnights\Binaries\Win64\CouchKnights.exe CouchKnights 1"2.1"".1."2 -Game

(Without the quotation marks in my IP)
And so i tested this and it all seemed to work perfectly fine.


Next i tried to package my current project and did the same process with the shortcuts as well.
This also worked and i had both players in the game.

However, next i tried to send this packaged game with the shortcuts to my friend. First of all we tried with the shortcuts. I would open the shortcut server with a target like this…

F:\ …..WindowsNoEditor\GameProject_1\Binaries\Win64\GameProject_1.exe GameProject_1 Networking_Multiplayer?Listen -Game

and then i had him open the client shortcut who`s target looked like this…

F:\ …..WindowsNoEditor\GameProject_1\Binaries\Win64\GameProject_1.exe GameProject_1 1"2.1"".1."2 -Game

(Without the quotation marks in my IP)
However this method did not work.


So i looked to trying the ‘Command Line’ method instead of using shortcuts.

Firstly, i opened my game .exe and typed in the console this…

open ''myMapname"?listen

and then i had my friend launch the .exe and type in the console…

open ''MyIPAddress"

However this also did not work. I may be very wrong in thinking its this simple, but from what i have watched and read, i cant tell if there’s more work for me to do? All i want to do is have the client connect and join the listen server. Am i doing something wrong?

I am sorry this turned into a really long post for something that probably could have been put much simpler.

If anyone could help at all with this it would be a great help, as i have been trying to figure it out for a while. Any help is greatly appreciated.

Thanks A lot!


Hello, In Engine > Config > baseEngine, you got at the top of the file in [URL] a variable named “Port”, By default it’s set to 7777, You can use many websites to check if your port correctly receives informations and which port are opened or closed. You can either manage to open port 7777, I had problem doing so, so I just switched the “Port” Variable inside baseEngine to a port that was already opened on my box.

I Use the same Console Command Line than you and it does work with no problem wether I enter it in the console, or use the appropriate blueprint node to do so.

(You will need to repackage the project for the changes to work of course)

The problem is you gave your friend the same IP you used, right? (That with 192.168 probably).
It is only valid in your local network, but not on the internet. It’s like being in a city, let’s say London.

Your server is in George Street and that is working pretty well…in London.
Your friend now is in Richmond, and if you say him you are in George Street, he will go to George Street in Richmond and find nothing.

First you have to give him your city, that is your public ip (http://www.whatismyip.com/).
Then, you don’t give him really the street (your local ip), but you say him a port number, like Talus showed how to configure it.
In your router, you say: “Hey, the port 7777 is of this type and should lead to this IP address/this PC” and there you give your local IP/your PC. Then it’s like “Ok, go to London and at port 7777 we will be routed to George Street”.

That’s the way it works.

Oh, the format is not 192.168.etc., it is like 95.208.248.239:7777
You append the port with a colon.

Hope I could help you with my problem, please vote if it helped you, ask if there are any more problems and good luck.
Cheers mate.

Hello, Thanks a lot for responding and in detail with explanation. This is a great help to me! I have just opened the port successfully i believe at least, and so i will try it tomorrow and hopefully it works.

Thanks again for your help.

you’re right, for an explanation see my post.
Don’t forget to open your ports on your router.

Hello, thanks for your response.

The analogy helped, i know very little about networking and ports so this helped me understand why i was going wrong.
Also thanks for linking that website, i was sending him my IP that was displayed when i type ‘ipconfig’ in the command prompt. I am sure this is an unbelievably stupid thing to do so thanks for pointing it out, wouldn’t have realized otherwise!

Again thanks for your help!

No problem mate, if you make multiplayer it may be helpful to read something about networking and so on, it can make life a lot easier like you just saw :wink:

Multiplayer stuff has been really confusing me; I have learned a bit from running some dedicated server for some UE4 games on steam… but still not much to help me with my own game. This has been massive help! And great analogy of the street address. Excellent!