Repository navigation
StreamLayer
Streamline shipped as two halves: the arena client, and a live layer that watched a Twitch channel and turned audience actions into gameplay. The client still carries that half; nothing answers it. This page records what that layer was, what the client still expects, and what a local replacement has to provide.
- Streamote: the web front end a streamer opened — a dashboard for the party, the queue and the audience controls.
- PGS: the service behind it, carrying sessions, parties, polls, votes, bets, bingo and flash sales, plus the channel data the client polls.
- Twitch: identity and chat, with IRC for commands and tags and the Kraken API for stream state.
The client's own classes still name all of it: sl.game.pgs.PGSManager, ModVotingManager,
BettingManager, FlashSaleManager, BingoManager, WagerGame, the mod components
(ModComponent, ModGroupComponent, PropertyModManager), sl.game.util.StreamoteUtils, and the
Twitch UI (TwitchManager, TwitchChatWidget, TwitchIconWidget).
The base URL arrives in the handshake (pgsServer); requests carry a bearer token. Observed live:
-
POST /games/streamline/active_user— heartbeat, answers{ "interval_sec": n }. -
GET /users/<id>/updates/<stamp>— long-poll of user updates; a non-emptyusersarray with an advancingupdate_stampis required, and a hold on the server side bounds the re-poll rate. -
GET /channels— the live-channel list the home menu renders (live_channels).
Votes and sales are channel-scoped:
-
POST polls/create— reply carriespoll_id. -
GET channels/<channel>/poll— the poll state;optionsandvotesare the field names the client knows. - The counterpart paths
wagers/create,wagers/bets,wagers/close,bingos/createandbingos/belong to the betting and bingo features.
Chat is separate: irc.twitch.tv with CAP REQ :twitch.tv/commands and :tags, and
https://api.twitch.tv/kraken for stream state.
-
ModVotingManager.startVoting(window, ownerToken)postspolls/createand keeps the returnedpoll_id. - The poll is polled for its tally; the game state exposes
votingState,voteTally,votingPollID,getRemainingVotingTimeString. -
finishVoting()records the winner inm_modVotedFor;IModManager.applyModapplies it. - The designed path stores the applied state as a replicated UE struct,
AppliedMod, carryingmodID,modGroupIDandmodDuration, held on the game state asActiveModsRepandQueuedModsRep, with the on-rep handler applying it. In hosted play those arrays read empty while a mod is live (see below), so this is the shipped contract, not what a local match actually uses.activateRandomModis a poll-free shortcut that applies a mod directly.
Two things found while mapping this:
-
startVotinghas no caller without a broadcaster. It is reached only through dynamic dispatch, and the surrounding fields (voteOwnerToken,isBroadcastingWithoutFlashSale,isFlashSaleOwner) show whose client calls it. A local project must start the vote itself. -
The host flow is behind the same gate. On a stock client, Play → New Match opens a
"Ready to host Streamline?" panel whose only action is Log into Streamote; its ready branch fails
locally with
No LocalPlayerand the panel is the fallback. Hosting as a listen server today works around that panel rather than satisfying it.
Twenty-nine templates, in three groups that act as per-mode allow-lists: mod_group_default 28,
mod_group_tag 22, mod_group_bitball 21. Relative to the default list, Tag omits nerfed,
points_b_gone, rise_from_your_graves, shady_business, spiritual_cleansing and
vengeful_spirits. Bitball omits those six and also make_it_rain and wolf_among_us, and adds
stop_drop_roll, the one mod the default list does not carry. A Tag match — the mode that works today —
offers the 22. The full
catalogue:
big_head_mode bonus_bonus concrete_shoes crabcore
energy_drink floor_is_lava make_it_rain moon_boots
multi_ball nerfed no_touching perpetual_motion
pleb pogo points_b_gone puke_town
ragdoll rise_from_your_graves sandstorm shady_business
shrink_ray slo_thuggin spiritual_cleansing stop_drop_roll
ugh_ice_level vengeful_spirits wolf_among_us xray_glasses
yakety_hill
Each is a game_mod_* template, so a mod is identified by a template id and no new assets are needed.
Each template also carries its own parameters: a duration in seconds (15 to 60), a selection weight
(1 to 4), a price in the flash-sale currency (500 to 75,000) and a bingoGroup (1 to 4). So a vote can
be weighted, a sale priced, and an applied mod timed — all from the template, with nothing hard-coded.
Their blueprints differ in what they touch: floor_is_lava, stop_drop_roll, sandstorm and
wolf_among_us ship map or fog actors; big_head_mode, concrete_shoes, no_touching,
perpetual_motion, pleb and pogo reference the player pawn, and make_it_rain / no_touching also
reference the seek pawn. The remainder reference no external asset and are the natural first candidates
for a driver test. (The pak also carries helper actor assets — lava per map, smoke, fog — beside the 29
templates, so counts differ depending on whether templates or assets are being counted.)
The catalogue carries everything a timer needs: duration in seconds (15 to 60), a selection weight
(1 to 4) and a bingoGroup (1 to 4). A rotation treats the four groups as four slots and keeps one mod
in each:
- a slot's mod lasts exactly its template
duration; - the next mod in a slot is drawn by
weightfrom that slot's group; - the mod that just left the slot is excluded, and so is any mod already sitting in another slot;
- the four slots start together and then free independently.
Nothing polls a clock. The rotation is a pure function of the seed and the instant asked for, so the gateway can serve it on demand; if a caller asks after a gap, the slots catch up in chronological order and land on the same mods a caller that was asked every second would see.
GET channels/<channel>/mods returns it:
{"source": "rotation",
"slots": [{"mod": "game_mod_floor_is_lava", "slot": 1, "started_at": 1760000000,
"ends_at": 1760000060, "remaining": 43, "duration": 60}]}The mock serves this behind GUL_STREAM, with GUL_ROTATION_SEED fixing the draw. Applying a rotation
to the game takes the same step as applying a voted winner.
This route is the gateway's own surface: the client never asks for it. There is no /mods path anywhere
in the executable, and the mod pipeline it does have is scripted — a mod list with weights
(mods, modWeightOverrides), a createWeightedModList/validate step, an apply queue
(m_modsToApply, storeMods) and per-stack/per-duration bookkeeping (m_modsByStack,
m_modsByDuration). So the rotation is for tools and replacement servers, not something the running game
reads.
GET stream/profile returns the effective profile: mode, poll window, audience size, both seeds, the four
slots, the rules those values imply, and every mod in the pool with its duration, weight and slot. It is
assembled from the same inputs the service runs with, so a tool that displays it cannot drift from
behaviour. Only the Tag allow-list is transcribed; the default and bitball lists are sized and differenced
from the templates, so stream/profile describes the Tag pool.
The host onboarding is gated on one served value: the user-watcher record's roles array. Unless it
contains "broadcaster", NEW MATCH opens a "READY TO HOST STREAMLINE?" panel that asks for a Streamote
login; with it, the lobby opens directly. It is a single field in a reply the mock already sends.
The same role gates a deeper step: the post-login handler starts the user watcher and, when
users[0].roles contains broadcaster, the channel watcher that long-polls channels/<id>/updates
(0x140D4651C stores it; the role test is at 0x140D463F7). The reply it reads is the user resource
GET issued by verifyWithPGS (0x140D488E0), and that GET only happens when the player holds a
non-empty pgsToken (0x140D4889B). The token arrives from loadPlayerFromSession's reply
(0x140D4766D), on a branch that also requires playerSessionID (0x140D473D5). That is a separate copy
from the bearer the client attaches to plain-JSON PGS legs (it sends Authorization: Bearer … on
/parties/create, taken from the auth check), so a server that supplies one has not supplied the other.
That chain is out of reach on a client build. loadPlayerFromSession belongs to a private service: the
appserver-pvt base is referenced only inside a branch gated on a caller flag (0x14056E2ED), and no
logged session has ever sent a private op — more than eleven thousand logged requests cover only the public
appserver legs. So the channel watcher cannot start from this client, and the role on its own is not
enough.
Past the gate there is a second one: the lobby's map grid is inert for a single player, and starting the
match without a selected map logs Could not find map template for map Entry and then faults. A practice
map does not go through the lobby at all, which is why practice is the reliable way into a live match.
The array is ActiveModsRep on SLGameState at offset 0x480: a TArray of 40-byte elements, with
modID (an FName) at +8 and modDuration at +32. Three further fields at +0, +4 and +16 are not yet
identified. The engine's own property lookup resolves it by name and caches the property, and the class
itself is cached, so a driver can find both without scanning.
A hosted match applies mods by itself. In a listen match the game picks and applies catalogue mods on its own — floor-is-lava, wolf-among-us, moon-boots and big-head have all been seen live, with the HUD card and the real effect, from the first round. So making a mod happen is not the missing piece; steering which mod gets chosen is.
And none of the mod arrays is what drives it. The game state carries three consecutive TArray
properties — ActiveModsRep (+0x480), ActiveMods (+0x490) and QueuedModsRep (+0x4A0) — and all
three read empty while a mod is visibly live. The UE-side mod storage is unused in hosted play.
Two traps worth recording. Single memory hits for an active mod id are caches, not state: writing one changed
nothing, and the game overwrote it at the next round. And FName indices are per-process, so comparing raw
indices across launches is meaningless.
Writing one element is straightforward and harmless: the array reads back exactly as written. It does not
apply the mod. ActiveModsRep is replicated, and the on-rep handler that applies entries runs only when
the replication system calls it; a standalone match has no connection, so nothing fires. The same is true
of QueuedModsRep.
Writing the array on a listen host does not help either: with a client actually joined and connected, a direct memory write still produces no replication delta, because the change bypasses the replication system's dirty tracking (this build uses the push model, so there is no value comparison to notice it).
A driver therefore has to invoke the on-rep path itself, and that is where it gets awkward. The native
handler is registered as {FName, function} in the class's own table, and its frame layout in this build is
Object at +0x18 and Code at +0x20. But the function's first act is to tail-call through the object's
vtable at +0x690, and that path expects a script-runtime object — one whose +0x0C holds a runtime type id —
not the UObject itself. Handed the game state, it faults. The remaining question is how the driver obtains
(or constructs) that object; it appears to be created on demand, which is also why it cannot be found
sitting in memory.
Measured in a hosted match with a mod visibly running: all three consecutive TArray properties on the
game state — ActiveModsRep (+0x480), ActiveMods (+0x490) and QueuedModsRep (+0x4A0) — read
empty, and polling them once a second for a whole match never sees a write. The UE-side mod storage is
not what drives a hosted round.
The state is scripted. The game state's Haxe object carries m_activeMods and a replicated mirror
m_activeModsRep, fires a modAppliedEvent the HUD subscribes to, and exposes applyMod / unapplyMod.
The HUD card is a scripted widget, sl.ui.hud.AppliedModIndicator, with the fields m_modIcon,
m_modBG, m_timerText and m_inText, displaying a sl.game.mod.GameplayMod payload through
showMod. It is not fed by getActiveMods(), which walks the empty UE array.
The chooser sits on the game-mode side. A ModGroupComponent per mode holds the allow-list, a countdown
m_remainingTimeForRandomModSelection, and queueActivateNextMod, which activates a mod drawn from that
component's group. That is the surface a local selection has to reach: the game already has a working
selection path; what it lacks is a reason to choose a particular mod.
- Selection: a server-owned vote window with a simulated audience, so a solo player still sees a contest; or the rotation above when there is no audience to vote. The gateway serves both.
-
Application: catalogue mods have exactly four application entries on the hop
0x1407BD200—activateRandomMod(the vote layer,0x140BAE1E0),deployActivatedMods(the flash-sale manager,0x140BA668E),queueSpecificMod(0x1407B61D0, no callers) and the cheat commandmodApply(0x140D2C0E6) — and none of them runs at match start, while the mod arrays measured empty during a mod-like change. The HUD entry that shows a mod (Component_HUD_ActiveModArea/…_ActiveModEntry) draws a catalogue name and short description from the mod's own component, so a visible card implies a catalogue mod in state — which is exactly what the empty arrays say cannot be there. There is noRoundModifiersystem in the build, and the game modes' named rules (toggleLavaFloor,toggleBoostBonus,toggleHidePoints, thenerfed/killerGhosts/ghostBustersswitches) have no display strings of their own. The one-shot banner (AppliedModIndicator) is catalogue-backed too — it renders the same component slots — and its show path never touches the arrays, so a mod can reach the screen without ever being in them. That is the most consistent reading of the three facts (mods visibly apply, arrays read empty, text is catalogue-derived): the arrays would then be a side record rather than the mod storage, and mods would be applying after all. The run that settles it reads the arrays and captures the screen together. WritingActiveModsRepis still not a route: the array is append-only through the push model, so a direct write raises no delta.
activateRandomMod (0x140BAE1E0) is the vote path's picker: the mode's group expands into a weighted list
(createWeightedModList, 0x140D49490), a random index (0x140865210) bounded by the list length selects
an element, and that element is applied at 0x1407BD200 — the same hop queueSpecificMod uses. The index
comes from the CRT's rand(), seeded once from (pid << 16) | pid xored with clock()
(0x14084DB6C-0x14084DB8E), so the pick is neither reproducible from game state nor steerable by a
setting. The per-mode group is an FName the game mode writes itself (mod_group_default,
mod_group_tag, mod_group_bitball) whose contents resolve through the model registry.
So a gateway can tell the game that a mod should be applied and which one only by naming it on that apply hop; it cannot bias the choice with data. And this is the vote path: the path by which an ordinary hosted match picks its own mods is still unidentified.
There is no user-level shortcut either. The game ships a cheat catalogue (modApply, modEnable,
modRemove, playerBroadcast, match-control commands) under utils.AppCheatManager, but its only entry
point has no caller and the reachable cheat router does not include it — see
RuledOut.
Open questions: whether the per-mode group can be replaced at runtime or is fixed when the match starts; which mods are safe in each mode; and how the tally is nested in the poll object.
The live layer is entered through a private-service call: the channel watcher starts from
loadPlayerFromSession on the appserver-private base, and that base is used only on a branch the caller has to
open. A recorded session of more than eleven thousand requests contains none of those calls, and a
listen-booted match never polls the channel list at all. No lobby flow, role or channel reply therefore
reaches the layer in this build; it needs a client configuration that actually speaks the private service.
The local replacement serves the layer's read side, and the game's own mods run under their own rules —
making the service choose a mod needs an in-process call, not another endpoint.
A client patch can apply a chosen catalogue mod inside a live match. The game already applies its own mods
through applyMod on the game state, called from activateRandomMod; a patch that hooks that call can hand the
same function a different mod id. Verified in a hosted match: two applications in one match, HUD and game state
intact, host stable.
Three details decide whether it works, and each was found the hard way:
- Hook the game's own call site, where the game-mode object is already in the register the function expects. Reaching the same function from a lifecycle hook instead, with a guessed object, faults.
-
The argument cells must be writable. They are two 16-byte values — the mod id as
{u32 length; u32 pad; char *chars}and an empty one — and the callee writes into them. Cells placed in a read-only section crash the client; cells built on the stack do not. -
Pre-call stack alignment is 16 bytes. Three pushes and a
0x48subtraction work;0x40does not.
The profile is host-mod. The id is not baked in: the overlay polls the service's current mod and writes it
to a small shared cell, and the cave applies whatever the cell holds — verified end to end in a match, with the
cell following the rotation live. When the cell is empty (no service, or a failed fetch) the cave replays the
game's own pick, so an unconfigured client behaves exactly as stock.
Limits, stated plainly: the profile is experimental; it substitutes the game's random pick rather than adding a mod alongside it; it was exercised on one map and one mode; and it fires when the game next picks a mod (about once a round) rather than at a chosen instant.
Related: Roadmap · OpenProblems · Entities