the space_4 file in the folder is the main theme of the game, make it play all the time #148
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.godotcarries 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.wavis 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.
SPACE_4.wavis now committed too, inb8038c1- but as a master, not as a game asset.It sits in
audio/masters/with an empty.gdignorebeside it, which makes Godot skip the folder outright: nothing in it is imported intores://, 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 loadsaudio/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.mdrecords 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 skipsandroid/andbuilds/- 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_PATHand moving the file back - say so and I will do it.