Ali Şahan Yalçın
DocsWhat you are building

Tutorial: a working multiplayer menu

What you are building

The plan, the assets you need, and what each one is for. Start here if you have never built multiplayer in Unreal.

Every other page in these docs explains one feature. This section is different. It goes from an empty project to two players in the same match, in order, assuming nothing.

If you have built Unreal multiplayer before, skip ahead to Sessions.

What you will have at the end

A menu with four controls that work:

  • Host creates a session other players can find.
  • Find searches, and lists what it found.
  • Join enters the one you selected.
  • Start sends everyone into the match together.

What you will create

Five assets: two levels, and three Blueprint classes that do the work.

AssetParent classIts job here
L_Menu and L_MatchLevelThe menu screen, and the place the match happens
BP_MenuGameModeGame Mode BaseTells L_Menu which Player Controller to use
BP_MenuControllerPlayer ControllerCreates the menu and owns it
WBP_MainMenuUser WidgetThe menu itself. Every SteamForge node goes in its graph.

Why two levels, and what survives

When the host starts the match, the game changes level. Unreal calls this travel, and it throws away more than people expect:

Destroyed on travelSurvives travel
Your menu widgetEvery SteamForge subsystem
The Player Controller that created itThe Game Instance
Every actor in the level

That is why the menu and the match are separate levels rather than one.

It is also why this tutorial never creates a Game Instance. The session state you care about is already in a subsystem, which outlives travel on its own. After the match starts, Is In Session, Is Session Host and Get Session Settings all still answer correctly, with nothing carried across by you.

You would only add a Game Instance of your own if you had state of your own to keep, like which character the player picked before the match started.

How hosting actually works

There is no server computer here. The host is one of the players, running the game and accepting connections at the same time. Unreal calls that a listen server, and it is what nearly every small co-op game uses.

So "starting the match" is three separate things happening in order:

  1. The host changes to the match level and starts listening for connections.
  2. The host publishes the address it is listening on into the Steam lobby.
  3. Everyone else reads that address and connects to it.

SteamForge does all three. It is still worth knowing they are distinct, because when multiplayer misbehaves it is almost always one of these three that did not happen.

Lobby, session, match

Three words that get used loosely. Here they mean specific things.

WordWhat it means
LobbySteam's meeting room. A list of players and some key/value data. No game running.
SessionA lobby with SteamForge's agreed data on it: name, map, player count, password. Still no game running.
MatchThe actual game, after travel, with everyone connected to the host.

Players gather in a session, then travel into a match. This tutorial builds both halves.

Before you start

Work through Installation and First steps first. Specifically, steam.Status must report Available: yes, whether through mock mode or real Steam. Nothing below works if it does not.

Where to go next

Step 1: a menu on screen.