Start here

↑ ↓ to move, Enter to openKeyword search
Multiplayer

The end of a match: standings, the vote, the next game

Rendered from the repository, where it is written as the work happens: it keeps its history, and a status line above says when it describes a design rather than something shipped.

A custom game ends with everyone still together: the final standings in the map, then a post-game screen on the menu where the fireteam votes on the next game, and the host starts it. Nobody leaves the fireteam. Status as of 2026-10-02; updated 2026-10-31.

What the game does on its own, and why we don't use it

  • A Megalo variant's EndRound (action 21) with rounds left raises round_over and resets the round in place: everyone respawns on the same map with no travel. At the last round it raises game_over. About 15 s later the host goes back to the menu.
  • That return sends every client ClientTravelInternal("/Game/Levels/UI/Frontend/Frontend", TRAVEL_Absolute, bSeamless=false) (two PCs, 2026-10-02). Each client loads its own menu and disconnects, and so leaves the fireteam. This is Unreal's "host returns to the main menu" behaviour, not an error.
  • A seamless travel to the frontend keeps the clients: servertravel /Game/Levels/UI/Frontend/Frontend on the host sends b=2 c=true, and the client arrives in the client lobby, still connected. The host swaps its controller for a BP_FrontendPlayerController and can start the next game from there as usual.
  • Switching straight to the next map from inside a map does not start a game under Megalo (re/megalo_engine.md, "Rounds, the end of a game, and the next map"). That is why the vote happens on the menu.

So MJOLNIR's variants give a game 31 rounds (mjolnir megalo write --rounds, default 31), and a match is the first round. The game never reaches game_over, and the host ends the match itself.

The flow

  1. In the map (MJOLNIRHud): the first round_over is the end. Every machine freezes its tallies, shows the scoreboard as the final standings (winner, game type, map, "RETURNING TO THE LOBBY"), and writes them to MJOLNIRHud\last_match.txt (Scoreboard.results). The round the game resets behind the standings does not score. With them go each player's medals (a medals line after the player's, by the medal's incident name: headshot_kill=4, multikill_x2=2 ..., most earned first), their score and kills at 48 evenly spaced moments of the match (series, killsat; the HUD samples every five seconds) and how long it ran (clock).

    The post-game screen's left side has three pages under the winner (mods/MJOLNIRLobby/Scripts/postgame.lua):

    • Overview: the top three as cards (avatar, score, kills, deaths, K/D and their five best medals), the local player's medals by name, and the match's bests (most kills, best K/D, most medals, fewest deaths).
    • Scoreboard: every player, as before; a row still opens the report panel.
    • Timeline: the top four players' scores over the match as lines, each ending in its final score, and the kills of every minute as bars with the busiest minute in gold.

    A medal is drawn as a disc and a notched rim in its colour with one of the feed's glyphs on it, or a numeral for a multi-kill (x2) or a spree (5). The art is ours (tools/ue/draw_hud_icons.py); the game ships no medal icons. A medal's title, glyph and class come from MJOLNIRLobby's DLL. A UI container from before the pages has no tabs: there the screen shows the scoreboard, with the local player's medals as a line of text under the winner.

  2. The host waits 7 s (FINAL_SECONDS), then runs the seamless servertravel to the frontend. A game_over (an older 1-round variant) makes it travel at once, before the game's own return.

  3. On the menu (MJOLNIRLobby), the host finds fresh standings (under 180 s old, not shown yet) and pushes WBP_MJOLNIRPostGame. It holds the standings and the vote on four options: the same game again, then other maps in a random order with the same game type where they have it.

  4. The vote lasts 20 s. Everyone votes on their own copy of the screen.

    • When it ends, or the host presses START NOW, the most votes win; a tie goes to the earlier option. With no votes, the rotation moves on to the second option.
    • The host starts the winner through the same calls as START GAME, and the fireteam follows into the map.
    • LOBBY, or Back on the host, ends the vote and opens the lobby to pick by hand.
    • A chosen game that cannot start (its map is not installed, or its world is in no container) does the same, with why on the lobby's status line. Before MJOLNIRLobby 0.23.0 the vote stayed on STARTING THE NEXT GAME with LOBBY disabled (two PCs, 2026-11-07).
    • A host who leaves the match by hand gets the lobby, never a vote: the pause menu's SAVE AND EXIT (its YES calls BlamCampaignFlowGameSubsystem.EndCampaign) or LeaveGame from script. Standings written before the leave (a leave while the final standings are up), or within 30 s after it, belong to the match left (Live.quitEnded). In the two-PC run a host's LeaveGame with a joiner in the match opened the vote, which started another match 20 s later with nobody voting. A host alone who leaves mid-match writes no standings and gets no vote either way.
    • The joiners of a host who leaves by hand come along. Between two PCs (2026-11-07, both SAVE AND EXIT's EndCampaign and LeaveGame mid-match), the joiner follows the host's travel into its frontend, has the host's game state within about 2 s, and stays in its fireteam and PlayFab lobby: the host's lobby screen, the joiner's client lobby.
    • Between test copies on one PC it strands them. With every copy on one account (tools/remote/instances.mjs), the joiner lands in a frontend with no host's game state: a black screen until the PlayFab net driver's ConnectionTimeout (120 s; 121.8 s measured), then CONNECTION LOST, which leaves the host's lobby and makes the joiner a fireteam of its own. Likely because the copies' host listens through the ?listen console command, not the game's MemberAdded flow. In a test copy only (MJOLNIR_INSTANCE; Live.STRANDED_WATCH), MJOLNIRLobby 0.23.1 cuts that short (Live.stranded, Live.watchStranded):
      • A client that had players and then sits in the frontend with no game state, or none with players, for 10 s (Live.STRANDED_AFTER; MJOLNIR_STRANDED_AFTER sets it) cuts the connection's ConnectionTimeout to 1 s. That is the game's own CONNECTION LOST and lobby leave, about 20 s after the host left, then "The host left the match." under the game's dialog.
      • The engine's disconnect is the fallback. It reaches the menu but keeps the joiner in the host's lobby.
      • Not the fireteam's leave: CanLeaveFireteam read through the missing game state and crashed. It also crashes on a stale view model from FindAllOf.
      • It stays off on a player's PC, where its one trigger would be a false one: a client in the frontend ahead of a slow host's game state. On every normal travel seen, on two PCs and on copies, the game state came before the next 1.5 s poll.
    • A client's standings are the host's vote's. Since MJOLNIRLobby 0.23.1 a client in the frontend marks them seen. Before, a client back on its own menu within 180 s of a match it played (seen on copies, after the exit above) opened a post-game vote of its own on it, and the vote's cancel put the lobby over the reason it was there.
  5. Joiners get our lobby instead of the game's CLIENT LOBBY whenever the host is in it: the host's map and game type, with START GAME, CHANGE MAP and GAME TYPE hidden (and, since they were added, PRIVATE / PUBLIC GAME, MAX PLAYERS and GAME SETTINGS). Since mods-v0.20.0, a joiner without the host's map, or with another release of it, sees START GAME as DOWNLOAD MAP or UPDATE MAP (live_map_install.md).

  6. A joiner the host starts without (a map it lacks, or another release of it; starting, or the host's kick) leaves the fireteam, and the game itself says only CONNECTION LOST. Since MJOLNIRLobby 0.23.0 the joiner's own lobby then opens the map's download screen with why: which map and game type, that this PC doesn't have it, and that DOWNLOAD gets it without a restart (Live.leaveFor, Live.showNotice). A kick for another reason shows the host's reason. Leaving the fireteam loads the frontend again, so since MJOLNIRLobby 0.23.1 the screen waits for that fresh frontend (or 12 s) before its 3 s delay; before, a kick from the post-game vote, where the joiner already is on the frontend, could put the screen up in the world being left, and the joiner saw only the main menu (one PC, two copies, 2026-11-07).

The vote, the lobby and their lists offer only maps whose world is in a container here: MJOLNIRLevelLoader's mjolnir_worlds_known answers from the same index a start's travel resolves its world through, so a maps.json entry whose containers are gone (a leftover of mjolnir level bake --install-test) is left out and logged, and START GAME on one fails with why.

Each machine shows its own standings. They agree because every machine counted the same incidents (multiplayer_hud.md).

The vote panel

Since MJOLNIRLobby 0.19.0 and the chunk-984 UI container cooked with it (which ships in the CE runtime pack, 2026-10-31), the options are a two-by-two grid of tiles, each of them the button you vote with:

  • the map's hub screenshot, and over its foot a band with the game type's icon (the game type picker's, T_MJMode_*), the map, the game type and the votes so far;
  • a gold bar along the bottom edge, the option's share of the votes;
  • pills for PLAY AGAIN (the game just played), DOWNLOAD (a map this PC lacks) and YOUR VOTE, and a blue ring round your vote.

Above the tiles: how many have voted, the seconds left on a disc, and a bar that drains. Both turn gold for the last five seconds and grey while a report holds the vote. When the vote is decided, the winner gets a gold ring and NEXT GAME, the others fade, and the header names the next game.

Every text in a tile is clipped to it, so a long map name ends in an ellipsis. The screen before wrote each option on one line ("AGAIN / BLOOD GULCH / TEAM SLAYER"), which ran out of the panel. The tallies moved from the footer into the vote's header, and the leading game's screenshot above the options went, since every tile has its own.

The two halves still mix either way (checked in game, 2026-10-31). An older MJOLNIRLobby on the new UI writes its one-line labels into the tiles, cut short with an ellipsis. This MJOLNIRLobby on an older UI container (one with no VoteMode0) draws the old lines.

Messages between the host and its fireteam

There is no replicated class of our own. Two of the engine's PlayerController RPCs carry the messages (mods/MJOLNIRLobby/Scripts/net.lua):

DirectionRPCWhy it is safe
client to hostServerExecRPC(Msg)Its body is compiled out of Shipping builds. The host's hook reads Msg; self is the sender's controller.
host to clientClientMessage(S, Type, MsgLifeTime), Type = "MJOLNIR"The engine prints only the None and Say types. The client's hook reads S.

A message is MJOLNIR|<verb>|<field>...:

VerbFromFields
votehost, every secondid, seconds left, options (CODE:mode:again;...), counts, chosen option, the chosen map's campaign-list index, its hub release id and version, held (below)
ballotanyone, the host includedid, option
cancelhostid
lobbyhost, while its lobby is upmap code, game type, game settings line (host_game_settings.md), campaign-list index, hub release id, version
startinghost, as it starts a gamemap code, hub release id, game type
mapstatea client getting the host's mapmap code, stage, percent (live_map_install.md)
wherea client joining a match under waymap code
mapindexhost, in answer to wheremap code, campaign-list index
kickhostwhy; the map code when it is a map they lack (MJOLNIRLobby 0.23.0), which the client offers with the reason
reportinganyone on the post-game screen1 when the report panel opens, 0 when it closes: the host holds the vote
iama clientits identity ticket (player_identity.md)
whoisa client with no roster yetnone
idshostits hub account, the roster of in-game name to hub account

The vote's ninth field is 1 while the countdown is held for a report. MJOLNIRHud's feed, clock, match, matchid, say, chat and cmd, and MJOLNIRLevelLoader's event, use the same two RPCs (multiplayer_hud.md).

Hooks on both functions (native, with parameters) ran on CU4 without trouble (2026-10-02). The host never sends a client RPC to a controller with no player or player state: a controller left over from the previous world would run it locally.

Files

  • mods/MJOLNIRHud/Scripts/main.lua: finishMatch, the final standings, the host's travel.
  • mods/MJOLNIRHud/Scripts/scoreboard.lua: Board.winner, Board.results.
  • mods/MJOLNIRLobby/Scripts/main.lua, "After a match": the post-game screen, the vote and the client lobby.
  • mods/MJOLNIRLobby/Scripts/net.lua: the messages.
  • unreal/MJOLNIRMaterials/Scripts/build_mjolnir_ui.py, build_post_game: WBP_MJOLNIRPostGame, in chunk 984 with the other screens.
  • mods/MJOLNIRLevelLoader/Scripts/main.lua: a travel that names no scenario (the way back to the menu) leaves the Megalo patches alone. Restoring them under a client's running Megalo game froze it mid-travel.

Open

  • Two PCs: the vote end to end (a client's ballot reaching the host, every screen following the outcome) and the client lobby. Steps: two_pc_test.md, Phase 4. Update 2026-10-21: verified on two PCs on 2026-10-09 (e98d2152): the post-game vote chose The Longest, and the host's pick of a map the guest lacked (Hang 'em High) went the same way; each was downloaded in game and played by both PCs.
  • A client that joins during the vote sees it from the next broadcast; one that joins mid-match is not handled yet. Update 2026-10-21: since mods-v0.12.0 (PR #130) a client can join a public match under way; a private game still refuses a join mid-match.
  • The vote's tiles (2026-10-31) were checked on one PC, as the host only. A fireteam client's view (its clock runs on from the host's last message), the DOWNLOAD pill for a map the client lacks, and the grey clock while a report holds the vote still need two_pc_test.md, Phase 4.
  • The tallies are HUD-side. Reading the Megalo score itself would make a client's standings authoritative.