Skip to content

Fix play-start jank and import hangs for material-heavy scenes#42

Merged
papiguy merged 1 commit into
mainfrom
tinyskies-playground-port
Jun 22, 2026
Merged

Fix play-start jank and import hangs for material-heavy scenes#42
papiguy merged 1 commit into
mainfrom
tinyskies-playground-port

Conversation

@papiguy

@papiguy papiguy commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Engine-side fixes surfaced by the TinySkies playground port — a material-heavy procedural globe game that exposed startup stalls, in-flight jank, and an import-time hang. None are game-specific; they benefit any large OSS scene.

  • featureFlags: enable shared @import scripts in OSS unconditionally. REACT_APP_SCRIPTS_ENABLED is unset everywhere, so every behavior that @imports a helper failed to import. Scripts are a first-class OSS authoring feature; integrated keeps the env opt-in.
  • Editor / RenderEvent / RenderingQualityModule: make the scene's serialized useShadows the source of truth and seed the renderer's shadow tracking from it. A no-shadow scene was paying shadow-variant shader compiles + a full-scene shadow pass every frame, and the first post-(re)create frame spuriously marked every material needsUpdate. Adaptive quality may still downgrade shadows but never force them on.
  • EngineRuntime: precompile material pipelines with compileAsync before the loop starts, and hold the loading overlay until the first frame renders — folding one-time shader compiles into play-start load instead of streaming jank in mid-play. Both best-effort/bounded.
  • GameManager: init behaviors in small batches that yield to paint, so the loading overlay advances instead of the UI freezing during a large world build.
  • BehaviorManager: drop the per-behavior fixedUpdate "not implemented" warning — dozens of warn-with-stacktrace calls stalled play start for no benefit; not implementing an optional hook is normal.
  • Editor.runScriptImport: pause the editor render loop during a bulk script import so per-command cost stays flat (was ~O(n^2), a multi-minute hang that could OOM the renderer).
  • remote-go thumbnail: guard the /api/Scene/Edit POST behind !IS_OSS; OSS has no such endpoint, so it 404-spammed on every import.

Adds the port planning doc under docs/planning/.

Engine-side fixes surfaced by the TinySkies playground port — a
material-heavy procedural globe game that exposed startup stalls,
in-flight jank, and an import-time hang. None are game-specific; they
benefit any large OSS scene.

- featureFlags: enable shared `@import` scripts in OSS unconditionally.
  REACT_APP_SCRIPTS_ENABLED is unset everywhere, so every behavior that
  `@import`s a helper failed to import. Scripts are a first-class OSS
  authoring feature; integrated keeps the env opt-in.
- Editor / RenderEvent / RenderingQualityModule: make the scene's
  serialized `useShadows` the source of truth and seed the renderer's
  shadow tracking from it. A no-shadow scene was paying shadow-variant
  shader compiles + a full-scene shadow pass every frame, and the first
  post-(re)create frame spuriously marked every material needsUpdate.
  Adaptive quality may still downgrade shadows but never force them on.
- EngineRuntime: precompile material pipelines with compileAsync before
  the loop starts, and hold the loading overlay until the first frame
  renders — folding one-time shader compiles into play-start load
  instead of streaming jank in mid-play. Both best-effort/bounded.
- GameManager: init behaviors in small batches that yield to paint, so
  the loading overlay advances instead of the UI freezing during a
  large world build.
- BehaviorManager: drop the per-behavior fixedUpdate "not implemented"
  warning — dozens of warn-with-stacktrace calls stalled play start for
  no benefit; not implementing an optional hook is normal.
- Editor.runScriptImport: pause the editor render loop during a bulk
  script import so per-command cost stays flat (was ~O(n^2), a
  multi-minute hang that could OOM the renderer).
- remote-go thumbnail: guard the `/api/Scene/Edit` POST behind !IS_OSS;
  OSS has no such endpoint, so it 404-spammed on every import.

Adds the port planning doc under docs/planning/.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@papiguy papiguy merged commit 3e90dd2 into main Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants