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.
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.
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: the game applies catalogue mods by itself in a hosted match, so the missing piece is
not a way to apply one but a way to choose it. Writing
ActiveModsRepdoes not achieve that — the array is replicated through the push model, so a direct write raises no delta, and the on-rep handler expects a script-runtime object rather than the game state. SteeringModGroupComponent— its allow-list or its countdown — is the route that leaves the game's own apply-and-replicate path intact.
Open questions: whether the per-mode allow-list 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.
Related: Roadmap · OpenProblems · Entities