Connect the game to the multiplayer dedicated server

With the dedicated server running and its IP address and port noted (Start the multiplayer dedicated server), connect your game to it: open the game's stream link, enter the address in the game, and every player who does the same is in the same match.

1. Give the game a way to join

A streamed player has no console to type an address into, and the Third Person Template has no join button. So the game needs a small join box of its own — or automatic join, which needs no box at all.

  1. In your project, create a widget (for example on the main menu) with a text box for the server address and a Join button.

  2. On the button's On Clicked event, call Open Level (by Name) and pass the text from the box as the Level Name, in the form IP:port — for example 172.7.191.81:28889. Opening an address instead of a map name connects the game to that server.

  3. Show the widget when the game starts, package the game again and upload it as a new build of your project.

2. Join from the browser

  1. In Your Projects, open the game's project and copy its stream link.

  2. Open that URL — on two devices, or in two browser windows for two players.

  3. In each, enter the server's IP:port in the join box and press Join.

Two players in the same multiplayer session
Both players in one world, each streaming from their own browser.
What you should see

Two avatars in one world, each moving when its own player moves. If each window shows only one player, they are in separate sessions — the join did not happen, whatever the connection appeared to do. Check the address and port against the running server in the Control Panel.

This works from a mobile browser too — there is nothing desktop-specific about a streamed multiplayer client.

Testing with the desktop build

Before uploading the game, you can point a local build at the running server and check the multiplayer behaviour itself.

  1. Run the packaged game on your machine. Package it as Development (or DebugGame) for this test — the console is compiled out of Shipping builds.

  2. Press ` (backtick) to open the console and connect:

    open 172.7.191.81:28889
  3. Do the same in a second instance, so there are two players.

Two desktop clients connected to the same server

Skip the manual work: use the plugin

Everything on this page is the route without our Multiplayer Server Scaling plugin. With the plugin in your game:

See automatic join for how to add it.

Watch it happen by itself: in this video the plugin starts the server and every player joins it on their own - no Start Server, no address, no typing.

Unreal Engine multiplayer in the browser, Part 3: players join the server by themselvesVideo · 4:31

Related

Last updated