Repository navigation
Expose scene lifecycle with automatic loading in all script languages - #60
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.