Hosting and Joining Listen Server with Blueprints

Hello, I am having a lot of trouble getting a server up and then having people be able to join it. So currently at the main menu level I have a host button, when you press this I use the blueprint “Execute console command” to do “Travel Level1?Listen”, which loads up my map Level1 as a listen server (or so I think?). At the main menu I also let you create a string for the IP address, and then when you click the join game button, it executes the console command "Travel ". I can’t seem to get this working when I package it and send it to a friend. I have also tried inputting the console command "open " manually into the console instead of "Travel ".

Does anyone know what I’m doing wrong? If my commands are wrong, I have tried a few and it always says “command not recognized” in the console when I try other things. If it helps my project name is “Vanquished” and the maps are “MainMenu” and “Level1”. The more specific you can be the better.

Also, I can’t help but feel that using console commands for all of this isn’t the best way to go about it, but I could be wrong there. Is there a more official way I should be trying to set up a server and having people join it?

Thank you very much!

Hey greynz,

You will want your server to run a command such as open level1?listen and then have your clients join by using open [server IP address]. Once they have joined up, if you want to switch maps and keep all of your existing clients connected, use a command like servertravel level2 and that should transition server+clients to the new map.

Hope that helps!

Thank you! I managed to get it to work by doing open level1?listen on one game, and then open 127.0.0.1 for local host, which is great! However, then I tried testing by googling to get my ip address, and using open 99.255.252.25, and there is no response. I would like to be able to get someone from another machine into my server, so I am assuming this is how it would be done? Is this somehow the wrong IP address to be using? I know very little about networks, sorry if my question is dumb

The most likely reason is because you have a firewall or router in the way blocking unsolicited incoming traffic to your home.

Unreal Engine operates on port 7777, so you’ll want to do Port Forwarding on your router to open that port and direct it to the internal ip address of the machine running your game.

I was doing this, and noticed that when packaging my game as a “shipping game” the console was removed and this code of course no longer worked.

You will want to move this to C++ eventually, or maybe epic will provide a “none console command” way of doing these types of things.

Thanks for the warning, guess I’ll have to figure out the C++ then after all

EDIT: Well, I just tried packaging as shipping myself, and while the console was removed my blueprint code that uses “Execute Console Command” all still worked. I’m going to migrate to C++ eventually when I get a better grip on it anyway, but it’s worth knowing for people that the console commands still worked for me!

Would every person who tries to play the game have to set up Port Forwarding on their routers to play with each other? If so I hope there is a way to gt around it because that would require a bit more effort than most clients are likely to want to spend to get it to work…

No it’s not necessary, only the host needs to do port forwarding.

that is what I meant, it would be necessary for most people who would play my game to host a game now and again so if they had to work out how to port forward to do this they would no doubt be quite put off.

Do you know if there is a possible work around or whether you can get the standalone to enable port forwarding on the machine it is running on for you?
If not that is a sirius problem.

You’ll have to integrate a third party library that implements UPnP and/or NAT-PMP (or write your own). Do some searching and you can probably find a good free one around

ok thanks for the advice, I dont know if will be able to work this out by myself, is there any pages I should look at or UPnP/ Nat-PMP programs you know of? and do you know how i would get this to install and work with the game?

Using “open mapname?listen” works for me but “open ipaddress” won’t connect to it.

Is this still supported?

Do you have to do port forwarding if the server and client are both on the same LAN and the console command being executed open 192.168.50.1 for example uses the private LAN IP address and not the public WAN ip address of the host?

Personally, I haven’t tried this yet, but I presume the answer would be no, since you’re operating off a local area network, I would just use find sessions benable LAN. As long as both computers are both on the same network locally they should be able to find each other.

There are various techniques to overcome the port forwarding requirement for devices to find each other over the internet and across each other’s private network (where the IP address is only known to the private router), such as things I heard of like ICE, STUN, TURN, NAT-punch, etc…

If you aren’t using dedicated servers hosted on a public internet IP address to provide play space for your users, and instead relying on them to host as listen servers, then they will either need to join each other’s VPN or your game needs make use of one or more of those kinds of techniques mentioned earlier.

Steam online services and subsystem provides something like STUN I think, which is why fellow Steam users can find each other’s games hosted on their own private computers. Other games are available on steam but don’t use that technique and have dedicated public IP-addressed servers to host their games; some even have their own matchmaking services rather than using Steam’s.

Back in the 90s and maybe still today, there were game services which basically let you chat with other users and create game “rooms”, and then anyone in that room would be put on the same VPN, so games only needed to be designed to work on LAN, and the VPN would make it so that everyone in the same “room” was as if they were on the same LAN. That’s how we rolled with the old IPX protocol to play Descent, Doom, SCARAB, Warcraft 2, you name it.

1 Like

that works if you’re on the same LAN or VPN. But crossing over internet public IP addresses and then not knowing the target device’s IP lookup table entry on their private router means you can only get as far as knowing their router’s internet address and not the device connected to the router. To overcome this, several techniques were invented which I mentioned in another comment.

1 Like

im trying to setup multiplayer using eos system-- test multiplayer with another pc but join session doesnt seem to work – attached output log not sure if encryption key is needed or not

First line for eos says encryption key cannot be empty. Start there.