Skip to content

StreamLayer

Lakeland97 edited this page Nov 1, 2026 · 34 revisions

Stream layer

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.

What it was

  • 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).

What the client asks the service for

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-empty users array with an advancing update_stamp is 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 carries poll_id.
  • GET channels/<channel>/poll — the poll state; options and votes are the field names the client knows.
  • The counterpart paths wagers/create, wagers/bets, wagers/close, bingos/create and bingos/ 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.

How a vote becomes a mod

  1. ModVotingManager.startVoting(window, ownerToken) posts polls/create and keeps the returned poll_id.
  2. The poll is polled for its tally; the game state exposes votingState, voteTally, votingPollID, getRemainingVotingTimeString.
  3. finishVoting() records the winner in m_modVotedFor; IModManager.applyMod applies it.
  4. The applied state is a replicated UE struct, AppliedMod, carrying modID, modGroupID and modDuration, held on the game state as ActiveMods and QueuedMods; the on-rep path does the work. activateRandomMod is a poll-free shortcut that applies a mod directly.

Two things found while mapping this:

  • startVoting has 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 LocalPlayer and the panel is the fallback. Hosting as a listen server today works around that panel rather than satisfying it.

The mod catalogue

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. A Tag match offers the 22; relative to the default list it excludes six gameplay-changing mods, and Bitball excludes those six plus make_it_rain and wolf_among_us while adding points_b_gone. The full set:

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.)

Rotation without a vote

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 weight from 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 in the templates but not yet decoded, so stream/profile describes the Tag pool.

What a local replacement needs

  • 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.
  • Application: a small client change that resolves the ActiveMods property by name at runtime and appends the chosen AppliedMod, letting replication apply it. The game resolves its own properties by name (UStruct::FindPropertyByName-shaped), so no offsets need to be hard-coded.

Open questions: which mods are safe in each mode; how the tally is nested in the poll object; and whether a joined client sees the host's change without a full appserver session on the host.

Related: Roadmap · OpenProblems · Entities

Clone this wiki locally