Skip to content

Expose scene lifecycle with automatic loading in all script languages - #60

Merged
JamieW105 merged 4 commits into
mainfrom
feat/scene-lifecycle-api
Oct 28, 2026
Merged

JamieW105 merged 4 commits into
mainfrom
feat/scene-lifecycle-api

Conversation

@JamieW105

@JamieW105 JamieW105 commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Scripts can explicitly load a saved scene, switch to a loaded or saved scene, unload it, and query loaded/active names through game.scene in all supported scripting languages (C uses Game.scene). switchTo accepts a document name or relative scene path and tries to load missing destinations. Scenes loaded this way automatically unload on switching away; explicitly loaded scenes and the initial Play scene stay loaded. Missing, ambiguous or invalid destinations preserve the current scene. Unloading discards scene state and releases worlds, script instances, physics, audio and capture resources after the callback batch; global controllers survive transitions and can load a scene when none is active.

Play snapshots now include other saved scene files. Inactive explicitly loaded scenes retain edits and script state without ticking or rendering. The runtime no longer retains the initial scene bytes after loading, and post-Stop change review continues to use the original scene when it remains loaded. Added SDK declarations, native bindings and engine-local setup/lifetime documentation.

Validation: lifecycle conformance executed in all ten script types (Lua, Luau, JavaScript, HTML inline JS, Python, C, C++, C#, Java and PHP). All 85 engine-play tests passed; the previous 47 engine-scripting tests also passed; formatting, Clippy with warnings denied, and editor cargo check passed. Tests cover automatic loading and release, invalid destinations, duplicate saved names, same-scene switches, explicit retention, duplicate loads, state retention, fresh reloads, memory release, teardown, and global scripts/timers with no active scene.

Windows validation: discovered paths are normalized to forward slashes before scene loading. All GitHub checks pass, including Windows and Linux workspace tests, language adapter conformance, rendering, application smoke tests, and the required-checks summary. The Windows installer job produced and uploaded a fresh RusticGameEngine-Setup-0.1.0-x64-20261028-042229.exe and passed packaged Setup tests.

@JamieW105 JamieW105 changed the title Add explicit scene load, unload, and switch API Expose scene load, unload, and switch APIs in all script languages Oct 28, 2026
@JamieW105 JamieW105 changed the title Expose scene load, unload, and switch APIs in all script languages Expose scene lifecycle with automatic loading in all script languages Oct 28, 2026
@JamieW105
JamieW105 marked this pull request as ready for review October 28, 2026 04:26
@JamieW105
JamieW105 merged commit f4adcc1 into main Oct 28, 2026
8 checks passed
@github-actions
github-actions Bot deleted the feat/scene-lifecycle-api branch October 28, 2026 04:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants