# Lobbycraft One set of Blueprint nodes for sessions, invites, achievements, stats and cloud saves, on Steam and on Epic Online Services (EOS). Unreal Engine 5.6, 5.7 and 5.8, Windows. The same game build runs under both stores. Started from Steam it uses Steam; started from the Epic Games launcher it switches itself to EOS. You don't branch on the store in your Blueprints. - [Quick start](#quick-start) - [Steam setup](#steam-setup) - [EOS setup](#eos-setup) - [Selling on both stores](#selling-on-both-stores) - [Crossplay](#crossplay) - [Nodes](#nodes) - [Config keys](#config-keys) - [The Doctor](#the-doctor) - [Dedicated servers](#dedicated-servers) - [Shipping builds](#shipping-builds) - [Testing](#testing) - [What was tested](#what-was-tested) - [Limitations](#limitations) - [Troubleshooting](#troubleshooting) ## Quick start This gets two players into the same map through Steam, using Valve's test app (480, "Spacewar"). No Steamworks account needed yet. 1. Enable the plugins in **Edit > Plugins**: Lobbycraft, Online Subsystem Steam, Steam Sockets. Restart the editor. 2. Add to `Config/DefaultEngine.ini`: ```ini [OnlineSubsystem] DefaultPlatformService=Steam [OnlineSubsystemSteam] bEnabled=true SteamDevAppId=480 bInitServerOnClient=true [/Script/Engine.GameEngine] !NetDriverDefinitions=ClearArray +NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="/Script/SteamSockets.SteamSocketsNetDriver",DriverClassNameFallback="/Script/OnlineSubsystemUtils.IpNetDriver") [/Script/SteamSockets.SteamSocketsNetDriver] NetConnectionClassName="/Script/SteamSockets.SteamSocketsNetConnection" ``` 3. Run **Tools > Lobbycraft Doctor**. It reads the project and lists what is wrong, with the line to paste. Fix until it says "No problems found". 4. In a Blueprint (a menu widget, the player controller): **Create Session** with your gameplay map on one side, **Find Sessions** then **Join Session** on the other. The map `/Lobbycraft/Example/L_LobbycraftExample` (plugin content) has it wired, one key per node: open `BP_LobbycraftExampleController` to read the graph, or play the map and press H (host), F (find), J (join), L (leave), I (login), U (achievement), S (stat), C and V (cloud save and load), O (invite overlay). 5. Package the game (Development). Steam does not work in Play In Editor; run the packaged build, with the Steam client open, on two PCs with two Steam accounts. For a first test on a single PC, tick **LAN** on Create Session and Find Sessions and start the packaged game twice. See [Testing](#testing). ## Steam setup ### Plugins | Plugin | Why | |---|---| | Online Subsystem Steam | Lobbies, friends, achievements, cloud | | Steam Sockets | The net driver that connects players through Steam's relays (no port forwarding) | ### DefaultEngine.ini The block in the quick start is the whole Steam configuration. Notes on it: - `SteamDevAppId`: your App ID once you have one. 480 is fine for sessions while developing, but it is shared with every other developer and it can't be used together with EOS. - `!NetDriverDefinitions=ClearArray` must come before the `+NetDriverDefinitions` line. Without it the engine's default IP driver stays first in the list and wins. - Don't use `/Script/OnlineSubsystemSteam.SteamNetDriver`. That class moved in 5.6; with the old path the game falls back to plain IP without saying so, and clients fail to travel. ### Achievements Steam only accepts achievements that are declared in the ini, by their Steamworks API name: ```ini [OnlineSubsystemSteam] Achievement_0_Id=ACH_FIRST_WIN Achievement_1_Id=ACH_TEN_WINS ``` They must also exist and be **published** in Steamworks (Stats & Achievements). If your game uses a different id from the Steamworks API name (because EOS uses another, say), map it: ```ini [Lobbycraft.SteamAchievementIds] FirstWin=ACH_FIRST_WIN ``` After each unlock Lobbycraft asks Steam whether the achievement really is unlocked. A name Steam doesn't know comes back on **On Failure** with "no such achievement in Steamworks (check the API name)". The engine alone reports success in that case. ### Stats Create the stat in Steamworks as **INT** and publish. Lobbycraft talks to Steam's stats API directly, because the engine's Steam subsystem has no stats interface. ### Cloud saves In Steamworks, open **Steam Cloud**, enable it and set both quotas: bytes per user and number of files per user. With either at zero, every save is refused. ## EOS setup EOS gives you the Epic Games Store side (achievements, stats, cloud, lobbies for players who bought the game there), and it can also run next to Steam. ### Plugins | Plugin | Why | |---|---| | Online Subsystem EOS | Everything EOS | | Socket Subsystem EOS | The EOS peer-to-peer net driver. EOS lobbies advertise the host by its EOS address, so joins need it | ### Developer Portal In the [Epic Developer Portal](https://dev.epicgames.com/portal), for your product: 1. **Product Settings > Clients**: create a client. Its policy must be **GameClient /w UnlockAchievements**. Plain "GameClient" can't unlock achievements. 2. **Epic Account Services**: create an application, link it to the client, and under Permissions turn on Basic Profile, Online Presence and Friends. 3. **Game Services > Achievements / Stats**: create them here. Stats used with Increment Stat need the **SUM** aggregation. **Write stat names in UPPER CASE in the portal** (`KILLS`, not `Kills`): the engine upper-cases the name before sending it, and EOS accepts a write to a name it does not know without any error. In your Blueprints the case does not matter, and Steam does not care either, so one name serves both stores. 4. **Game Services > Player Data Storage**: nothing to create, but it needs the `ClientEncryptionKey` below. 5. Copy the ids from **Product Settings > SDK Download & Credentials**. Until Epic approves your brand settings, only members of your organization can sign in with an Epic account. Anyone else stops at a page saying "Application Access Is Restricted". To test with a friend, invite their Epic account to the organization (**Organization > Members**). ### Config In `Config/DefaultEngine.ini`: ```ini [OnlineSubsystem] DefaultPlatformService=Steam NativePlatformService=Steam [OnlineSubsystemEOS] bEnabled=true [/Script/OnlineSubsystemEOS.EOSSettings] DefaultArtifactName=MyGame bUseEAS=False bUseEOSConnect=True SteamTokenType=WebApi:epiconlineservices bEnableOverlay=True bEnableSocialOverlay=True ``` The two overlay lines matter: the engine ships with the Epic overlay off, and the overlay is the only place where an Epic player sees and accepts an invite. For a game sold only on Epic, set `DefaultPlatformService=EOS`, leave `NativePlatformService` out, and skip the Steam sections. The credentials go in a file that stays out of source control, `Config/Windows/WindowsEngine.ini`: ```ini [/Script/OnlineSubsystemEOS.EOSSettings] +Artifacts=(ArtifactName="MyGame",ClientId="...",ClientSecret="...",ProductId="...",SandboxId="...",DeploymentId="...",ClientEncryptionKey="...") ``` - `ArtifactName` must equal `DefaultArtifactName`. - `ClientEncryptionKey` is 64 hexadecimal characters that you generate once and never change (it encrypts the cloud saves). In Python: `secrets.token_hex(32)`. - The field must be called `ClientEncryptionKey`. The engine strips a field named `EncryptionKey` from packaged builds, and cloud saves then break only after packaging. - Add the file to `.gitignore`. The Doctor warns when a file with the client secret is not ignored. ## Selling on both stores With the configuration above, one build covers both: | Started from | Sessions, friends, invites | Cloud saves | Achievements and stats | |---|---|---|---| | Steam | Steam | Steam Cloud | Steam, and EOS too if the player is signed in (see below) | | Epic Games launcher | EOS | EOS Player Data Storage | EOS | The launcher starts the game with `-AUTH_TYPE=...` on the command line; that is how Lobbycraft knows. On an Epic launch it turns on Epic account sign-in and makes EOS the default online subsystem, in the config, before the engine reads it (one module of the plugin loads ahead of the online subsystems for this), and then points the net driver at EOS. Nothing to do in your project. If you would rather control those settings yourself, turn it off with `[Lobbycraft] bManageStoreSettings=False`. On an Epic launch, call **Login** once (at the main menu) before sessions, friends, stats or cloud. On a Steam launch no login is needed for the Steam side. ### Steam players signed in to EOS Optional. It lets a Steam player's achievements and stats also be written to EOS, without an Epic account. It needs your own Steam App ID (480 is rejected by EOS): 1. Portal: **Product Settings > Identity Providers > Add**: Steam, your App ID, and `epiconlineservices` as the SteamNetworkingIdentity. That text must match the part after `WebApi:` in `SteamTokenType`. 2. Portal: **Product Settings > Sandboxes > (your sandbox) > Identity Providers**: select the provider you just created for Steam. 3. Game: call **Login** after startup. ## Crossplay Without crossplay, Steam players meet Steam players and Epic players meet Epic players. With it, both find and join the same sessions. ```ini [Lobbycraft] bCrossplay=True ``` It needs everything in [Steam players signed in to EOS](#steam-players-signed-in-to-eos): your own Steam App ID, registered as an identity provider in the EOS portal. Then: - Sessions become EOS sessions for everyone, connected through EOS peer-to-peer. A Steam player is signed in to EOS with their Steam account; they never see an Epic login and don't need an Epic account. - Call **Login** once before the session nodes, on both stores. - Achievements, stats, leaderboards and cloud saves stay where they were: a Steam player's go to Steam. - A Steam player's friends list is still their Steam friends, and an Epic player's is their Epic friends. - **Invite Friend** and **Show Invite Overlay** keep working between Steam friends. Steam's own lobby invite can't carry an EOS session, so Lobbycraft sends the session in the invite's text and looks it up on the other side, in the running game or when Steam starts the game from the invite. What crossplay does not do: a Steam player can't invite an Epic friend or the other way round, because neither store's friends list knows the other's players. They meet through Find Sessions or Quick Match. ## Nodes All nodes are under the **Lobbycraft** category. The ones with a clock icon are asynchronous: they have **On Success** and **On Failure** pins, each with a text that says what happened. ### Sessions | Node | What it does | |---|---| | **Quick Match** (Map, Settings, Max Players, LAN) | A "Play" button in one node: joins the fullest session that matches Settings and still has a seat, and hosts one when there is none. The text says `joined` or `hosting`. | | **Create Session** (Map, Settings, Max Players, LAN, Private) | Creates the session and opens Map as a listen server. Leave Map empty to stay where you are. | | **Find Sessions** (Filters, LAN, Dedicated Servers, Max Results) | Returns an array of Session Result. On Success with an empty array means the search worked and nobody is hosting. | | **Join Session** (Session, Password) | Joins one result and travels to its host. Password is only for a session that has one. | | **Update Session Settings** (Settings) | Host only. Changes the settings while the session runs. An empty value removes the key. | | **Leave Session** | Ends the session (host) or leaves it (client). Open your menu map yourself afterwards. | **Settings** are your own key/value texts: room name, game mode, map. Give them to Create Session; every Find Sessions result brings them back in its `Settings` map, and **Filters** on Find Sessions keeps only the sessions where the given keys have the given values. Keys may use letters, digits and underscore, and they come back in UPPER CASE, because the stores don't keep the case. A **Private** session is left out of searches. Players get in by invite or by joining a friend from the store's friends list. A **password** keeps a listed session for the people who know it. Add a setting named `Password` to Create Session. It is not shown to searchers: they only see **Has Password** on the Session Result, and Quick Match skips those rooms. Join Session has to bring the same text. Whoever arrives without it is told "Wrong password" (the waiting room's On Kicked event) and goes back to their default map. The password never travels as typed, only a hash of it, and the check runs on the host. An invited player needs the password too, so for a friends-only game use Private instead. **Session Result** fields: Host Name, Players, Max Players, Ping Ms, Dedicated, Has Password, Settings. One operation of each kind runs at a time. A second Create while the first is pending fails with "Busy". When the host leaves or the connection drops, the client's session is closed for you, so the next Create or Join works. Sending the player back to the menu is up to your game (the engine's network failure event). A player whose game closed without leaving (a crash, Alt+F4) can come back at once. On Steam Sockets the host still holds their old connection for 10 to 16 seconds, and the engine can't tell the two apart, because a player's address there is their Steam ID. Alone, the engine leaves the new connection waiting and, in a Development build, the host stops on an assertion (`MappedClientConnections.Remove`) when that player leaves later. Lobbycraft closes the old connection as soon as the new one arrives. ### Waiting room Once players are in the same session they are on the host's map, and the **Lobbycraft Lobby Subsystem** (a world subsystem: *Get Lobbycraft Lobby Subsystem*) tells you who is there. It runs over the game's own connection, so it behaves the same on Steam, EOS, crossplay, LAN and a dedicated server, and it needs nothing from your Player Controller or Player State classes. | Function | What it does | |---|---| | **Get Players** | Everyone in the room, the host first: Name, Ready, Is Host, Is Local Player, Team, Avatar, Player State. | | **Set Ready** (Ready) | Marks the player on this machine as ready or not. | | **Are All Ready** | True when nobody is missing. | | **Send Chat** (Text) | A line of text to everyone in the room. | | **Kick Player** (Player, Reason) | Host only. The player is told why, leaves the session and goes back to their default map. | | **Start Game** (Map) | Host only. Takes everyone to Map and keeps the session open. | | **Is Host** | This machine runs the game. | | Event | Fires when | |---|---| | **On Lobby Changed** | Someone joined, left, or changed their ready state. Rebuild your list here. | | **On Chat Message** (Sender, Text) | A chat line arrived, on every machine, the sender's too. | | **On Kicked** (Reason) | The host removed the player on this machine. | On Kicked fires on the host's map, which the kicked player leaves a moment later, so a menu that opens afterwards never saw it. **Get Last Kick Reason**, on the Lobbycraft Session Subsystem, still has the text ("Wrong password", or the reason given to Kick Player) when the menu map opens. The ready-made Games screen shows it under the list. **Voice chat** is part of the room: | Function | What it does | |---|---| | **Set Microphone Open** (Open) | Starts or stops sending the player's voice to the room. Call it on key down and key up for push-to-talk, or once for an open microphone. | | **Is Microphone Open** | | | **Set Player Muted** (Player, Muted) | Stops hearing one player, on this machine only. | | **Set Voice Volume** (Volume) | How loud the others sound here. 1 is as sent. | | **Set Player Team** (Player, Team) | Host only. Puts a player on a team: a number of your own. It shows on Get Players and survives Start Game. | | **Set Team Voice Only** (Team Only) | The player on this machine talks to their own team only, or to everyone. | | **Set Voice Proximity** (Radius) | Host only. A voice carries up to Radius (Unreal units) from the speaker's pawn. 0 turns it off. | | **Set Microphone Gain** (Gain) | How loud this machine's microphone is sent. 1 is as captured. Microphones differ, so give the player a slider for it. | Each row of Get Players has **Talking** and **Muted**, and On Lobby Changed fires when someone starts or stops talking, so a "speaking" icon takes those two nodes. Voice needs one line in `DefaultEngine.ini`, which turns on the engine's microphone capture and codec: ```ini [Voice] bEnabled=true ``` Two engine behaviours to know about: - **Silence is not sent.** The engine drops microphone input below a threshold, and its default (0.08 of full scale) is higher than normal speech on a quiet microphone, so some players would never be heard. Lobbycraft lowers it to 0.015 when the microphone opens. To choose your own, set `voice.SilenceDetectionThreshold` and `voice.MicNoiseGateThreshold` under `[ConsoleVariables]`; Lobbycraft leaves a value you set alone. - **A game without focus is muted, voice included.** Unreal plays no sound while its window is in the background. If players should keep hearing the room after Alt+Tab, add `UnfocusedVolumeMultiplier=1.0` under `[Audio]` in `DefaultEngine.ini`. It is sent over the game's connection (Opus, about 3 KB per second while someone talks), so it works wherever the room works, with no voice service to set up and none to pay for. By default everyone in the room hears everyone. Two things narrow that, and both are decided on the host, so a voice that shouldn't reach a player is never sent to their machine: - **Team voice.** With Set Team Voice Only on, a player is heard by the players the host put on the same team. - **Proximity voice.** With a radius set, a voice plays in 3D from the speaker's pawn: at full volume close by, fading to nothing at the radius, and panned to the side they stand on. Players with no pawn (a menu, a waiting room without characters) hear and are heard as if it were off, so one setting works for the waiting room and for the match. The two combine: team only and within earshot. Start Game uses a seamless travel, and turns on the game mode's *Use Seamless Travel* for it. With the other kind of travel clients disconnect and reconnect while the host is still loading, and Steam Sockets and EOS peer-to-peer report that as a lost host. If your project has no Transition Map set (Project Settings > Maps & Modes), the engine uses an empty one. **Avatar** is the player's Steam picture, a 64x64 texture ready for an Image widget. It is empty for a moment after someone joins, until Steam has loaded it (On Lobby Changed fires when it arrives), and it stays empty on EOS and in crossplay, where players are known by an EOS id and Epic has no pictures to give. Ready states start again after Start Game. To turn the waiting room off, set `[Lobbycraft] bLobby=False`. ### Playing as a group A group of friends that wants to enter games together is a session of its own: the leader creates a **Private** session on a map of yours (a menu, a hangout), invites the others, and everyone is in the waiting room, with chat and voice, before any match. From there the leader takes the whole room somewhere: | Function (Lobby Subsystem, host only) | What it does | |---|---| | **Bring Everyone To Session** (Session, Password) | The whole room moves to a session from Find Sessions. Each player leaves this session and joins that one by themselves; the leader goes last. Refused when the target has fewer free seats than the group. | | **Quick Match Together** (Map, Settings, LAN) | Quick Match for the whole room: joins, together, the fullest matching session that has a seat for everyone. When there is none, this session opens to searches with those settings and starts Map, so the group is the first to arrive. | | Session Subsystem | | |---|---| | **On Group Moved** (Success, Detail) | Fires on each machine when it has followed the group, or could not: the room filled up meanwhile, or was not found. | | **Set Session Private** (Private) | Host only. Takes a running session out of the searches, or puts it back. | What a group is not: it does not outlive the move. Once everyone is in the game's session they are players of that session like any others; to stay together for the next match the leader brings the room along again (the leader of the game they joined can do it for everybody), or creates a private session again and invites. A player who finds the target full stays behind and is told through On Group Moved. On LAN, Set Session Private has no effect on a session that is already running: the engine does not update what a LAN session advertises. Choose Private when you create it. ### Ready-made screens Two screens come with the plugin, so a project can host and join before it has any UI of its own. They are built in code: no assets to migrate, and the same on every engine version. | Screen | Class | What is on it | |---|---|---| | **Games** | `LCSessionBrowserWidget` | The list of games with Join on each row, Refresh, Host, Quick Match and a local network checkbox. On EOS it signs the player in first. | | **Waiting room** | `LCLobbyWidget` | Players with their ready state and who is speaking, Mute, Kick (host), chat, the ready and microphone buttons, Start Game (host) and Leave. | One node shows either: **Show Lobbycraft Screen** (Class). It adds the screen to the viewport, shows the mouse cursor and lets the screen take clicks and typing. **Close Screen** on the returned widget undoes it. Show the Games screen on your menu map and the Waiting room on the map the host opens; a screen goes away with its map, like any widget. To set a screen up, make a Blueprint whose parent is the screen's class, change its defaults and pass that Blueprint as Class: | Default | Screen | | |---|---|---| | Lobby Map | Games | The map Host and Quick Match open. Empty: the map the player is on. | | Password | Games | Host creates the room with it. Joining a locked room from the list asks the player for it. | | Max Players, Lan, Show Lan Option, Settings | Games | What Host creates. Settings also filter the list. | | Game Map | Waiting room | The map Start Game opens for everyone. Empty: no Start Game button. | | Require All Ready, Show Voice, Leave Map | Waiting room | | | Title, Panel Color, Row Color, Accent Color, Text Color, Dim Text Color, Font Size, Panel Size | both | The look. | We made them to get a game online on day 1, and they are enough for a jam or a prototype. For a different layout, build your own widget on the same nodes and subsystems; the screens use nothing you can't call. ### Invites and friends | Node | What it does | |---|---| | **Get Friends** | The friends list, each with Display Name, Online and Playing This Game. On EOS, call Login first. | | **Invite Friend** (Friend) | Invites one friend from Get Friends to the current session. | | **Show Invite Overlay** | Opens Steam's invite dialog. On EOS it opens the friends overlay, and the player invites from there (needs `bEnableSocialOverlay=True`). | | **Set Presence** (Status) | Sets the player's status text. | When a player accepts an invite, or picks "Join Game" on a friend, Lobbycraft leaves the current session and joins the new one by itself. To decide that in your own code (to ask "leave this match?", for instance), set `[Lobbycraft] bAutoJoinInvites=False` and bind **On Invite Accepted** on the Lobbycraft Session Subsystem; it hands you the Session Result to pass to Join Session. On Steam, the friends list only shows custom status text through a rich presence localization file in Steamworks. Set Presence stores the text under the rich presence key `status`; reference it from your localization tokens. ### Account | Node | What it does | |---|---| | **Login** | Signs the player in to EOS: with the Epic account on an Epic launch, with the Steam account on a Steam launch. On Success brings the EOS user id. | | **Get Launch Store** | Steam or Epic. For the rare place where you do need to know. | ### Achievements and stats | Node | What it does | |---|---| | **Unlock Achievement** (Achievement Id) | Unlocks on every store the game is running under. | | **Increment Stat** (Stat, Amount) | Adds Amount to an integer stat on every store the game is running under. | | **Get Stat** (Stat) | Reads the player's value of a stat from the store that started the game. | On EOS, Increment Stat reads the stat back before it answers. The engine alone reports an EOS stat write as done without waiting for EOS, and EOS takes a write to an unknown stat without complaint, so a misspelled stat would look fine and store nothing. With Lobbycraft it comes back on **On Failure**, a few seconds later, saying so. Unlock Achievement and Increment Stat succeed when at least one store accepted the write, and the text lists each store's answer, one after the other (`steam: ...; eos: ...`). ### Leaderboards | Node | What it does | |---|---| | **Submit Score** (Leaderboard, Score) | Sends a score on every store the game is running under. Steam keeps the player's best. | | **Get Leaderboard** (Leaderboard, Count, Friends Only) | The top rows, or the player and their friends, from the store that started the game. Each row has Rank, Player Name, Score and Is Local Player. | On Steam the leaderboard is found by its name. Create it in Steamworks (Stats & Achievements > Leaderboards), where you also choose the sort order. If the app allows clients to create leaderboards, a missing one is created on the first score, highest first. On EOS a leaderboard ranks a stat. In the portal, create the stat in UPPER CASE (aggregation MAX for a best score, MIN for a best time) and then a leaderboard on that stat. Give both the same name, or map them: ```ini [Lobbycraft.EOSLeaderboardStats] BESTSCORE=BESTSCORESTAT ``` In our tests a new score showed up in Get Leaderboard about 10 seconds later; EOS does not promise a time. Call Login first. The engine's EOS leaderboard read only returns players who have an Epic account. A Steam player signed in to EOS without one is ranked by EOS but missing from the rows. ### Cloud saves | Node | What it does | |---|---| | **Save Game To Cloud** (Save Game, Slot) | Stores a Save Game object in the cloud of the store that started the game. | | **Load Game From Cloud** (Slot) | Brings it back. Cast the result to your Save Game class. | It is the same Save Game object you would pass to the engine's Save Game To Slot. Saves are per store: a save made under Steam is not visible under Epic. ### Store (experimental, not tested) **No purchase was ever made through these nodes.** Testing one takes a published game with DLC on Steam, or with offers on the Epic Games Store, and Lobbycraft's test project has neither. What did run, in packaged builds: on Steam's test app, Get Store Items lists its two test DLCs by name and Owns Store Item answers "no" for an id nobody owns. Never seen: an owned DLC, the store page opening, and anything at all on Epic, where the test product's backend refuses the question (403, access denied). Treat them as a starting point, test them on your own game before you ship, and please report what you find. | Node | Steam | Epic | |---|---|---| | **Get Store Items** | The game's DLC: App ID, name, owned. No price: Steam doesn't tell the game. | The game's offers: id, title, description, price as the store formats it, owned. | | **Owns Store Item** (Id) | The player owns the DLC and has it installed. Id is the DLC's App ID. | Id is an offer id, or an entitlement's name or id. | | **Buy Store Item** (Id) | Opens the DLC's store page in the Steam overlay. Success only means it opened: ask Owns Store Item again when the player comes back. | Opens the checkout. Success means the purchase went through. | They use the store that started the game. On Epic the player has to be started by the Epic launcher: the EOS store works on the Epic account, which a Steam player signed in to EOS doesn't have. Not covered: Steam microtransactions and the Steam Inventory. Those need a server of yours holding the publisher key, which is outside what a plugin in the game can do. ### C++ The nodes call three game instance subsystems, which you can call directly too: `ULCSessionSubsystem`, `ULCAchievementsSubsystem`, `ULCCloudSubsystem`, plus `ULCSocialLibrary`. Add `"Lobbycraft"` to your module's dependencies. The headers are commented. ## Config keys All optional, in `Config/DefaultEngine.ini`. ```ini [Lobbycraft] ; Let Lobbycraft switch the project to EOS when the Epic launcher starts the game. Default True. bManageStoreSettings=True ; Steam players use EOS sessions too, so both stores share the same games. Default False. See Crossplay. bCrossplay=False ; The waiting room (player list, ready, chat, kick). Default True. bLobby=True ; Join by itself when the player accepts an invite. Default True. bAutoJoinInvites=True ; A dedicated server advertises itself at startup. Default True. bAutoRegisterDedicatedServer=True ; Player slots of that dedicated server. Default 16. DedicatedMaxPlayers=16 ; Its name in the server list. Default: the project name. DedicatedServerName=My Server [Lobbycraft.SteamAchievementIds] ; Your achievement id = the Steamworks API name, when they differ. FirstWin=ACH_FIRST_WIN [Lobbycraft.EOSLeaderboardStats] ; Leaderboard = the EOS stat it ranks, when the names differ. BESTSCORE=BESTSCORESTAT ``` ## The Doctor Most online problems in Unreal are configuration problems that fail with no error. The Doctor checks the project for the ones we know. **In the editor: Tools > Lobbycraft Doctor.** It checks the project files and opens a Message Log page. Each finding has the problem and the exact fix. Among others: Steam enabled but never started, no App ID, App ID 480 together with EOS, achievements not declared, the net driver that moved in 5.6, a duplicate net driver definition, missing or incomplete EOS credentials, the encryption key field that is stripped from packaged builds, an EOS secret that is not in `.gitignore`, a package without the prerequisites installer. Lines marked Info are portal steps the Doctor can't check from your PC. **In the running game.** In Development builds, when the first map loads, Lobbycraft compares what is configured with what actually started, and shows a message on screen and in the log (prefix `LCDOCTOR`) if they differ: Steam configured but not running, the net driver that fell back to IP, the player not signed in to Steam. Run it again at any time with the console command `Lobbycraft.RuntimeDoctor`. ## Dedicated servers A dedicated server registers itself when it starts; clients list it with **Find Sessions** and Dedicated Servers ticked. Size and name come from the [config keys](#config-keys). On Steam, three things in the engine stop a dedicated server on 5.6 to 5.8, and Lobbycraft deals with each: - **The registration never completes** (it times out after 15 seconds). Lobbycraft does it itself, in the format the engine's server search reads, so nothing changes on the client side. - **The server never starts listening.** Its SteamSockets driver waits for the engine to announce the server login, and the engine never does: clients time out connecting to a server that looks fine. Lobbycraft makes the announcement once Steam has logged the server on. - **No `steam_appid.txt`.** The engine writes that file for a Development game client, not for a server executable, which then starts with no Steam and no error. In Development and Test builds Lobbycraft writes it from `SteamDevAppId` when the server starts. A Shipping server needs the file next to its executable, put there by you. Things to know: - Building a Server target needs an engine compiled from source. The launcher engine refuses. - A Steam server for the local network only is started with the LAN option in its map URL and `-lan`: `MyGameServer.exe /Game/Maps/Lobby?bIsLanMatch=1 -lan`. Without the option the server waits for a Steam login that a LAN server never makes. - The public Steam server list reaches the server from the internet on UDP 27015. Behind a home router that port must be forwarded. - A Linux server on Steam needs Valve's `steamclient.so`, which is not part of the engine: install `steamcmd` on the server machine and copy or link its `linux64/steamclient.so` to `~/.steam/sdk64/steamclient.so` of the user that runs the server. The engine refuses to run as root. - A client and a dedicated server on the same PC fight over the Steam ports. Start that client with `-ini:Engine:[OnlineSubsystemSteam]:bInitServerOnClient=false`. How far we tested dedicated servers is in [What was tested](#what-was-tested), with the numbers. ## Shipping builds - **`steam_appid.txt`.** Development builds write it next to the executable from `SteamDevAppId`. Shipping builds don't. A Shipping build started outside Steam, with no `steam_appid.txt`, runs with no Steam at all and no error anywhere. To test a Shipping build before uploading it to Steam, create `steam_appid.txt` (one line, your App ID) next to the game executable in `<Game>/Binaries/Win64/`. Don't ship that file. Players start the game from Steam, which doesn't need it. - **`bUseLoggingInShipping` and the launcher engine.** Don't set it in your Target.cs with an engine from the launcher: the build stops linking (`unresolved external symbol ... LogType`) as soon as any class replicates a property, which the waiting room does. It takes an engine built from source. - **No log.** With the launcher engine a Shipping build writes no log file, and ignores `-ExecCmds` and `-ini:` on the command line. Do your diagnosis in a Development package. - **Console commands.** The `Lobbycraft.*` test commands are compiled out of Shipping. The in-game Doctor is Development only too. - **`UE_PROJECT_STEAMSHIPPINGID`.** If your `Target.cs` defines it, a Shipping build started outside Steam restarts itself through Steam before any plugin loads. An Epic build of the same game must not define it. ## Testing **Play Test, from the editor.** *Tools > Play Test: 2 players* (or 3, or 4) opens that many game windows on the map you have open, side by side, already in one session: the first hosts on the local network and the others join it. Save the map first; the windows load it from disk. There is no store in these windows and no second account is needed, because each one runs on the engine's Null subsystem, which is what lets several copies of a game run on one PC. So this is for your game's own multiplayer (replication, the waiting room, voice, your UI); Steam and EOS themselves still need a packaged build, as below. The console command is `Lobbycraft.PlayTest [2-4]`. A game started with `-LobbycraftTest=host` or `-LobbycraftTest=join` does the same thing by itself, in any build that is not Shipping. That is all the menu does. **One PC, no second account.** Tick LAN on Create Session and Find Sessions and start the packaged game twice. With Steam running, start the second copy with `-ini:Engine:[OnlineSubsystemSteam]:bInitServerOnClient=false`, or start both with `-nosteam` to test without any store. **Two accounts.** Online sessions and invites need two Steam accounts on two machines (a virtual machine works). Two copies of the game on one PC share one Steam account and can't see each other's lobby. **Epic, without publishing to the store.** Start the packaged build with `-AUTH_TYPE=accountportal`. Login then opens the browser for the Epic sign-in. Remember that only organization members get through until the brand review. **Console commands** (Development builds, key `~`): | Command | | |---|---| | `Lobbycraft.Host <Map> [Max] [lan] [private] [Key=Value ...]` | Create Session | | `Lobbycraft.Join [lan] [dedicated] [Key=Value ...]` | Find Sessions, then join the first result | | `Lobbycraft.Update Key=Value` | Update Session Settings | | `Lobbycraft.QuickMatch <Map> [Max] [lan] [Key=Value ...]` | Quick Match | | `Lobbycraft.Score <Leaderboard> <Score>` / `Lobbycraft.Leaderboard <Leaderboard> [Count] [friends]` | Submit Score / Get Leaderboard | | `Lobbycraft.Store [owns <Id> / buy <Id>]` | The store nodes (experimental, not tested); alone, it lists what the store sells | | `Lobbycraft.Screen games [LobbyMap] [lan]` / `Lobbycraft.Screen lobby [GameMap]` | Shows one of the ready-made screens | | `Lobbycraft.Lobby [ready / notready / chat <text> / kick <NamePart> / start <Map> / mic [off] / tone [seconds] / team <NamePart> <n> / teamvoice [off] / proximity <radius> / moveto [lan] [Key=Value ...] / together <Map> [lan] [Key=Value ...] / private [off]]` | The waiting room; alone, it logs who is there. `tone` sends a test tone as voice | | `Lobbycraft.Leave` | Leave Session | | `Lobbycraft.EOSLogin` | Login | | `Lobbycraft.Unlock <Id>` / `Lobbycraft.Stat <Name>` / `Lobbycraft.GetStat <Name>` | Unlock Achievement / Increment Stat / Get Stat | | `Lobbycraft.Friends` / `Lobbycraft.Invite <NamePart>` / `Lobbycraft.InviteOverlay` / `Lobbycraft.Presence <Text>` | Friends and invites | | `Lobbycraft.RegisterServer` | Register a dedicated server by hand | | `Lobbycraft.RuntimeDoctor` | Run the in-game Doctor | Every operation writes one line to the log starting with `LOBBYCRAFT`, with the result and the reason. ## What was tested We ran everything below in **packaged builds**, not in the editor. Automated on every release, on UE 5.6, 5.7 and 5.8 (Windows, Steam app 480), 78 checks per engine version. Development package: - Steam: increment stat and read it back, unlock achievement (confirmed with Steam), wrong achievement name refused, cloud save and load, submit a score and read the leaderboard back, create session, update settings, friends list, presence, leave, in-game Doctor clean. - Steam LAN through Steam Sockets, and LAN with no store: host listens, filters, settings reach the client, find and join, host accepts the player, private session not listed. - Quick match: the first game finds nobody and hosts, the second joins it. - Play Test: three games started the way the editor menu starts them end up in one LAN session. - Playing as a group: a room of two moves to another session together; with nowhere to go, Quick Match Together starts the match where they are. - Voice channels: a team-only voice is not heard by another team and is heard by the same one; with proximity on, a voice is heard within the radius and not sent beyond it. - Reconnect: a second connection from the same Steam account arrives while the first is still open; the host closes the old one and stays up. - Password: the session is listed as locked, no password and the wrong one are turned away with the reason, the games screen opened afterwards shows that reason, the right one stays, and the password is not among the settings a searcher receives. - Waiting room, host and client: both list the two players, ready reaches the host, chat both ways, voice both ways (a test tone through the codec and the connection, measured on arrival), the host starts the match and the client travels with it, nobody is listed twice afterwards, a kicked player is told why and leaves the session. - Ready-made screens, on a client: the games list shows the host, the waiting room lists both players and has the Steam picture of one. - Host pressed in the middle of a search: it waits for the search, hosts, and the next search still answers. - Store nodes: only that Steam lists the test app's DLC and that a made-up id is not owned. No purchase was tested (see Store, above). - Crossplay, on one PC: a Steam player hosts and an Epic player joins, and the other way round, with voice reaching the host each time and no log line repeating every frame; a Steam game started from an invite joins a private EOS session; the Steam friends list still answers. - Epic (the game started the way the Epic launcher starts it): sign-in, increment stat and read it back from EOS, a stat missing from the portal refused, unlock achievement, cloud save and load, submit a score and read the leaderboard back, an EOS lobby on the EOS net driver, in-game Doctor clean. Shipping package, checked through what a Development build sees afterwards (a Shipping build has no log): - Hosts a session that a Development client finds and joins; joins a session hosted by a Development build. - Cloud save written by Shipping and read back; stat incremented by Shipping and read back. By hand, two machines: | | 5.6 | 5.7 | 5.8 | |---|---|---|---| | Steam online join, two accounts | yes | yes | yes | | Steam: invite into a private session, auto-join, host drop | yes | yes | yes | | EOS lobby: host, find, join between two Epic accounts | yes | yes | yes | | Steam player signed in to EOS, achievements written to EOS | yes | yes | yes | | EOS: invite into a private session, accepted in the Epic overlay, auto-join | yes | yes | yes | | Crossplay: a Steam player invites a Steam friend into a private EOS session, accepted in Steam, auto-join | yes | yes | yes | | Waiting room over Steam online: list, ready, chat, voice both ways (heard), Start Game, kick | | | yes | | Waiting room in crossplay (an Epic host, a Steam player): the same, voice both ways (heard) | yes | yes | yes | | Steam online: password room (wrong one turned away, right one in), the other account's Steam picture | yes | yes | yes | | Steam online: team voice (not heard on another team, heard on the same, 3 times each) | yes | yes | yes | | Steam online: group in a private session, Quick Match Together, the reopened session found by a public search | yes | yes | yes | | Steam online: a second connection from the same account while the first is open, the host stays up | yes | yes | yes | | Crossplay group: an Epic leader and a Steam player in a private EOS session, Quick Match Together, a third Steam player finds the reopened session (3 players) | | | yes | | One PC, with windows: the password typed on the Games screen (wrong one turned away, right one in) | | | yes | | One PC, with windows: proximity voice by ear, 5 distances (louder near, fainter far, silent past the radius) | | | yes | | Editor: Tools > Play Test with 2 and with 4 players, all windows in one session | | | yes | An empty cell means not run yet on that version, not that it fails. Dedicated servers, with a real server executable. UE 5.6 only, because a Server target takes an engine built from source. Server and clients on one PC: | Server | No store | Steam, LAN | Steam, online | |---|---|---|---| | Windows | 8 of 8, 2 clients | 6 of 6, 1 client | 7 of 7, 1 client | | Linux (under WSL, Windows clients) | 8 of 8, 2 clients | not run | 7 of 7, 1 client | - No store: the clients find the server and join, the waiting room lists both, ready, chat, voice through the server, match start, kick. Against the Linux server the clients connect to its address, because a LAN search does not cross the WSL network. - Steam, LAN: one client finds the server and joins, then the room, chat, match start and kick. - Steam, online: the server logs on to Steam and answers the query Steam's server browser sends, and one client joins by the server's Steam ID. Then the same as above. - Two Steam accounts, on two machines, on the Windows server over the internet: both join by the server's Steam ID, the room lists both, ready, chat and voice from one reach the other through the server, match start, kick. - The one-PC runs use one Steam client, because two games of one Steam account are the same player to the server. ## Limitations - The game client is Windows only; a Linux or Mac client is not planned. The dedicated server also builds and runs on Linux. - Dedicated servers, not tested: finding the server in the public Steam list from another network, a LAN search against a Linux server, dedicated servers on EOS, and all of it on 5.7 and 5.8, where the same code compiles but we built no server executable. What we did run is in [What was tested](#what-was-tested). - EOS has no invite dialog of its own in the engine; Show Invite Overlay opens the friends overlay instead. The Epic overlay comes with the Epic Games Launcher and needs a real GPU: it does not load in a virtual machine without one. - Stats are integers, and the only operation is adding. - Cloud saves are not shared between stores. - One local player (no split screen sign-in). - No matchmaking queues (Quick Match joins a room, it does not rank players). - Voice has the whole room, team and proximity. There are no private one-to-one channels and no radio-style channels a player picks from. - The waiting room lives on the host's map: players see each other once they have joined, not before. - A group is a private session that moves together, not a party that persists between matches. - Steam does not work in Play In Editor (an engine limit). In the editor the nodes run on the Null subsystem, which is enough to test LAN flows. ## Troubleshooting **Nothing works in the packaged game, and Steam's overlay doesn't open.** Steam did not start. Is the Steam client open and signed in? Is `steam_appid.txt` next to the executable (Development writes it, Shipping does not)? Was the game started with `-nosteam`? The in-game Doctor names the cause. **On 5.7 the log has no `LogSocketSubsystemEOS` warnings.** Lobbycraft turns them off on 5.7 when the game runs on EOS. On that version the engine prints "Calls to FInternetAddrEOS::GetPort are not valid" twice a frame for every connected player; nothing is wrong, but the log grows by about 50 MB an hour. 5.6 and 5.8 are not affected. To see the category again, run `Log LogSocketSubsystemEOS Warning` in the console. **Find Sessions succeeds with zero results.** On app 480 this happens often: search both PCs from the same region, with different Steam accounts, and make sure the host really is in the session (`LOBBYCRAFT create ok` in its log). A private session never shows up. Two different builds of the game don't see each other either; the engine filters by build id. **The client finds the session and the join fails to travel.** The two sides use different net drivers. Run the editor Doctor: it is usually the `ClearArray` line missing, or Steam Sockets disabled. **Increment Stat or Submit Score fails on EOS with "has no such stat".** The stat is not in the portal under that name. Stat names there must be UPPER CASE. **Unlock Achievement fails with "no such achievement in Steamworks".** The name isn't the Steamworks API name, the achievement isn't published, or it isn't listed under `Achievement_N_Id`. **Save Game To Cloud is refused on Steam.** Steam Cloud is off for the app, or a quota is zero or full (bytes or number of files). **Epic sign-in stops at "Application Access Is Restricted".** The account isn't a member of your organization and the brand review isn't done. **An Epic player gets no invite, and Shift+F3 opens nothing.** The Epic overlay is off. Set `bEnableOverlay=True` and `bEnableSocialOverlay=True` (see [EOS setup](#eos-setup)). The log says "Overlay will not load, because it was explicitly disabled". **Steam players can't sign in to EOS.** App ID 480 can't; use your own. Then check the identity provider (App ID, `epiconlineservices`) and that it is selected in the sandbox. **The game started twice on one PC, and the second copy has no Steam.** Both tried to open the Steam game server ports. See [Testing](#testing). Support: contato@tessaroapps.com