4.6 Preview and Create Session

I setup the node to accept 4 connections, and when I fire it in game, the function simply fails and I have no information as to why. Is this expected behavior for the preview and to be fixed in the official release? Or should this work?

This should work in the preview. Session creation failures should also be printed to the log, so providing the log output would be helpful, if possible.

Also note that currently you can only have one session active at a time - if a Create Session succeeded, you have to call Destroy Session before you’ll be able to create another one successfully.

Thanks
So I have use lan set to true. And the log states:

LogScript:Warning: CreateSession - Invalid or uninitialized OnlineSubsystem
Warning: CreateSession - Cannot map local player to unique net ID

Thanks, that’s helpful! There are a couple setup steps you may have to perform as well - we’re working on adding them to the official documentation. I’ll use OnlineSubsystemNull as an example here, it will suffice for connecting multiple instances on the same computer or across a LAN.

If your project is a code project with a *.Build.cs file, you’ll need a dependency on the “OnlineSubsystemNull” module.

For both code and blueprint projects, you also need to set the DefaultPlatformService in your DefaultEngine.ini file, like this:

[OnlineSubsystem]
DefaultPlatformService=Null

We hope to expose this setting in the editor in the future.

1 Like

Awesome can’t wait to try this! Now another related question I have and I think a lot of people have is: During development and testing, how do I test multiplayer over the internet? Or is that an option?

You can still bypass the session-related blueprint nodes and connect directly to an IP address, using command-line parameters at launch or the “open <ip address>” console command. You’ll probably have to open up the game port (default 7777) on any routers along the way, though.

To use the session functionality over the internet, you’ll need to use a different OnlineSubsystem service implementation, such as Steam on PC (you’ll need access to the Steam SDK to do so).

OnlineSubsystemNull won’t be able to find games over the internet because it just uses simple UDP broadcast packets for discovery.

Perfect! Thanks for your help!

Hey Ryan

If your project is a code project with a *.Build.cs file, you’ll need a dependency on the “OnlineSubsystemNull” module.

What exactly do you mean ? I’m no programmer, and only added a C++ Blueprint following a tutorial, so I suppose I need to follow what you mentioned but if you could describe it step by step, that would help a lot !

Thanks