Unsure how to Connect Client to Listen Server in Packaged Game

Hello,

I’ve been working on setting up a multiplayer game and have encountered an issue when trying to test a packaged build. While I can easily set up networked Play In Editor (PIE) sessions, I’m having trouble doing the same post-packaging.

Here’s what I’ve tried so far:

  1. I launch one instance of the game with the -listen command to set it up as a Listen Server.
  2. In a second instance of the game, I use the console command open <IP> to attempt to connect to the server. I’ve tested this both on the same machine using localhost and 127.0.0.1.

When I attempt to connect, the game freezes momentarily and respawns me back at the spawn point but not joined to the Listen Server.

I’m wondering if anyone has faced a similar issue or has advice on the correct procedure to join another user post-packaging using console commands or any other method. Any guidance or resources on this would be greatly appreciated!

Thank you in advance for your help!

I launch one instance of the game with the -listen command to set it up as a Listen Server.

That’s the problem. The correct format is to append listen to map name, like this: .\MyGame.exe L_MyLevel?listen.
Fyi this also can be done from console aften game was started: open L_MyLevel?listen. Such thing could been debugged with help of log\widget that shows current netmode that level was started with.

In a second instance of the game, I use the console command open <IP> to attempt to connect to the server. I’ve tested this both on the same machine using localhost and 127.0.0.1.

open 127.0.0.1 is enough to connect to local server, assuming it was launched on default port 7777. If you had another server running at time of launch, the server will increment port by 1 until it find free port, so just to be sure check open 127.0.0.1:7777, open 127.0.0.1:7778, open 127.0.0.1:7779

Also for pie default port is 17777 (yes, you actually can connect between pie and packaged game or remote clients in any ways, though it can show some unique bugs, but it still sometimes useful feature).

As for ingame\non-debug\ui approach, you can use “open level(by name)” blueprint node for travel passing the same param as to Open command.

While i was testing it for you on my project, i just find out that if you using OSS\Steam second user can’t properly login and those two clients won’t be able to connect to each other. (and if you have no idea what it means, then it isn’t related to your case)

1 Like

Thanks for the help.
I used another method, I just assigned a key so when I press it, it hosts the game and all the other player need to do is to go to the console command and type in “open ”