Skip to content

Pro Studio & Developer Guide ​

SaiScratch Pro Studio provides a dockable, Unity/Cocos-inspired editor (Hierarchy · Inspector · Scene · Project · Console) backed by the same deterministic Logic IR and 60 Hz worker runtime as Kids Studio.

1. 2D & 3D Worlds ​

  • 2D Renderer (@sai/render-2d): Powered by PixiJS v8 (WebGPU with WebGL2 fallback) and SoA TypedArray ECS (@sai/ecs).
  • 3D Renderer (@sai/render-3d): Powered by Three.js with glTF asset loading, cameras, lighting, and 3D transforms.
  • Physics: Deterministic 2D and 3D physics via Rapier (@sai/pack-physics2d, @sai/pack-physics3d).
  • Audio: WebAudio + AudioWorklet mixer (@sai/render-audio & @sai/pack-audio).

2. Multi-Modal Logic Editors ​

All three Pro logic editors project onto and edit the same Logic IR:

  1. Event Sheet (@sai/editor-eventsheet): Condition → Action rule sheets for rapid 2D/3D gameplay prototyping.
  2. Node Graph (@sai/editor-nodegraph): Visual dataflow & state-machine graphs built on @xyflow/react.
  3. TypeScript (@sai/editor-ts): Full Monaco editor with generated .d.ts definitions from registered Capability Packs, compiled cleanly into the deterministic runtime.

You can also open and inspect Blockly projects created in Kids Studio directly inside Pro Studio.


3. Collaboration & Offline-First Storage ​

  • Local-First: Projects persist locally using Yjs + y-indexeddb and OPFS.
  • Real-Time Collab: Multi-user editing syncs over WebSockets (/collab) via Hocuspocus (project:<id> rooms) with debounced server snapshots.

4. Exporting & Publishing ​

TargetToolchainBuild / Assemble Command
Web (PWA / Static)Vite 8 + Nginx (COOP/COEP)pnpm -C client build
Sandboxed Web Embed@sai/app-player (EmbedBridge)iframe sandbox="allow-scripts" on play.<domain>
Desktop (Win/macOS/Linux)Tauri 2 (@sai/app-desktop)pnpm -C client --filter @sai/app-desktop run assemble + cargo tauri build
Mobile (iOS / Android)Capacitor 8 (@sai/app-mobile)pnpm -C client --filter @sai/app-mobile run copy-web + npx cap sync