Public beta — bugs are expected. Questions or issues? .
Skip to content

AnimStream Originals Game SDK

Build games for TikTok LIVE

Connect your game to AnimStream Studio. TikTok gifts trigger actions in your game. Studio handles launch, gift rules, the Gift Wall and leaderboards.

Engines
Godot 4 · Unreal Engine 5 · Unity
Target platforms
Windows · macOS · Linux
Interface
Local WebSocket · Protocol 1
On this page

Quickstart

Quickstart: Godot, Unreal Engine or Unity

Pick your engine. Godot 4 is the recommended path for AI agents because everything builds and tests from the command line. Unreal Engine 5.3+ has the same depth: a complete plugin and a template with every standard mechanic. Unity gets the base protocol with the optional helpers.

Godot 4 is the recommended path. The Godot template is a complete, runnable AnimStream game: AnimStream autoload, round loop with game state, a stackable and a timed example action, score submission with a top list, a gift guide and export presets. You implement your idea where the template marks # GAME IDEA.

  1. 01
    Install Godot 4.3 or newer (tested with 4.7.2) and the export templates of exactly the same version.
  2. 02
    Create the game in the developer dashboard (title, slug, engine) and note the game ID.
  3. 03
    Download the template, compare its SHA-256 with checksums.json, extract it into an empty folder and import it once.
  4. 04
    Edit manifest.json (game ID, actions, default gift rules, leaderboard) and implement your idea at the # GAME IDEA markers.
  5. 05
    Test with the mock Studio from the agent kit: it launches the game like Studio and checks every message, also in the mode for older Studio versions (--legacy).
  6. 06
    Export natively, create the ZIP with the packer, upload it and submit it for review (dashboard or release CLI, see Releases and updates).
Godot · action, phase and score
# scripts/main.gd of the template. AnimStream is the SDK autoload.
const SPAWN_ZOMBIES := "spawn-zombies" # stackable: {count}

func _ready() -> void:
	AnimStream.register_action(SPAWN_ZOMBIES, _spawn_zombies) # every manifest action
	AnimStream.session_ready.connect(_run_rounds)

func _spawn_zombies(params: Dictionary, context: Dictionary) -> bool:
	var count := int(params.get("count", 1)) # Rose x99 can arrive as count 99
	# GAME IDEA: the real effect, for example spawn count zombies
	_feed.text = "+%d %s" % [count, _viewer(context)] # plain Label text, never markup
	_report() # set_state(phase == "playing", phase, score)
	return true # acknowledge once the effect has started

# Round end: Studio holds new actions, the final score goes to the leaderboard.
_enter("round-over", BREAK_SECONDS)
AnimStream.submit_score(score, _on_score_submitted)
Commands
# once after extracting
godot --headless --path . --import

# test (agent kit; once: npm ci --prefix tools/mock-studio)
node tools/mock-studio/mock-studio.mjs run --manifest manifest.json -- godot --headless --path .

# export and package every platform (ZIPs + dist/release.json)
godot --headless --path . --export-release "Windows Desktop" build/windows/Game.exe
node tools/package/animstream-pack.mjs --all

# log in once (you approve in the browser), then publish
node tools/release/animstream-release.mjs login
node tools/release/animstream-release.mjs publish dist/release.json --wait

Downloads

Godot 4

Recommended

Complete game template with the SDK (addons/animstream/), round loop, example actions, leaderboard, gift guide and export presets for Windows, Linux and macOS.

Agent kit

AGENTS.md, CLAUDE.md, skills, bootstrap prompts, protocol, manifest schema, TypeScript types, mock Studio, ZIP packer and release CLI.

Unity 2022.3+

UPM package com.animstream.originals: base protocol and the same optional helpers as Godot. So far verified only against an API shim, not in a Unity editor.

Unreal Engine 5.3+

Plugin + template

Plugin AnimStreamOriginals (C++ and Blueprint, complete protocol with game state, leaderboard and gift rules) and the template CommunityCounter with lobby, pause menu, leaderboard and portrait window for Windows and macOS.

checksums.json (SHA-256)PROTOCOL.mdmanifest.example.jsonREADME

Concept

How AnimStream games work

Every AnimStream game follows the same pattern of five building blocks. Your game provides the mechanics, Studio everything around TikTok LIVE.

Availability

Studio announces supported protocol extensions such as stacking, game state and leaderboards in ready.features. Check this list to keep your game compatible with earlier Studio versions.

TikTok LIVE

  • Viewers send gifts
  • Comments, follows, likes
Gifts

AnimStream Studio

  • Gift rules → actions
  • Game control (F7)
  • Stacking · queue
  • Gift Wall · leaderboard · Flows
action ⇄ action-result · state

Your game

  • executes actions
  • rounds, score, effects
  • set_state · submit_score
Studio and the game talk over a local WebSocket connection on 127.0.0.1 (protocol 1). The game never receives account credentials.

01

Gift actions

Your game's manifest declares actions, for example spawn-zombies with a bounded integer count or invert-controls with seconds. Viewers trigger them with TikTok gifts through gift rules. Spawn-like actions are stackable: Studio merges waiting actions of the same rule, viewer and gift and adds up count. Rose ×99 becomes one action with count: 99, bounded by min and max; anything beyond becomes another action.

02

Game control and Gift Wall

Studio provides gift rules, tests and the Gift Wall; your game implements none of them. When an Originals game connects, Studio opens the game control window beside it without taking focus: connection, queue and game state, a test button for every action, gift rules with parameters, the default gift rules, the game's Gift Wall, the leaderboard and the TikTok username consent. F7 brings the window above a borderless fullscreen game and back. So never bind F7, and use borderless fullscreen or windowed mode.

03

Default gift rules

defaultBindings suggests one gift per action. On the first connection without rules Studio asks "Use the game's default gift rules?". Existing rules are never overwritten and nothing is applied without confirmation. Gifts are matched by name, not by ID, because IDs differ between TikTok's regional servers.

04

Game state

With state the game reports acceptingActions, phase and score. In menus and between rounds Studio holds the queue instead of letting actions fail. Studio Flows get the event "Game state" and the conditions "Game phase", "Game score" and "Game accepting actions".

05

Leaderboard

Every published game automatically has a global leaderboard, with no database or server of your own. Streamers are the players: your game submits the final score at the end of a round (submit_score) and reads the top list (get_leaderboard). It is public at /<locale>/games/originals/<slug>/leaderboard.

Optional

Raw events: with events in the manifest the game receives normalized events such as COMMENT or GIFT for tickers and ambient effects. A raw gift and a gift rule must never cause the same effect. Details

Compatibility

Protocol 1 stays stable. On Studio 0.1.285 and older features is absent: no stacking, game state, leaderboard or default rules. Your game must still work completely. Details

AI agents

Start with AI agents

One prompt plus your game idea is enough. Claude Code, Codex or another coding agent downloads the Godot template and the agent kit, verifies the checksums, designs the manifest, implements the idea in the template, tests it against the mock Studio, exports it and prepares the release.

  1. 01
    Create an empty folder and start the agent in it: claude for Claude Code, codex for Codex.
  2. 02
    Copy the bootstrap prompt, replace <<GAME IDEA>> with your idea (a few sentences are enough) and send it.
  3. 03
    Answer the questions: the game ID from the dashboard and, if needed, where Godot is installed. Nothing is uploaded until you say so.
Bootstrap prompt · English
Build a new AnimStream Originals game for me with Godot 4: a native game that TikTok LIVE viewers control with gifts. AnimStream Studio launches the game, turns gifts into game actions through gift rules and provides the game control window (presets, gift rules, action tests, Gift Wall), stacking of gift streaks and a global leaderboard. The game implements gameplay only. Studio announces its features in ready.features; older Studio versions know neither presets nor action images, game state or leaderboards, and the game must run either way.

My game idea:
<<GAME IDEA>>

Engine: Godot 4.3 or newer (the SDK is tested with 4.7.2). Use Unity or Unreal Engine only if I explicitly ask for it. Unreal Engine 5.3+: download animstream-unreal-sdk.zip instead of the Godot template and follow engines/unreal.md of the skill animstream-game; its CommunityCounter template implements the same checklist, and the commands below have Unreal equivalents there (I build and package in my own Unreal installation). Unity has no template: implement the checklist from engines/unity.md.

Originals checklist (binding; a point is done only when its check in brackets passes):
1. Every action has label and description in German and English (description at most 120 characters) and an image. [`node tools/mock-studio/mock-studio.mjs validate manifest.json` without IMAGE FAIL and without ADVICE about images or descriptions]
2. Exactly three presets by coin value, each with at most 8 gift rules and a mix of sabotage (hurts or annoys the streamer) and mercy (helps the streamer): small-budget "Kleines Budget"/"Small budget" (every gift ≤ 30 coins: Rose 1, Finger Heart 5, Perfume 20, Doughnut 30 …), medium "Mittel"/"Medium" (99–299 coins: Hand Hearts 100, Confetti 100, Hearts 199, Corgi 299 …), big-gifts "Große Geschenke"/"Big gifts" (≥ 500 coins: Money Gun 500, Swan 699, Galaxy 1000, Fireworks 1088 …). Exact TikTok display names; bigger gifts get stronger parameters. Every action has "effect": "help" (mercy) or "sabotage" ("neutral" only when it is neither), and every preset is balanced, for example 2 help + 2 sabotage or 4 + 4. [scenario presets; validate shows [help]/[sabotage] on every action and "N help · N sabotage" per preset, without ADVICE about effects]
3. giftWall with columns, "sort": "preset", "showCoins": true, "showLabels": true, a German/English title and "split": true (help left, sabotage right; optional, recommended). [validate shows the wall and the split wall]
4. leaderboard with a German/English label and an order (desc: higher is better; asc: lower is better, e.g. a time in ms). [validate]
5. defaultBindings for older Studio versions, normally the small-budget preset. [validate; smoke --legacy]
6. One image per action at media/actions/<action id>.png in the binding art direction of animstream/ART-DIRECTION.md: glossy 3D cartoon clipart like the style pack of AnimStream's GTA and Supermarket mods (animstream/art/reference/), one clear centred motif, transparent background, square, no text (one short sign such as 2X at most), an element of the game world in every image, mercy actions green and sabotage red/orange, readable at 64 px; 512×512 PNG with alpha, at most 300 KB, made with tools/art/generate-action-images.mjs. I approve two test images before the rest is generated. Replace the template's placeholder images before release. [`node tools/art/generate-action-images.mjs --check` exits 0; animstream-pack --all without action image errors, placeholder or look warnings]
7. Lobby: the game starts in phase lobby with set_state(true, "lobby"); actions sent in the lobby are kept and applied when round 1 starts, never rejected; round 1 starts automatically after about 15 s (an optional "start now" key is fine). [scenario lobby]
8. German and English in the game: default from the session language (AnimStream.language), otherwise the OS locale; switchable on the start screen and in the pause menu; the choice is saved in user://settings.cfg. [watch runs with --language de and --language en]
9. Pause menu on Esc: controls, language, music volume, effects volume, mute, all saved; while it is open the game reports set_state(false, "paused") and stops its timers, then resumes the previous phase. Never pause the SceneTree in a way that stops the AnimStream autoload (heartbeat). [scenario pause]
10. Game over: submit_score, then get_leaderboard shown in the game with the own rank highlighted and profile pictures (load_avatar, initial as fallback). [scenario leaderboard including the picture check]
11. Portrait streams: window at most about 1080×1180 (TikTok portrait streams crop the game into the 9:16 canvas), UI readable at that size; F11 toggles borderless fullscreen, never exclusive fullscreen; never bind F7 (Studio uses it for the game control window). [watch a windowed run]
12. Music: several tracks, shuffled, only with a commercial licence that covers live streaming and selling the game (no "free for personal use" tracks, no copyrighted music without licence); keep licence files and receipts in licenses/ and list them in GAME-DESIGN.md. The template ships only a silent placeholder. [licence list complete]
13. Store material: cover 1920×1080 (German and English), icon 512×512 or 1024×1024, splash (boot splash / start screen), trailers 16:9 and 9:16, each in German and English, each with its own poster. [`animstream-release.mjs checklist --game <id>`]
14. Tests green: smoke, stacking, pause, leaderboard, smoke --legacy, presets and lobby. [`node tools/mock-studio/mock-studio.mjs run --manifest manifest.json --scenario <name> -- godot --headless --path .`]
The Godot template already implements points 1–12 (with placeholder images and silent music): start from it and keep this behaviour.

Work through these steps in order and on your own. Write code, comments and file names in English.

1. Project folder: work in the current directory if it is empty, otherwise in a new subfolder named after the game (lowercase letters, digits, hyphens). Initialize a git repository.

2. Download only from https://animstream.com/game-sdk/ : checksums.json, animstream-game-agent-kit.zip and animstream-godot-sdk.zip. Compute the SHA-256 of each ZIP (sha256sum, shasum -a 256 or Get-FileHash -Algorithm SHA256) and compare it with archives["<file name>"].sha256 in checksums.json. If a value is missing or differs, stop and tell me. Do not open or run anything from an unverified archive.

3. Install: extract animstream-godot-sdk.zip into the project folder. It is a complete game template, and the project folder becomes the Godot project (project.godot at the top level). Extract the agent kit to .animstream-kit/ and run its installer from the project folder: `sh .animstream-kit/install-skills.sh --project .` (Windows: `powershell -NoProfile -ExecutionPolicy Bypass -File .animstream-kit\install-skills.ps1 -Project .`). It adds AGENTS.md, CLAUDE.md, the skills, tools/ and animstream/. Then delete .animstream-kit/ and the downloaded ZIP files.

4. Godot: find a Godot 4.3+ editor (for example `godot --version`). If there is none, ask me for its path or for permission to download the official release and the matching export templates from https://godotengine.org/download. Import the project once: `godot --headless --path . --import`.

5. Read AGENTS.md completely, then animstream/PROTOCOL.md and animstream/ART-DIRECTION.md. All three are binding, and so is the Originals checklist above (in detail in AGENTS.md, section "Originals checklist (binding)"). The skill animstream-game is your step-by-step guide; animstream-manifest, animstream-test, animstream-release and animstream-update cover the individual steps. If your agent has not loaded the new skills in this session, read .claude/skills/<name>/SKILL.md directly.

6. Design (skill animstream-manifest): rename the template's manifest.example.json to manifest.json, then write GAME-DESIGN.md and manifest.json before you change gameplay code: 4–12 gift actions derived from my idea per checklist points 1–5 (spawn-like effects get an integer parameter count with min 1, a sensible max and "stackable": "count"; every parameter is bounded), the three presets, giftWall, leaderboard and defaultBindings, the round flow (lobby, playing, paused, round-over) and when the game accepts actions. Validate with the command from checklist point 1.

7. Action images (checklist point 6, animstream/ART-DIRECTION.md): copy animstream/art/action-prompts.example.json to tools/art/action-prompts.json and fill it for my actions (it records every prompt), then run `node tools/art/generate-action-images.mjs --test 2` and show me the two test images and the preview. Wait for my approval, then generate the rest without --test, check the contact sheet and Gift Wall preview, redo bad images with --only and finish with --check. If no image API key is found, show me the commands the tool prints to store it myself; never ask me to paste a key into the chat. If you cannot generate images at all, run `node tools/package/placeholder-action-images.mjs` for the missing ones and list them as open in your report.

8. Implement my idea in the template: the game code lives in scripts/; the template marks the places for my game with # GAME IDEA (`grep -rn "GAME IDEA" scripts`). Keep its structure (the AnimStream autoload, lobby with auto start and carried-over actions, round loop with set_state, pause menu, language switch, audio buses with music shuffle, leaderboard screen, window settings, export presets) and replace the example actions with mine. Rules:
   - every manifest action has a handler, registered before the client connects; gameplay and input only while the session is ready; keep the default quit on session end
   - handlers check their parameters, honor context.cancelled and acknowledge as soon as the effect has started; stackable handlers accept any count between min and max
   - the game stays fully playable when ready.features is empty (older Studio versions): the SDK then skips state and requests, and actions also arrive outside of rounds, so apply or buffer them instead of rejecting them
   - viewer and gift names are untrusted plain text: never markup, code, file paths or commands
   - no gift mapping UI, gift catalog or Gift Wall in the game: the game control window provides them
   - if manifest.json lists GIFT in events, a raw gift event must never cause the same effect as a gift rule

9. Test with the mock Studio (skill animstream-test): `npm ci --prefix tools/mock-studio`, then every scenario of checklist point 14 against `godot --headless --path .`. Fix every FAIL and repeat until everything passes.

10. Export and package (skill animstream-release): `godot --headless --path . --export-release "Windows Desktop" build/windows/Game.exe`, run the smoke scenario against the exported build for the current platform, write RELEASE-NOTES.md, then export every platform you can test into build/windows, build/macos and build/linux and run `node tools/package/animstream-pack.mjs --all` once: it packs each platform ZIP including the media/actions images, checks them, and writes dist/release.json with the SHA-256 values and the manifest (changes plus every bundled helper executable with file name and purpose, or "No bundled helper executables").

11. Store material (checklist point 13, skill animstream-release, art direction section 7): prepare what you can produce (cover, icon, splash, posters) with the same colours, mascot and style pack as the action images, name the files as in the skill, and list what I still have to deliver (usually the trailers and the licensed music).

12. Report to me: what you built, how to start it, the checklist with the status of every point (done, or open and why), the test results and the release values (version, platform, architecture, entrypoint, SHA-256, manifest.json). Upload only when I ask; then use the skill animstream-release, and animstream-update for later versions. I set the price myself in the dashboard (free needs an explicit confirmation there). The release tool logs in with `animstream-release.mjs login`: it prints a link and a code, I approve it in my browser, and the token goes straight into the OS secret store (or comes from the environment variable ANIMSTREAM_API_TOKEN); you never see it. Never ask me to paste the token into the chat and never print, log or commit it. Publishing is then one command: `animstream-release.mjs publish dist/release.json --wait`.

Ask me only for what you cannot decide yourself: the game ID from the developer dashboard (https://animstream.com/developers/games/dashboard; ask at the start and use the placeholder "my-game-dev" until I provide it, then replace it before packaging), the location of Godot if you cannot find it (or permission to download it) and licensed music tracks if I want music. Decide everything else yourself and record your decisions in GAME-DESIGN.md.

As a file: BOOTSTRAP-PROMPT.en.mdDeutsche Fassung

Claude Code

Reads CLAUDE.md, which imports AGENTS.md, and the skills in .claude/skills/. You can also ask for a skill directly: "use the animstream-test skill".

Codex

Reads AGENTS.md. The installer also places the skills in .agents/skills/, the repository location of recent Codex versions. The location has changed between versions; check your version's documentation. All rules are in AGENTS.md as well.

Other agents

Agents that read AGENTS.md work the same way. Without skill support the agent reads the matching SKILL.md before each step, for example skills/animstream-test/SKILL.md.

What the agent kit contains

  • AGENTS.md: rules, standard mechanics, architecture, definition of done and review checklist for game repositories; CLAUDE.md imports it.
  • Five skills (below), bootstrap prompts in German and English, PROTOCOL.md, manifest.schema.json and animstream-protocol.ts.
  • tools/mock-studio: launches the game like Studio, plays scenarios (stacking, pause, leaderboard, heartbeat, lease) and checks every message.
  • tools/package: builds and checks the release ZIP with the same rules as the server. tools/release: uploads builds with an API token and submits them.
  • ART-DIRECTION.md with the style pack art/reference/ and tools/art: generates the action images in the binding AnimStream look (paint, cut out, 512×512, Gift Wall preview, test approval, --check).
SkillUse it to
animstream-gamebuild a game with Godot 4 or Unreal Engine 5 from an idea, starting from the template
animstream-manifestdesign, change and validate manifest.json
animstream-testtest against the mock Studio, including older Studio versions
animstream-releaseexport, package and publish the first release
animstream-updatefix bugs or add content and ship an update

Install into an existing project

The bootstrap prompt does this itself. By hand: extract the agent kit and run this in the project folder. Without --project only the skills are copied to .claude/skills/ and .agents/skills/; with --project also AGENTS.md, CLAUDE.md, tools/, animstream/ and a .gitignore block. Existing AGENTS.md and CLAUDE.md files are never overwritten.

# macOS, Linux, Git Bash
sh path/to/agent-kit/install-skills.sh --project .

# Windows PowerShell
powershell -NoProfile -ExecutionPolicy Bypass -File path\to\agent-kit\install-skills.ps1 -Project .

API token

For uploads you log the release CLI in once with animstream-release login: you approve the displayed link in the browser, the token goes straight into the operating system's secret store and the agent never sees it. Alternatively the CLI reads the token from ANIMSTREAM_API_TOKEN (for example in CI). Never paste it into the chat; the agent never prints or commits it.

Unreal Engine

Unreal Engine 5: plugin and template

Unreal is a first-class engine for AnimStream Originals. The plugin implements protocol 1 completely, like the Godot SDK: launch variables, one local WebSocket connection, heartbeat and lease, actions with parameters, stacking and cancellation, raw events, game state, the leaderboard with profile pictures, gift rules, timeouts and compatibility with older Studio versions.

In the ZIPContents
AnimStreamOriginals/Plugin (C++ with Blueprint): UAnimStreamGameSubsystem, the "AnimStream Actions" component, async Blueprint nodes, Project Settings under Plugins › AnimStream Originals, Automation tests. Dependencies: Unreal modules only.
CommunityCounter/Template without .uasset files: lobby, rounds, pause menu, German/English, saved settings, music and effects, leaderboard with profile pictures, gift guide, portrait window; manifest, placeholder action images, image prompts.
Private/Core/Protocol core and WebSocket codec in standard C++17 without engine types; tested without Unreal too.

C++

// Template GameMode (shortened). Register every manifest action, then start.
UAnimStreamGameSubsystem* Studio = UAnimStreamGameSubsystem::Get(this);
Studio->RegisterAction(TEXT("spawn-zombies"), [Weak = TWeakObjectPtr<AMyGameMode>(this)](
    const TSharedRef<FJsonObject>& Params, const FAnimStreamActionContext& Context, FAnimStreamCompletion Complete)
{
    AMyGameMode* Game = Weak.Get();
    if (!Game || Context.IsCancelled()) { Complete(false, TEXT("not_ready")); return; }
    // stackable: Rose x99 can arrive as count 99
    Game->PendingZombies += static_cast<int32>(Params->GetNumberField(TEXT("count")));
    Complete(true, FString()); // acknowledge once the effect has started
});
Studio->SetState(true, TEXT("lobby"), 0.0); // buffered until ready
Studio->StartFromEnvironment();

// Round end: Studio holds new actions, the final score goes to the leaderboard.
Studio->SetState(false, TEXT("round-over"), Score);
Studio->SubmitScore(Score, [](bool bOk, TSharedPtr<FJsonObject> Data, const FString& Error)
{
    // Older Studio versions: bOk == false, Error == "unsupported"
});
APINotes
RegisterAction(id, handler)Before StartFromEnvironment() on the game thread. The completion may come later and from any thread; a second or late completion never sends a second result.
SetState(accepting, phase, score)Buffered before ready, identical states once, at most 10 per second; false without feature state.
SubmitScore · GetLeaderboard · ListBindingsAnswer on the game thread, never inside the call; locally unsupported, not_ready, invalid, busy, timeout, stopped.
LoadAvatar(url, callback)Validated AnimStream CDN URLs only, 5 s, at most 1 MiB, PNG; cached by URL; nullptr on failure, then show the initial.
GetLanguage · GetStreamerHandle · HasFeatureEmpty on Studio 0.1.285 and older.

Blueprint

Without C++: add the "AnimStream Actions" component to an actor, fill Actions and implement On Action. Auto Complete acknowledges instant effects by itself; turn it off for effects that can fail or finish later and call Complete Action. Async nodes: Submit Leaderboard Score, Get Leaderboard, List Gift Rules, Load Leaderboard Picture.

Blueprint graph as text
BP_GameManager (actor in the level) + component "AnimStream Actions"
  Actions = [spawn, steal-points]   Auto Complete = true   Start Session = true

On Action (Action)
  └─ Switch on String (Action.ActionId)
       ├─ "spawn"        → Get Int Param (Action, "count", 1)   → Add Score
       └─ "steal-points" → Get Int Param (Action, "amount", 10) → Subtract Score (min 0)
     Feed: Action.ViewerName, Action.Source.GiftName, Action.Source.GiftCount (plain text)

Round end
  Set Game State (Accepting Actions = false, Phase = "round-over", Score)
  └─ Submit Leaderboard Score (Score)
       ▸ On Submitted → Get Leaderboard (10)
            ▸ On Loaded (Leaderboard) → rows: Rank, Name, Score, own entry = Leaderboard.Own
                 → Load Leaderboard Picture (Entry.AvatarUrl) ▸ On Failure → Get Name Initial (Name)
       ▸ On Failure (Error = "unsupported") → show only the round score

Esc: Set Game State (false, "paused", Score) + Set Game Paused (true)

Help and sabotage

Every action of an Original gets effect in the manifest: help (mercy, helps the streamer, green), sabotage (gets in the streamer's way, red) or, rarely, neutral. With giftWall.split: true Studio splits the Gift Wall: help left, sabotage right (extension action-effects; older Studio versions show one plain wall). Keep every preset balanced, ideally 50/50, for example 2 + 2 or 4 + 4. The Unreal template classifies all four actions, sets split: true and has three 2 + 2 presets.

  • C++: Context.Effect ("help", "sabotage", "neutral" or empty) and GetActionEffect(ActionId), read from the reviewed manifest.
  • Blueprint: Action.Effect (Help, Sabotage, Neutral, Unclassified), Get Action Effect, Get Effect Color (green/red) and Get Effect Label; List Gift Rules fills Effect per rule.
  • The template shows a green HELP or red SABOTAGE banner for 2 s when an action fires. On older Studios the value is Unclassified: use it for presentation only, never for game logic.

Testing

  • The mock Studio launches any executable: UnrealEditor.exe <Project>.uproject -game -windowed without packaging, the packaged Shipping build before a release. The template shortens rounds with -LobbySeconds=2 -RoundSeconds=10 -BreakSeconds=2 (Studio never passes arguments).
  • Play in Editor gets no launch variables and ends with launch_required; the editor stays open.
  • Plugin Automation tests: UnrealEditor-Cmd.exe <Project>.uproject -ExecCmds="Automation RunTests AnimStream" -unattended -nullrhi.

Packaging for Windows and macOS

# test: editor binary with -game (no packaging) or the packaged build
node tools/mock-studio/mock-studio.mjs run --manifest manifest.json -- "C:\Program Files\Epic Games\UE_5.4\Engine\Binaries\Win64\UnrealEditor.exe" "C:\Games\MyGame\MyGame.uproject" -game -windowed
node tools/mock-studio/mock-studio.mjs run --manifest manifest.json --scenario leaderboard -- build/windows/MyGame/Binaries/Win64/MyGame-Win64-Shipping.exe

# package: Shipping, no installer, crash reporter or debug files, with the C++ runtime
node tools/package/unreal-stage.mjs build --project MyGame.uproject --platform win32 --engine "C:\Program Files\Epic Games\UE_5.4" --crt auto
node tools/package/unreal-stage.mjs build --project MyGame.uproject --platform darwin --engine "/Users/Shared/Epic Games/UE_5.4"
node tools/package/animstream-pack.mjs --all

# publish
node tools/release/animstream-release.mjs publish dist/release.json --wait
RuleUnreal
Entrypoint<Project>/Binaries/Win64/<Project>-Win64-Shipping.exe; the bootstrap EXE at the root starts the game and exits and is refused. macOS: <Project>.app/Contents/MacOS/<Project>.
No installersUEPrereqSetup_x64.exe is refused (packaging: "Include prerequisites installer" off). The Microsoft C++ runtime goes next to the Shipping EXE ("Include app-local prerequisites" or --crt auto).
Additional executablesLeave out CrashReportClient; declare others such as EpicWebHelper.exe in the release notes.
Limits50,000 entries, files and ZIP below 4 GiB, 8 GiB expanded, no ZIP64: pak files with IoStore (the template's default), large content in pak chunks.
Symbolic linksNot allowed; unreal-stage replaces links inside a macOS app with copies. Sign macOS builds at least ad hoc.
VersionProjectVersion=x.y.z in Config/DefaultGame.ini; --all reads it.

Windows signing

Windows builds of AnimStream Originals (games owned by AnimStream) are signed with the AnimStream certificate automatically after upload: every .exe and .dll without a valid vendor signature, always including the entrypoint; vendor-signed files such as Microsoft's runtime stay unchanged. AnimStream does not sign other developers' games; sign them yourself before packing if you have a certificate.

Verification status

The protocol core, the WebSocket codec and the template's game rules are standard C++: AnimStream builds them with g++ (C++17 and C++20, without exceptions and RTTI, warnings as errors) and tests them with unit tests, the same local WebSocket boundary tests as Godot and Unity, and the mock Studio scenarios. The Unreal wrapper (subsystem, Blueprint types, Slate HUD) has not been compiled yet without an Unreal toolchain: build it in your Unreal version and test the packaged build before submitting.

animstream-unreal-sdk.zipUnreal READMEAgent notes (engines/unreal.md)

Reference

Manifest

manifest.json is reviewed with every build and is the contract between the game and Studio. Studio builds gift rules, the game control window and the Gift Wall labels from it and validates every action and parameter against it before sending. The game receives the reviewed manifest in ready and cannot replace it. Unknown keys are rejected everywhere.

FieldRules
schemaVersion1
gameIdImmutable game ID from the dashboard, ^[a-z0-9][a-z0-9-]{0,95}$. Equals ANIMSTREAM_GAME_ID.
title{ "de", "en" }, non-empty, ≤ 160 characters each
descriptionOptional, { "de", "en" }, ≤ 1000 characters each
actions≤ 128. id ^[a-z][a-z0-9-]{0,63}$, unique; label ≤ 160; optional description ≤ 1000; parameters ≤ 16; optional stackable.
actions[].stackableKey of an integer parameter of the same action with min ≥ 1 and max set. Studio adds up this value when stacking.
actions[].effectOptional: "help" (helps the streamer), "sabotage" (against the streamer) or "neutral"; without it the action counts as neutral. Studio uses it to split the Gift Wall into good and evil and shows the mix in the preset picker.
eventsUnique event codes for raw event messages, may be empty.
defaultBindingsOptional, ≤ 32 suggested gift rules (below).
leaderboardOptional, label and order of the leaderboard (below).
giftWallOptional, layout of the game's Gift Wall (below).

The serialized manifest must not exceed 48 KiB (UTF-8).

Parameters

Every parameter has key (like id, unique within the action), label ({de, en} ≤ 160) and type, optionally required and default. Bound every number and give every parameter a default so a gift rule works without extra input.

typeAllowed extrasdefault
integermin, max (finite, |x| ≤ 10⁹, min ≤ max)safe integer within the bounds
numbermin, max (finite, |x| ≤ 10⁹, min ≤ max)finite number within the bounds
booleannonetrue / false
stringmaxLength 1–256 (256 if omitted)text within maxLength
enumoptions: 1–32 items { value, label }, value ≤ 128 and uniqueone of the value entries

Default gift rules (defaultBindings)

  • giftName: TikTok display name, 1–80 characters, no control characters and none of * | \ [ ] { }, no leading or trailing spaces, unique case-insensitively. Studio matches gifts by name because IDs differ between regional servers.
  • giftId: optional hint, ^[A-Za-z0-9_-]{1,40}$.
  • actionId: an action of this manifest; params is validated against it, defaults fill missing values.
  • Common gifts: Rose, TikTok, GG (1 coin), Finger Heart (5), Doughnut (30), Hand Hearts, Confetti (100), Corgi (299), Money Gun (500), Galaxy (1000), Lion (29999). Cheap gifts for small, frequent effects, expensive gifts for rare, big ones.

Leaderboard (leaderboard)

label: {de, en}, ≤ 40 characters each. order: desc (higher is better, default) or asc (lower is better, for example times in milliseconds). Without leaderboard the list is called "Punkte" / "Score" with desc.

Gift Wall (giftWall)

columns: required, integer 1–12. sort: coins-asc, coins-desc or manifest (order of defaultBindings); without sort the rule order stays. showCoins (default false), showLabels (action names, default true), optional title {de, en} ≤ 40 characters each. Optional split: true creates the wall split (help left, sabotage right, headers on, neutral below), false unsplit; as an object helpSide (left/right), helpTitle/sabotageTitle {de, en} ≤ 40, showHeaders and neutral (bottom/help/sabotage). Without giftWall Studio uses its defaults.

Event codes (events)

GIFTFOLLOWLIKESHARECOMMENTJOINSUBSCRIBETEAM_JOINLEVEL_UPMULTIPLIERMULTIPLIER_GIFTBOOSTED_GIFTMULTIPLIER_PREDICTCHEERRAIDRESUBSCRIBESUB_GIFTREWARDSHOUTOUTCHARITY_DONATE

Complete example

manifest.json
{
  "schemaVersion": 1,
  "gameId": "zombie-prank",
  "title": {
    "de": "Zombie-Streich",
    "en": "Zombie Prank"
  },
  "description": {
    "de": "Zuschauer schicken Zombies und drehen die Steuerung um – oder retten den Streamer mit Heilung und Eiszeit.",
    "en": "Viewers send zombies and invert the controls – or save the streamer with healing and a freeze."
  },
  "actions": [
    {
      "id": "spawn-zombies",
      "effect": "sabotage",
      "label": {
        "de": "Zombies schicken",
        "en": "Send zombies"
      },
      "description": {
        "de": "Schickt Zombies auf den Streamer. Mehrere Geschenke werden zusammengezählt.",
        "en": "Sends zombies at the streamer. Several gifts are added up."
      },
      "image": "media/actions/spawn-zombies.png",
      "stackable": "count",
      "parameters": [
        {
          "key": "count",
          "label": {
            "de": "Anzahl",
            "en": "Count"
          },
          "type": "integer",
          "min": 1,
          "max": 200,
          "default": 1
        }
      ]
    },
    {
      "id": "invert-controls",
      "effect": "sabotage",
      "label": {
        "de": "Steuerung umdrehen",
        "en": "Invert controls"
      },
      "description": {
        "de": "Links ist rechts und oben ist unten – für ein paar Sekunden.",
        "en": "Left is right and up is down – for a few seconds."
      },
      "image": "media/actions/invert-controls.png",
      "parameters": [
        {
          "key": "seconds",
          "label": {
            "de": "Sekunden",
            "en": "Seconds"
          },
          "type": "integer",
          "min": 3,
          "max": 30,
          "default": 10
        }
      ]
    },
    {
      "id": "heal-player",
      "effect": "help",
      "label": {
        "de": "Streamer heilen",
        "en": "Heal the streamer"
      },
      "description": {
        "de": "Gibt dem Streamer Lebenspunkte zurück, höchstens bis zum vollen Leben.",
        "en": "Gives the streamer health back, up to full health."
      },
      "image": "media/actions/heal-player.png",
      "parameters": [
        {
          "key": "health",
          "label": {
            "de": "Lebenspunkte",
            "en": "Health"
          },
          "type": "integer",
          "min": 1,
          "max": 100,
          "default": 10
        }
      ]
    },
    {
      "id": "freeze-zombies",
      "effect": "help",
      "label": {
        "de": "Zombies einfrieren",
        "en": "Freeze zombies"
      },
      "description": {
        "de": "Alle Zombies erstarren ein paar Sekunden lang zu Eis.",
        "en": "Every zombie freezes solid for a few seconds."
      },
      "image": "media/actions/freeze-zombies.png",
      "parameters": [
        {
          "key": "seconds",
          "label": {
            "de": "Sekunden",
            "en": "Seconds"
          },
          "type": "integer",
          "min": 2,
          "max": 20,
          "default": 5
        }
      ]
    }
  ],
  "events": [
    "GIFT"
  ],
  "defaultBindings": [
    {
      "giftName": "Rose",
      "actionId": "spawn-zombies",
      "params": {
        "count": 1
      }
    },
    {
      "giftName": "Finger Heart",
      "actionId": "heal-player",
      "params": {
        "health": 5
      }
    },
    {
      "giftName": "Perfume",
      "actionId": "invert-controls",
      "params": {
        "seconds": 5
      }
    },
    {
      "giftName": "Doughnut",
      "actionId": "freeze-zombies",
      "params": {
        "seconds": 3
      }
    }
  ],
  "presets": [
    {
      "id": "small-budget",
      "title": {
        "de": "Kleines Budget",
        "en": "Small budget"
      },
      "description": {
        "de": "Geschenke bis 30 Münzen: ständig neue Zombies und ab und zu Rettung.",
        "en": "Gifts up to 30 coins: a steady stream of zombies and the odd rescue."
      },
      "bindings": [
        {
          "giftName": "Rose",
          "actionId": "spawn-zombies",
          "params": {
            "count": 1
          }
        },
        {
          "giftName": "Finger Heart",
          "actionId": "heal-player",
          "params": {
            "health": 5
          }
        },
        {
          "giftName": "Perfume",
          "actionId": "invert-controls",
          "params": {
            "seconds": 5
          }
        },
        {
          "giftName": "Doughnut",
          "actionId": "freeze-zombies",
          "params": {
            "seconds": 3
          }
        }
      ]
    },
    {
      "id": "medium",
      "title": {
        "de": "Mittel",
        "en": "Medium"
      },
      "description": {
        "de": "Geschenke von 99 bis 299 Münzen: ganze Horden gegen lange Eiszeit.",
        "en": "Gifts from 99 to 299 coins: whole hordes against long freezes."
      },
      "bindings": [
        {
          "giftName": "Hand Hearts",
          "actionId": "spawn-zombies",
          "params": {
            "count": 25
          }
        },
        {
          "giftName": "Confetti",
          "actionId": "freeze-zombies",
          "params": {
            "seconds": 8
          }
        },
        {
          "giftName": "Hearts",
          "actionId": "invert-controls",
          "params": {
            "seconds": 12
          }
        },
        {
          "giftName": "Corgi",
          "actionId": "heal-player",
          "params": {
            "health": 40
          }
        }
      ]
    },
    {
      "id": "big-gifts",
      "title": {
        "de": "Große Geschenke",
        "en": "Big gifts"
      },
      "description": {
        "de": "Ab 500 Münzen: Zombie-Flut, volle Heilung und lange Chaos-Momente.",
        "en": "From 500 coins: zombie floods, full healing and long moments of chaos."
      },
      "bindings": [
        {
          "giftName": "Money Gun",
          "actionId": "spawn-zombies",
          "params": {
            "count": 100
          }
        },
        {
          "giftName": "Swan",
          "actionId": "heal-player",
          "params": {
            "health": 100
          }
        },
        {
          "giftName": "Galaxy",
          "actionId": "invert-controls",
          "params": {
            "seconds": 20
          }
        },
        {
          "giftName": "Fireworks",
          "actionId": "freeze-zombies",
          "params": {
            "seconds": 15
          }
        }
      ]
    }
  ],
  "leaderboard": {
    "label": {
      "de": "Überlebte Wellen",
      "en": "Waves survived"
    },
    "order": "desc"
  },
  "giftWall": {
    "columns": 4,
    "sort": "preset",
    "showCoins": true,
    "showLabels": true,
    "title": {
      "de": "Zombie-Geschenke",
      "en": "Zombie gifts"
    },
    "split": {
      "helpSide": "left",
      "helpTitle": {
        "de": "Rettet den Streamer",
        "en": "Save the streamer"
      },
      "sabotageTitle": {
        "de": "Gegen den Streamer",
        "en": "Against the streamer"
      }
    }
  }
}

Validate: node tools/mock-studio/mock-studio.mjs validate manifest.json (agent kit) applies every rule exactly like AnimStream. For editors: manifest.schema.json · animstream-protocol.ts

Older Studio versions

Studio 0.1.285 and older receives the manifest without stackable, defaultBindings and leaderboard, Studio versions without the gift-wall capability without giftWall, without action-effects without effect and giftWall.split. Your game must work without these fields.

Reference

Protocol

Protocol 1 between Studio and the game. The SDKs implement it; a custom client must follow it exactly. PROTOCOL.md is normative. PROTOCOL.md

  • One WebSocket text connection to ws://127.0.0.1:<port>/v1; UTF-8 JSON, one message per frame, at most 64 KiB.
  • Times in Unix milliseconds, IDs 1–128 characters. Every message carries type and sessionId.
  • A different session ID, invalid JSON, a binary or an oversized frame ends the session. Send only the documented fields.

Launch and session

VariableMeaning
ANIMSTREAM_GAME_IDImmutable game ID (^[a-z0-9][a-z0-9-]{0,95}$)
ANIMSTREAM_BUILD_IDBuild ID of this exact release
ANIMSTREAM_SESSION_IDID of this launch session
ANIMSTREAM_GAME_URLws://127.0.0.1:<ephemeral-port>/v1
ANIMSTREAM_GAME_TOKENRandom one-launch token (^[A-Za-z0-9_-]{32,256}$). Never log, display, persist or put it on a command line.
  1. 01
    The game connects and sends hello with exactly the documented keys within 8 seconds, then forgets the token.
  2. 02
    Studio answers ready with the reviewed manifest. Only then may gameplay accept stream input.
  3. 03
    Studio sends ping every 2 seconds, the game answers pong with the same at. After 8 seconds without a ping the game stops (heartbeat_lost).
  4. 04
    Studio renews the 90-second license lease every 30 seconds and relays it as lease. At leaseExpiresAt the session ends (lease_expired).
  5. 05
    stop, a closed socket or a protocol violation ends the session; the SDKs then quit the game. There is no reconnect and no replay. Exactly one connection is accepted per launch.

Messages at a glance

typeDirectionPurpose
helloGame → Studioone-time authentication with the launch token
readyStudio → gamereviewed manifest, optional features and session
ping / pongStudio ⇄ gameheartbeat every 2 seconds
leaseStudio → gamenew license expiry
action / action-resultStudio ⇄ gamegift action and its result
cancelStudio → gamestop the pending effects of one action
event / event-resultStudio ⇄ gameraw stream event from events
stateGame → Studiophase, acceptance, score (feature state)
request / responseGame ⇄ Studioleaderboard and gift rules (features leaderboard, bindings)
notifyStudio → gamegift rules changed, only after bindings.list
stopStudio → gamesession ends

ready

{ "type": "ready", "protocol": 1, "sessionId": "…", "leaseExpiresAt": 1767225600000,
  "heartbeatMs": 2000, "manifest": { "schemaVersion": 1, "gameId": "zombie-prank" },
  "features": ["source", "stack", "state", "leaderboard", "bindings", "leaderboard-avatars"],
  "session": { "language": "de", "streamerHandle": "streamer_name" } }
FieldNotes
manifestThe reviewed manifest. The game cannot replace it.
featuresOptional, absent on Studio 0.1.285 and older. source (actions carry source), stack (Studio stacks), state (game may send state), leaderboard (leaderboard.* requests), bindings (bindings.list), leaderboard-avatars (leaderboard.top entries carry avatarUrl). Ignore unknown values.
session.languageOptional, "de" or "en": Studio UI language.
session.streamerHandleOptional TikTok username without @, only if the streamer allowed sharing it. Display data, not an authentication factor.

action · action-result

{ "type": "action", "sessionId": "…", "id": "5b0c…", "actionId": "spawn-zombies",
  "params": { "count": 99 }, "expiresAt": 1767225603000, "dryRun": false,
  "viewer": { "name": "Viewer Name", "handle": "viewer_handle" },
  "source": { "code": "GIFT", "giftId": "5655", "giftName": "Rose", "giftCoins": 1, "giftCount": 99 } }
FieldNotes
idUnique request ID. Execute each ID at most once, also after acknowledging it.
actionIdAn action from the manifest; reply rejected to unknown IDs.
paramsPrimitive values. Validate them against the manifest again; reject unknown keys.
expiresAtReject a command that arrives after expiresAt or more than 15 s in the future. Expired pending work is cancelled.
dryRunValidate and reply simulated without calling gameplay code.
viewerOptional: name (≤ 80 characters) and optional handle (≤ 80) of the viewer who triggered it.
sourceOptional (feature source): code (GIFT, COMMENT, …, HOTKEY for Studio tests); for gifts giftId, giftName (≤ 160), giftCoins (coins per gift) and giftCount (gifts this action represents; summed when stacked).
{ "type": "action-result", "sessionId": "…", "id": "5b0c…", "status": "completed" }
{ "type": "action-result", "sessionId": "…", "id": "5b0c…", "status": "rejected", "error": "busy" }

status: completed once the handler finished, simulated for dryRun, otherwise rejected with a safe error code (≤ 160 characters) such as invalid_action, invalid_parameters, busy, cancelled, expired or handler_failed. Studio processes one action at a time per game and sends the next one only after the result: acknowledge as soon as the effect has started, when the zombies appear, not when they die.

Untrusted data

Viewer and gift strings are display data only. Never interpret them as code, commands, paths or markup.

event · event-result

{ "type": "event", "sessionId": "…", "id": "9f2e…",
  "event": { "code": "GIFT", "platform": "tiktok", "ts": 1767225600000, "user": "Viewer Name",
             "handle": "viewer_handle", "giftName": "Rose", "giftId": "5655", "giftCount": 5, "giftCoins": 1 } }
{ "type": "event-result", "sessionId": "…", "id": "9f2e…", "status": "accepted" }

Raw normalized events for the codes in events: code (uppercase), platform, ts (ignore events more than 60 s away from your clock), user (≤ 80), optional handle, giftName, giftId (≤ 160), comment (≤ 1000), giftCount, giftCoins. Reply accepted if at least one handler consumed the event, otherwise ignored.

Avoid double triggering

A gift can reach the game twice: as a raw event and as an action from a gift rule. Gameplay effects belong in gift rules (actions): they are streamer-configurable, stackable, shown on the Gift Wall and editable in the game control window. Use raw events only for effects no gift rule produces, such as a gift ticker.

state

{ "type": "state", "sessionId": "…", "acceptingActions": false, "phase": "round-over", "score": 1250 }
FieldNotes
acceptingActionsfalse pauses dispatch.
phase^[a-z0-9][a-z0-9-]{0,31}$, for example lobby, playing, round-over.
scoreOptional current score for Flows and overlays; finite, |score| ≤ 10¹⁵. Not a leaderboard submission.

Send it only if features contains state, when it changes and at most 10 times per second; Studio applies the latest message. Before the first state a game counts as accepting. While acceptingActions is false Studio sends no new actions: waiting actions survive up to 60 seconds of continuous pause and then get a fresh expiry window. An action already sent continues normally.

request · response · notify

{ "type": "request", "sessionId": "…", "id": "req-3", "op": "leaderboard.submit", "params": { "score": 4200 } }
{ "type": "response", "sessionId": "…", "id": "req-3", "ok": true, "data": { "best": 4200, "rank": 12, "improved": true } }
{ "type": "response", "sessionId": "…", "id": "req-4", "ok": false, "error": "rate_limited" }
{ "type": "notify",   "sessionId": "…", "topic": "bindings" }
opparamsresponse.data
leaderboard.submit{ "score": integer }, 0 ≤ score ≤ 10¹²{ best, rank (number | null), improved }
leaderboard.top{ "limit"?: 1–50 } (default 10){ label: {de, en}, order, entries: [{ rank, name, score, avatarUrl? }], self?: { rank, score, avatarUrl? } }
bindings.list{}{ bindings: [{ giftName, giftId?, giftImageUrl?, giftCoins?, actionId, label: {de, en}, params }] }

Send it only if features contains the matching feature. At most 4 requests in flight and at most one leaderboard.submit every 2 seconds; Studio answers within 15 seconds. Error codes: busy, invalid, rate_limited, unavailable (offline, signed out or service error), timeout, unsupported. notify with topic: "bindings" arrives only after a successful bindings.list and means: request the list again.

Other messages

{ "type": "hello",  "protocol": 1, "gameId": "…", "buildId": "…", "sessionId": "…", "token": "…" }
{ "type": "ping",   "sessionId": "…", "at": 1767225600000 }
{ "type": "pong",   "sessionId": "…", "at": 1767225600000 }
{ "type": "lease",  "sessionId": "…", "expiresAt": 1767225690000 }
{ "type": "cancel", "sessionId": "…", "id": "<action id>" }
{ "type": "stop",   "sessionId": "…", "reason": "originals-cancelled" }

pong echoes the ping's at. cancel stops the pending effects of one action, stop ends the session.

AnimStream Studio

Studio behavior

Your game can rely on this behavior. Everything about gifts, rules and their presentation on stream is handled by Studio.

Availability

Studio announces supported protocol extensions such as stacking, game state and leaderboards in ready.features. Check this list to keep your game compatible with earlier Studio versions.

Game control window

When an Originals game connects, Studio opens a separate game control window beside it without taking focus. It contains:

  • connection, queue and the reported game state
  • the manifest actions with test buttons
  • gift rules: map gifts from the TikTok gift catalog to actions with parameters, enable, disable, delete
  • recreate a deleted Gift Wall of the game (game defaults)
  • the leaderboard top list and the consent "Share my TikTok username with games and leaderboards"

While a game runs, F7 brings the window above a borderless fullscreen or windowed game and back, unless F7 is already assigned to a Studio hotkey. It is also reachable via Studio → Games → AnimStream Originals → "Open game control". Never bind F7 in the game; exclusive fullscreen can hide Studio windows, so use borderless fullscreen. Test buttons send actions with source.code HOTKEY.

Gift Wall and default gift rules

  • A Gift Wall created for a game fills itself from the game's gift rules: icon and coins from the gift catalog, label from the localized action label. Gift Walls not bound to a game keep their manual entries.
  • On the first start without gift rules Studio creates the rules from defaultBindings right away, without asking, with a one-time notice and Undo. It also creates a Gift Wall bound to the game in the active scene, laid out by the manifest's giftWall. Existing rules and walls are never overwritten or duplicated; a deleted wall is not created again. When an update changes giftWall, Studio applies the new values to every field the streamer has not changed.

Stacking (stackable)

TikTok viewers often send the same gift dozens of times per second. For an action with "stackable": "count" Studio merges waiting actions of the same gift rule, viewer and gift into one action and adds up count. Only actions not yet sent are merged; source.giftCount is the number of gifts. During a rule's cooldown, gifts accumulate in one waiting action that is sent when the cooldown ends.

GiftsRule and boundActions sent
Rose ×99count: 1 per gift, max 200one action with count: 99
Rose ×99count: 1 per gift, max 50count: 50, then count: 49
Rose ×40count: 3 per gift, max 100count: 99 (33 gifts), then count: 21 (7 gifts)

Nothing is dropped for exceeding a bound. A stackable handler must accept any count between min and max. Without the feature stack (older Studio versions) every execution arrives on its own.

Queue, time to live and pause

  • Up to 100 actions wait per game. Studio sends them one at a time and the next one only after the previous result.
  • Each action expires after its rule's time to live (1–10 seconds). Rules can have a cooldown: non-stackable actions are dropped during it, stackable ones collected.
  • When the game reports acceptingActions: false, Studio holds the queue. Waiting actions do not expire for up to 60 seconds of continuous pause and get a fresh expiry window afterwards.
  • Phase and acceptance changes trigger the Flow event "Game state"; the conditions "Game phase", "Game score" and "Game accepting actions" read the latest state.

Starting and ending the game process

  • Studio starts the reviewed entrypoint without arguments, with its folder as working directory and a minimal environment plus the five ANIMSTREAM_* variables. Console output is discarded.
  • When the session ends, Studio ends the complete process tree right after stop. Save progress at the end of a round, not on exit.
  • If the game exits by itself, the session ends too.

Leaderboards

Leaderboards without a server of your own

Every published game automatically has one global leaderboard on AnimStream. You need no database and no server.

  • Players are streamers. Each AnimStream account has one entry per game: its best score according to order. A worse score changes nothing.
  • Submit the final score at the end of a round: submit_score(score) in Godot, technically leaderboard.submit. Scores are integers from 0 to 10¹², durations integer milliseconds with "order": "asc". At most one submission every 2 seconds.
  • Studio submits through the authenticated game session; the game never receives credentials. get_leaderboard(limit) (leaderboard.top) returns the top entries and the streamer's own rank.
  • Names: an entry shows the TikTok username only if the streamer enabled "Share my TikTok username with games and leaderboards" in Studio under Games → AnimStream Originals; otherwise it is listed as anonymous. The same applies to ready.session.streamerHandle. Usernames are reported by Studio and not verified with TikTok; one username can appear on one account per game.
  • Profile pictures (feature leaderboard-avatars): every entry and self carry avatarUrl, a 128×128 PNG on AnimStream's CDN, or null. A picture appears only if the streamer also enabled "Show my profile picture on leaderboards" in Studio besides the username; anonymous entries always have null. Revocation, account deletion and moderation remove it at once. The URL needs no cookies or Referer and changes with every new picture. Load it in the background with a timeout (load_avatar(url, callback) in Godot) and show the initial for null, 404 or a broken image.
  • Public at https://animstream.com/<locale>/games/originals/<slug>/leaderboard and as a preview on the game page.
leaderboard.top
{ "type": "request", "sessionId": "…", "id": "req-7", "op": "leaderboard.top", "params": { "limit": 3 } }
{ "type": "response", "sessionId": "…", "id": "req-7", "ok": true, "data": {
    "label": { "de": "Überlebte Wellen", "en": "Waves survived" }, "order": "desc",
    "entries": [ { "rank": 1, "name": "@pixel_queen", "score": 41,
                   "avatarUrl": "https://animstream.b-cdn.net/game-media/_avatars/3f9c…/a1b2….png" },
                 { "rank": 2, "name": "Anonymous", "score": 37, "avatarUrl": null },
                 { "rank": 3, "name": "@zombie_zoe", "score": 35, "avatarUrl": null } ],
    "self": { "rank": 12, "score": 22, "avatarUrl": null } } }

Older Studio versions have no leaderboard: the SDK calls then fail locally with unsupported without sending anything. This is cooperative scoring by a game the streamer runs and not cheat-proof; administrators can remove entries.

Publishing

Releases and updates

Every version is one release with one build per platform (win32, darwin, linux) and architecture (x64, arm64, and for macOS also universal) with its manifest, SHA-256 and release notes. All platforms of a release are published with one command or one drag and drop in the dashboard. Windows x64 reaches most streamers.

Before the first release

Every AnimStream Original meets the Originals checklist: presets, action images, lobby, pause menu, leaderboard, store material and tests, each with an acceptance check.
  1. 01
    Once: create the game in the developer dashboard (title, slug, engine). You get the immutable game ID.
  2. 02
    For every release and update: a higher semantic version (1.0.0, 1.0.1, 1.1.0) for all platforms. The release CLI suggests it with suggest.
  3. 03
    Upload through the dashboard (drop all ZIP files and `release.json` at once) or the release CLI (`publish`). The server checks the hash, the ZIP rules, the native entrypoint and forbidden files and records every additional executable. The same command is safe to repeat: unchanged builds are skipped and interrupted uploads resume.
  4. 04
    Submit for review. An administrator reviews the description, manifest, packages and release notes.
  5. 05
    After approval the game appears in the catalog and in Studio under Games → AnimStream Originals. While an update is in review, the published version stays live; afterwards Studio shows "Update" for installed games. Buyers keep access through their AnimStream license and install and update in Studio.

Release bundle and release CLI

animstream-pack --all finds the Godot export layout (build/windows, build/macos, build/linux), reads entrypoint and architecture from the binaries, builds and checks every ZIP with the same rules as the server and writes the dist/ folder with the ZIPs, manifest.json, the release notes and a release.json. Paths in it are relative and stay inside the folder (no .., no absolute paths, no symlinks). Version and game ID come from project.godot and the manifest. The dashboard accepts the same format; it still verifies hash and entrypoint itself. animstream-pack check-release dist/release.json re-checks a bundle later.

dist/release.json
{ "schemaVersion": 1, "gameId": "my-game", "version": "1.0.0",
  "manifest": "manifest.json", "notes": "RELEASE-NOTES.md",
  "builds": [
    { "file": "my-game-1.0.0-win32-x64.zip", "platform": "win32", "arch": "x64",
      "entrypoint": "Game.exe", "sha256": "…", "archiveBytes": 52428800 },
    { "file": "my-game-1.0.0-darwin-universal.zip", "platform": "darwin", "arch": "universal",
      "entrypoint": "Game.app/Contents/MacOS/Game", "sha256": "…", "archiveBytes": 61000000 },
    { "file": "my-game-1.0.0-linux-x64.zip", "platform": "linux", "arch": "x64",
      "entrypoint": "Game.x86_64", "sha256": "…", "archiveBytes": 48000000 }
  ] }
  • **macOS universal:** a single file with an x64 and an arm64 slice (fat Mach-O) is published as universal. The server verifies both slices; Studio sees it as an x64 and an arm64 build. universal and separate macOS builds of the same version exclude each other.
  • **Not supported:** resumable uploads inside a file (a failed upload is repeated from the start, automatically up to three times and again when you rerun the command), trailer upload and price changes through a token.

Browser login and API tokens

  • animstream-release login shows a link and a short code. **You open the link, check the code, choose one game or all games and the lifetime (30, 90 or 365 days) and approve.** The agent never sees the token: it goes into the operating system's secret store (macOS Keychain, Linux libsecret, Windows DPAPI; --store file is the explicit alternative with a file readable only by you) and is never printed, logged or passed on a command line.
  • Scopes: games:release (releases, status, submit), games:media (cover, icon, screenshots), games:metadata (title, summary, description, website). A token cannot create games, change prices or slugs, manage tokens or approve anything.
  • For CI and machines without a secret store: create a token in the dashboard under "API-Tokens" (only with an interactive login and a verified email address; format asg_…, shown once, optionally limited to one game, revocable at any time) and set it as ANIMSTREAM_API_TOKEN. The environment variable takes precedence over the stored login.
  • whoami shows source, scopes and expiry without the token, logout removes the stored login.
Release CLI (agent kit, Node.js 20+)
# Pack every platform: build/windows, build/macos, build/linux -> dist/
node tools/package/animstream-pack.mjs --all

# Log in once: you approve the link in the browser, the agent never sees a token
node tools/release/animstream-release.mjs login

# Next version and manifest source
node tools/release/animstream-release.mjs suggest --game <game-id>

# Upload the whole release, let it be verified and wait
node tools/release/animstream-release.mjs publish dist/release.json --wait

# Cover, icon and screenshots; open items before submitting
node tools/release/animstream-release.mjs media --game <game-id> --cover cover.png --icon icon.png --screenshot shot1.png
node tools/release/animstream-release.mjs checklist --game <game-id>

node tools/release/animstream-release.mjs submit --game <game-id>

The CLI checks bundle, manifest, version, ZIPs and notes locally (paths inside the folder, hashes and sizes recomputed), uploads at most two ZIPs at a time straight from disk (with backoff retries on network and server errors) and with --wait waits for the server verification and, for Windows builds, the AnimStream signature. --submit first shows the checklist (warnings never block) and then submits. media checks type, size (at most 8 MB) and aspect ratio locally: cover 16:9 (1280×720 to 3840×2160), icon 1:1 (256 to 1024 px), up to five screenshots 16:9 or 9:16 (shorter side at least 720 px). details changes title, summary, description and website, never the price. ANIMSTREAM_API_URL is optional (default https://animstream.com). The older commands status, upload and submit keep working unchanged.

Error messages in German and English

Server error responses now carry the code, an explanation with the next step in German and English (message.de, message.en) and, where useful, details such as the suggested version. The dashboard and the CLI show the text in your language with the code; the CLI uses German when LANG starts with de. The code stays stable for scripts and support.

Keep the token safe

Never commit it, print it, paste it into a chat, pass it on a command line or embed it in a game build. Keep it in the system's secret store (through login) or an environment variable, use a token limited to the game for CI and revoke it at once if it may have leaked.

Release notes

Every release carries release notes (RELEASE-NOTES.md next to the bundle or CLI --notes, at most 4,000 characters): the changes and the mandatory declaration of every bundled helper executable with file name and purpose, or that there is none. Reviewers read them next to the executable inventory.

RELEASE-NOTES.md
# My Game 1.1.0

## Changes
- New action "Meteor shower" (Galaxy).
- Zombies spawn more evenly for large gift streaks.

## Bundled helper executables
No bundled helper executables.

Updates that keep gift rules working

ChangeAllowed
Add an actionyes
Rename or remove an action ID or parameter keyno: streamers' existing gift rules stop working
Widen bounds (lower min, raise max)yes; narrowing bounds or removing enum values: no
New parameteronly with a default and not required
Labels, defaultBindings, leaderboard labelyes
Leaderboard order or unit, gameIdno

The version must be higher than every approved version of the same platform and architecture. While a build is not verified or submitted yet, you can publish the same version with changed content again (it is replaced); after that the version is immutable and you need a higher one.

Prices and payouts

You set prices in the dashboard on the game's draft, never with a token. Every developer can publish free games. Paid games require a completed Stripe Connect payout account (vendor onboarding); payouts run through Stripe Connect, and a platform commission applies as in the AnimStream marketplace.

Packages

Packaging, review and helper processes

A package is a ZIP of a native export for Windows, macOS or Linux (x64 or arm64). The entrypoint is the actual long-running game executable; web exports are not supported.

ExportEntrypoint in the ZIP
Godot · WindowsGame.exe (PCK embedded, one file, no console wrapper)
Godot · LinuxGame.x86_64
Godot · macOSGame.app/Contents/MacOS/Game (extracted from Game.zip, at least ad-hoc signed)
Unity · WindowsMyGame.exe next to UnityPlayer.dll and MyGame_Data/
Unreal · WindowsMyGame/Binaries/Win64/MyGame-Win64-Shipping.exe, never the bootstrap EXE at the root; Microsoft C++ runtime next to it, no UEPrereqSetup (tools/package/unreal-stage.mjs)
Unreal · macOSMyGame.app/Contents/MacOS/MyGame (no symbolic links, at least ad-hoc signed)

ZIP rules

  • At most 4 GiB compressed, 8 GiB expanded and 50,000 entries.
  • No ZIP64, no encryption, no symlinks, no absolute or .. paths, no duplicate names.
  • No installer or script launcher formats: .msi, .msix, .appx, .pkg, .dmg, .deb, .rpm, .bat, .cmd, .ps1, .vbs, .wsf, .hta, .scr, .lnk, .reg, .command, and no macOS launch agent or daemon property lists.
  • Windows PowerShell 5.1's Compress-Archive writes backslashes into the paths and therefore fails. The agent kit's packer applies the same rules as the server and prints the SHA-256.
# every platform at once: ZIPs, checks and dist/release.json
node tools/package/animstream-pack.mjs --all

# a single ZIP
node tools/package/animstream-pack.mjs zip --dir build/windows \
  --out dist/my-game-1.0.0-win32-x64.zip --platform win32 --arch x64 --entrypoint Game.exe

# SHA-256 without the agent kit
sha256sum dist/my-game-1.0.0-win32-x64.zip                          # Linux
shasum -a 256 dist/my-game-1.0.0-win32-x64.zip                      # macOS
Get-FileHash -Algorithm SHA256 dist\my-game-1.0.0-win32-x64.zip     # PowerShell

Bundled helper processes

Helper executables are allowed, for example a bun build --compile binary. Studio ends the complete process tree when a session ends (Windows taskkill /T /F, macOS and Linux the process group). Rules:

  1. 01
    Native executables inside the same reviewed package. Nothing is downloaded, unpacked into other locations or generated as an executable at runtime.
  2. 02
    The entrypoint (or one of its children) starts them as ordinary child processes from the installation directory. They never detach: no setsid or new process groups, no DETACHED_PROCESS, CREATE_NEW_PROCESS_GROUP or CREATE_BREAKAWAY_FROM_JOB, no start, open, nohup, services, daemons, launch agents, scheduled tasks or autostart entries.
  3. 03
    They exit when their parent exits and never outlive the session.
  4. 04
    No elevation (UAC, sudo), no installers, no changes outside the game's own files and its per-user data directory.
  5. 05
    They listen on 127.0.0.1 only. At most one process holds the Studio connection; the launch token stays in process environments and never reaches disk, logs or command lines.
  6. 06
    Every helper is declared with file name and purpose in the build's release notes.

Checklist before submitting

  • Manifest bilingual, every parameter bounded, stackable spawn actions, default gift rules with real TikTok gift names, leaderboard with label and order.
  • The game quits on stop, after 8 seconds without a heartbeat and when the lease expires; no input before the session is ready.
  • It works without features (older Studio versions), F7 is free, viewer text appears as plain text.
  • The package contains the real entrypoint with all data, no installers, scripts, symlinks or secrets; the release notes list changes and helpers.

Compatibility

One protocol for old and new Studio versions

protocol stays 1. Everything new is optional: clients ignore unknown fields, Studio never sends new message types unprompted, and a client sends state or request only if ready.features lists the capability. Games built against the first SDK keep working unchanged.

CapabilityStudio with featuresStudio 0.1.285 and older
Manifest extensionscompletewithout stackable, defaultBindings, leaderboard
Stackinggift streaks as one actionone action per execution
action.source, ready.sessionpresentabsent
stateholds the queuedo not send: Studio ends the session
request (leaderboard, gift rules)answereddo not send: Studio ends the session
Default gift rulescreated on the first startnot available

The SDKs follow these rules: without a feature they send nothing and the calls return unsupported locally. Your game must work completely without stacking, default rules, game state and the leaderboard; actions then also arrive between rounds. Check it with --legacy in the mock Studio.

FAQ

Frequently asked questions

Do I need my own server or database?

No. Studio connects TikTok LIVE, manages licenses, installation and updates and provides the global leaderboard. Your game only talks to Studio locally.

Which engine should I use?

Godot 4.3 or newer if you have no preference: the Godot template can be imported, tested and exported entirely from the command line, which makes it the best fit for AI agents. Unreal Engine 5.3 or newer has the same depth: a complete plugin for C++ and Blueprint and the CommunityCounter template with every standard mechanic. Unity gets the base protocol with the optional helpers.

Does Unreal work with Blueprints only?

Yes. The plugin is built once as a C++ plugin, after that Blueprint is enough: the "AnimStream Actions" component delivers every action as an event, async nodes submit the final score and load the leaderboard and profile pictures. The template itself is written in C++ so it needs no assets.

Which file is the Unreal entrypoint?

<Project>/Binaries/Win64/<Project>-Win64-Shipping.exe, on macOS <Project>.app/Contents/MacOS/<Project>. The <Project>.exe at the root is only a launcher that exits at once. Packages contain no installers: instead of UEPrereqSetup_x64.exe the Microsoft C++ runtime goes next to the Shipping EXE; tools/package/unreal-stage.mjs does that.

How do I test without TikTok LIVE?

With the mock Studio from the agent kit: it launches your game with the launch variables, plays actions, gift streaks, pauses and leaderboard requests and checks every message. Then test in Studio with the test buttons of the game control window.

Why don't 99 Roses arrive as 99 actions?

For actions with stackable Studio merges waiting actions of the same rule, viewer and gift and adds up count, bounded by max. source.giftCount is the number of gifts. Older Studio versions send every execution on its own.

Why must my game not bind F7?

Studio uses F7 to bring the game control window above the game, where streamers map gifts and test actions. Also use borderless fullscreen or windowed mode, because exclusive fullscreen can hide Studio windows.

Can my game bundle helper programs?

Yes, as native executables in the same package that the game starts as ordinary child processes, that exit with it and listen on 127.0.0.1 only. Every helper is declared in the release notes.

What happens when the connection is lost?

After 8 seconds without a heartbeat, when the lease expires or on stop the session ends and the game quits. There is no reconnect and no replay of acknowledged actions. A minimized game keeps running.

Can I sell my game?

Yes. You set the price in the dashboard. Paid games need a completed Stripe Connect payout account; a platform commission applies as in the AnimStream marketplace. Every developer can publish free games.

Trust

Trust and security

  • Players use their AnimStream account. Packages are delivered through short-lived private URLs after a license check; full refunds and payment disputes revoke access.
  • Games never receive account credentials, download URLs or the cloud lease secret, only the launch token for exactly one local session.
  • The local socket listens on 127.0.0.1 only, accepts exactly one authenticated peer and rejects browser origins.
  • Studio trusts only authenticated catalog metadata over HTTPS and checks every package's SHA-256. This is cooperative license enforcement, not unbreakable DRM.
  • Every build is reviewed by an administrator before publication, including every bundled executable.
  • Viewer, gift and leaderboard names are untrusted display data. API tokens carry only release, media and text scopes, never prices, are approved in the browser and can be revoked at any time.