English
Build Guide
For whoever works on SpriteStudio Player for Web, or changes it for a project of their own. It assumes a checkout and asks more of you than the rest of the site. How the packages fit together, and why the plugins are built the way they are, is on How the Player Is Put Together.
What every SpriteStudio Player shares — how playback, motion blending, sound keys and part tracking behave — is written once, in the SDK's porting guide.
Building from a checkout
CONTRIBUTING has the setup, the build, the tests and the docs site; pnpm run example takes a fresh checkout to a running renderer example, and pnpm --filter @spritestudio/ssconverter-web dev serves the browser converter. Each plugin's README ends with a section for contributors that builds, packs and runs that plugin.
Using a changed Player
The rest of the site installs what a release publishes. To try a change in an app or a game of your own, build the same artifacts from your checkout:
sh
scripts/build-release.sh # Windows: scripts\build-release.ps1It writes release-dist/npm/*.tgz (the npm packages) and release-dist/plugins/ (the MZ ZIP, the TyranoScript ZIP and ssplayer.tbp), carrying the versions your tree has. It takes the SDK WASM released for scripts/SDK_VERSION.txt; when your change is in the SpriteStudio-SDK submodule, add sdk=build, which compiles it (Rust and wasm-pack). --help lists the stages skip= can leave out.
npm packages. Install every tarball your app needs in one command, the packages it imports together with the ones they depend on:
shnpm install <checkout>/release-dist/npm/spritestudio-ssplayer-core-<version>.tgz <checkout>/release-dist/npm/spritestudio-ssplayer-webgl-<version>.tgzA tarball names its dependencies by version, so
ssplayer-webglinstalled alone takes the releasedssplayer-corefrom npm instead of yours.RPG Maker MZ. Extract the MZ ZIP into the game's
js/plugins/, as an author does.TyranoScript. Extract
ssplayer/from the TyranoScript ZIP into the game'sdata/others/plugin/.TyranoBuilder. Install
ssplayer.tbpthrough the builder, or skip the dialog:node packages/ssplayer-tyranobuilder/scripts/install.mjs <project>copies the same files into a project. The package README has its options.
While you iterate, one package's build is enough, followed by the bundled example's sync:plugin; each plugin README's section for contributors has the commands.
Checking against the real host
The packages' tests run against stand-ins for MZ and TyranoScript. What only the real host shows — its timing, its save system, its editor — is checked by running the host. Everything below runs without touching the host's GUI. Paths are the macOS ones.
Where the hosts' labels come from
The guides name menus, dialogs and options as the host shows them. Read them from the host:
- RPG Maker MZ. The English labels are ASCII inside the editor binary (
RPGMZ.app/Contents/MacOS/RPGMZ), sogrep -afinds them. The Japanese labels are in the same binary's Qt translations as UTF-16BE: a UTF-8 search finds nothing. Search for the UTF-16BE bytes instead; the context name next to a string (Layout_DeploymentOptionsfor the deployment dialog) says which screen it belongs to. The bundled help,Contents/Resources/help-ja/, confirms them. - TyranoBuilder (under
TyranoBuilder.app/Contents/Resources/app/):js/main/MenuBar.jsfor the menus,template/window/*.tmpl.htmlfor each window's text, andlang/en.jsonfor the English UI, keyed by the Japanese originals. - The plugins' own labels: MZ's are the
@textlines of the plugin's help annotation, in English and under/*:ja; TyranoBuilder's are the Japanese language file the.tbpcarries.
RPG Maker MZ
The NW.js that ships inside RPG Maker MZ runs a project folder directly — RPGMZ.app/Contents/Resources/nwjs-mac/nwjs.app/Contents/MacOS/nwjs <project> test — the same runtime the editor's test play uses, without WebAssembly SIMD. Pass test: MZ reads test play from its first argument (Utils.isOptionValid), so a launch without it is the deployed game, and the conversion on test play does not run.
To check something without a person at the keyboard, copy a project such as examples/rmmz-example/SampleProject outside the repository, add a plugin of your own to its js/plugins/ and js/plugins.js, and have that plugin drive the game, write its result with require('fs') and call nw.App.quit(). Things that cost time to find out:
- MZ stops updating scenes while its window lacks focus (
SceneManager.isGameActive()). An animation that freezes in a background window is MZ, not the plugin. - Count frames with
Graphics.frameCount, notrequestAnimationFrame: animation frames keep coming while the game is paused, so a check counted in them drifts and turns flaky. DataManager.setupNewGame(); SceneManager.goto(Scene_Map)skips the title screen.- MZ 1.x has no
SceneManager.renderScene. HookGraphics._app.renderer.on('postrender', …)and read pixels there withgl.readPixels(rows count from the bottom). - Record every frame and count the distinct values. Ringo's
attack1is 20 frames long, so a check that looks every 60 frames always sees the same one. - A fetch of a missing file rejects (
TypeError: Failed to fetch) instead of answering 404. - A load failure is MZ's
["LoadError", url, retry], thrown during an update, which stops the scene loop and with itGraphics.frameCount. Time a check across the error screen withsetTimeout; Retry is#retryButton. - MZ plays a sound effect only from
audio/se/<name>.ogg. WrappingWebAudio.prototype.playandstoprecords what played (buffer.name).
Without MZ, examples/rmmz-harness (pnpm --filter rmmz-harness dev) runs the plugin's player and renderer on real PixiJS v5, with only MZ's ImageManager and Bitmap stubbed. The published sample (examples/rmmz/ on this site) stays on its black splash screen in a headless browser until a click gives it focus.
TyranoScript
examples/tyranoscript-example is a TyranoScript project with the engine left out; its README fetches it and serves the project. To drive it from a script, start Chrome headless — --headless=new --remote-debugging-port=<port> --use-angle=swiftshader --enable-unsafe-swiftshader --user-data-dir=<scratch> — and talk to the page over the DevTools protocol; a headless page counts as visible, so requestAnimationFrame runs.
- The tags are ready when
TYRANO.kag.ftag.master_tag.ss_playexists. - Rather than clicking through
first.ks, write a throwawaydata/scenario/zz_*.ksand jump to it withTYRANO.kag.ftag.startTag('jump', { storage, target }). Delete it afterwards. kag.erroris analert: catchPage.javascriptDialogOpeningand close it withPage.handleJavaScriptDialog. Skip mode isTYRANO.kag.setSkip(true).- A failed
[ss_new]does not stop the scenario; the next tag reportsplayer "…" not found. The real error is the[ss] ss_new failed:line above it. - The example's
.ssabcome frompnpm deploy-examplesand its plugin fromsync:plugin. After an SDK bump, refresh both: a runtime older than its.ssabfails to load it, andssruntime_bg.wasmcan change without changing size, so compare hashes withpackages/ssplayer-core/dist/.
A test project for events: convert the SDK's tests/overall/overall.sspj with node packages/ssconverter-web/scripts/cli.js -o <dir> <overall.sspj>. Signal.ssab fires signals on frame 10 of anime_1, and Sound.ssab plays sound keys; both work in MZ too.
TyranoBuilder
The editor window has no DevTools, so <project>/ss_import_log.txt is where the importer reports. For an error in the game itself, use Project → Debug (プロジェクト → デバッグ実行): only that preview opens DevTools. The ordinary preview loads the project over file://, and fetch works there, so a pack that plays in TyranoScript and not in the builder is not a file:// problem; get the console first.
Driving the real editor. TyranoBuilder.app/Contents/MacOS/TyranoBuilder --remote-debugging-port=<port> starts the editor with a DevTools endpoint (http://127.0.0.1:<port>/json).
- Add a component with
app.component.insertComponent(tag, index, <the previous component's c.j_component>)and set its values withapp.component.changeParam(c, key, value). A fifth argument{ pm }wipes every default. app.component.createTyranoScriptCode(c)returns the tag a component writes.- The preview (▶ on the scenario tab) is a separate target in
/json. It writesscene1.ks,first.ksand_preview.ks, so back updata/scenariofirst. kag.errorin the preview is a native dialog the protocol cannot close. Close that window with/json/close/<id>, then restart the editor: previews do not open again in that session.- Quit with
kill -9. A plain kill stops at the unsaved-changes dialog and keeps the port.
TyranoStudio
TyranoStudio runs games with the TyranoScript it bundles, so the TyranoScript plugin is what runs there. Its license forbids modifying the app, so check it with launch flags only: Contents/MacOS/TyranoStudio --remote-debugging-port=<port>. The preview is a separate Electron window that opens the project's index.html over file://, with TYRANO.kag.is_studio === true; replace window.alert from an init script before reloading it, because kag.error is a native dialog there too.
TyranoBuilder and TyranoStudio share one Electron user-data folder (~/Library/Application Support/studio), and with it localStorage: saves made in one app's preview show up in the other's. Remove them with localStorage.removeItem from a running app.
In a browser
SSSurface pauses while document.hidden (pauseWhenHidden, on by default), so a page in a background tab shows 0.0 / 0 and does not move, in the WebGL and the PixiJS examples alike. <ss-player> draws one frame before its ticker runs, so it shows a picture even there. Check in a visible tab, or in headless Chrome as above.