How do I search for sessions in a LAN?

So, I’ve been struggling to get a simple multiplayer demo in place for a couple of days now. I’m trying to use Blueprints to create, find and join a session. So far I’ve done:

  • 2 levels: first one act as a main menu and handle key presses to allow the user to choose between hosting and joining a session. The second level is an empty one and act as a “gameplay” level.

  • In my *.Build.cs file I added:

    PrivateDependencyModuleNames.AddRange(new string[] { “OnlineSubsystem”, “OnlineSubsystemNull” });

  • In my DefaultEngine.ini file I included:

    [OnlineSubsystem]
    DefaultPlatformService=Null

  • When I run the game, both from the editor and as a published application (package as Development) I’m able to create a session and the game loads the MainGame level as expected.

  • I can only join a session if both the host and the client are on the same machine. If I try to host a session in computer A and try to find it from computer B - both on the same network - FindSessions block returns success with 0 results no matter if I’m running the client inside the editor or as a standalone application.

My Blueprint setup for starting/joining session is like this:

What am I missing?

A couple of things that may not be even remotely relevant. But after digging around a bit I found a few things that “might” help.

The default UDP port is 7777 (I presume this is also the case for LAN mode) so make sure the machines can communicate on that port and it’s not firewalled.
Source: https://answers.unrealengine.com/questions/52877/network-how-to-connect-to-a-remote-listening-serve.html

The machines must be on the same subnet.
Source: [Networking] Find LAN game-servers - C++ - Unreal Engine Forums

And I seen some comments in the onlinesubsystem source file about running in loopback mode wich has it looking at localhost. Disclaimer: I know only enough about C++ to break things so take that with a grain of salt.

Just thought it might be worth looking at some of these. Best of luck!

1 Like

Thanks for the tips. We are investigating an issue in our network. We have a switch cascade in our office that may be not propagating broadcasts up/downwards. I’ll post back when I have more results.

Turns out some machines in our network - mine included - have VirtualBox installed. VirtualBox creates a virtual network driver that was being used to broadcast the search packet (UDP, 255.255.255.255, port 14001) instead of the main network. For some reason, disconnecting my machine from the switch cascade made the problem to go away.

TL;DR version: if you have VirtualBox installed, disable the virtual network adapter before testing your multiplayer game in Unreal.

Seems to be an OS issue, the broadcast will only be sent to one network adapter:

Very helpfull, thanks. We ran into the exact same issue … close to loosing our sanity. Thank you so much. :slight_smile:

Thanks, disabling VirtualBox fixed this for me

Thanks man! disabling VirtualBox fixed this for me too!

Seriously Virtual Box can ruin LAN? Thanks, removing virtual network helped to find session :smiley:

I can’t find VirtualBox on my Windows 8.1 and I really want to turn it off so my game can work. Please tell me where to find it? It’s not listed in my Network Adaptors.