the space_4 file in the folder is the main theme of the game, make it play all the time #148

Closed
opened 2026-08-28 13:56:39 +00:00 by metaheavens · 2 comments
Owner
No description provided.
Author
Owner

Done in aabd580.

"All the time" is the whole of the requirement, and it decides the shape. The theme has to survive the main menu becoming the game, the game becoming a planet surface, and the surface becoming the game again - so the player cannot live in any of those scenes, because change_scene_to_file() frees whichever one is current. It is parented to the tree root instead, beside the GameState autoload, which is the same trick for the same reason. Music.ensure() is idempotent by node name, so each scene asks for the music on the way up and gets the one already playing rather than a second copy over the top.

Two call sites cover everything: MainMenu, and GameController - which is the root script of both the space scene and the planet surface.

Done that way rather than as an autoload on purpose: project.godot carries your own uncommitted window settings, and adding music should not drag those into a commit.

It is also PROCESS_MODE_ALWAYS. Since #128 a dialog stops the tree, and a soundtrack that cuts out every time someone reads a line is worse than no soundtrack.

One decision worth your sign-off. It ships as MP3, not the WAV. SPACE_4.wav is 59.3MB; the same 5m36s at LAME 160k is 6.7MB - 89% smaller. Git keeps blobs forever, so committing the WAV would put 59MB in the history permanently, on a project that also exports to Android and the web. Your original file is untouched and still sitting in the project root, untracked, so nothing is lost - say the word if you would rather ship the WAV and I will swap it.

The test checks continuity rather than "a sound started": the same player, never a second one, through two scene changes and a dialog.

Done in `aabd580`. "All the time" is the whole of the requirement, and it decides the shape. The theme has to survive the main menu becoming the game, the game becoming a planet surface, and the surface becoming the game again - so the player cannot live in any of those scenes, because `change_scene_to_file()` frees whichever one is current. It is parented to the **tree root** instead, beside the GameState autoload, which is the same trick for the same reason. `Music.ensure()` is idempotent by node name, so each scene asks for the music on the way up and gets the one already playing rather than a second copy over the top. Two call sites cover everything: MainMenu, and GameController - which is the root script of *both* the space scene and the planet surface. Done that way rather than as an autoload on purpose: `project.godot` carries your own uncommitted window settings, and adding music should not drag those into a commit. It is also `PROCESS_MODE_ALWAYS`. Since #128 a dialog stops the tree, and a soundtrack that cuts out every time someone reads a line is worse than no soundtrack. **One decision worth your sign-off.** It ships as MP3, not the WAV. `SPACE_4.wav` is 59.3MB; the same 5m36s at LAME 160k is 6.7MB - 89% smaller. Git keeps blobs forever, so committing the WAV would put 59MB in the history permanently, on a project that also exports to Android and the web. Your original file is untouched and still sitting in the project root, untracked, so nothing is lost - say the word if you would rather ship the WAV and I will swap it. The test checks continuity rather than "a sound started": the same player, never a second one, through two scene changes and a dialog.
Author
Owner

SPACE_4.wav is now committed too, in b8038c1 - but as a master, not as a game asset.

It sits in audio/masters/ with an empty .gdignore beside it, which makes Godot skip the folder outright: nothing in it is imported into res://, and nothing in it is carried into an export. Left in the project root its 59MB would have been imported and then packed into every Android and web build, for a file nothing opens - the game loads audio/space_4.mp3, the same 5m36s at 6.7MB.

So: the source is versioned and cannot be lost, and the builds stay small. audio/masters/README.md records which shipped file each master became and the exact ffmpeg command that made it, so the two cannot drift apart silently. The test runner skips the folder as well, for the same reason it already skips android/ and builds/ - 59MB copied on every run, for a folder no test can even see.

If you would rather the game load the WAV directly instead of the MP3, that is a one-line change to Music.THEME_PATH and moving the file back - say so and I will do it.

`SPACE_4.wav` is now committed too, in `b8038c1` - but as a **master**, not as a game asset. It sits in `audio/masters/` with an empty `.gdignore` beside it, which makes Godot skip the folder outright: nothing in it is imported into `res://`, and nothing in it is carried into an export. Left in the project root its 59MB would have been imported and then packed into every Android and web build, for a file nothing opens - the game loads `audio/space_4.mp3`, the same 5m36s at 6.7MB. So: the source is versioned and cannot be lost, and the builds stay small. `audio/masters/README.md` records which shipped file each master became and the exact ffmpeg command that made it, so the two cannot drift apart silently. The test runner skips the folder as well, for the same reason it already skips `android/` and `builds/` - 59MB copied on every run, for a folder no test can even see. If you would rather the game load the WAV directly instead of the MP3, that is a one-line change to `Music.THEME_PATH` and moving the file back - say so and I will do it.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
metaheavens/spaceship#148
No description provided.