Online Session Nodes

Online Session Nodes

The nodes below are responsible for hosting, discovering, joining, or leaving multiplayer games through Blueprints.

Each of these nodes are latent, meaning they perform their operation in the background (usually because these operations must communicate over the network) and will finish at some point in the future. This is also denoted on the nodes themselves in the upper right corner by a clock icon.

Create Session


The Create Session node is where everything starts. Once your game has successfully created a session, other instances of your game will be able to discover it (using the Find Session node) and then join it (using the Join Session node). On this node, you can specify the number of players allowed in the session and whether the session should be created in LAN mode. For online subsystem modules that support it, setting LAN mode to false will attempt to create an Internet game.

For an overview of the Online Subsystem and Session Interface, see the Online Subsystem Overview documentation.

Find Sessions


Use the Find Sessions node to get a list of game sessions that are currently being advertised and joinable. The BlueprintSessionResult objects returned from a successful call will allow you to get the server's name, ping, and player counts.

Join Session


Once you know which BlueprintSessionResult you would like to join, pass it into a Join Session call. If the game successfully connects to the server, it will automatically travel to the server's map and join gameplay.

Destroy Session


When you no longer want other players to be able to discover and join your game, you can call the Destroy Session node. This will effectively cause you to leave the session, and if you are the host, shut down the session so that it is no longer discoverable.

This node is also used for leaving sessions. Clients also need to call this node when they leave a game.

Error Handling Nodes

Unfortunately, when dealing with network operations, errors are always a possibility and game should handle them gracefully. Perhaps the host of the session you try to join has just quit a moment earlier, or perhaps your internet service went down temporarily, or any number of other problems occur. Through Blueprints, your games have more flexibility in how they handle these network-related errors.

Failures that originate from the Session Operations described above will be reported through the OnFailure execution pin, so you can set up your game to handle these failures as you wish. For certain kinds of failures however, or failures that occur in the middle of gameplay, there are a couple of Error Events that can be called within a GameInstance Blueprint, Network Error and Travel Error.

Event Network Error


The Network Error Event allows games to respond to the event, receive an enumeration value that describes the type of error, and respond appropriately - a game may want to display a dialog box to the user, for example.

Event Travel Error


The Travel Error Event, which is less common than the Network Error Event, allows games to handle cases such as trying to load an invalid map, which are not covered by Network Error.