How to prevent BGM from being interrupted when loading a save?

Due to game mechanics, I need to frequently load save files. However, the moment a scene (game_scene) is loaded, the BGM (AudioStreamPlayer) inside it resets. I’ve been unable to find a way to keep the BGM playing continuously without interruption when loading a save within a single scene.

Currently, I’m using the method of playing BGM via a [Global Control] to prevent the music from being interrupted, but this has introduced new issues: when switching scenes, the [Global Control] cannot update the BGM accordingly :crying_cat:

I’ve thought long and hard but haven’t found a good solution, so I’m turning to the Godot team for advice. Any guidance would be greatly appreciated.

That is an issue that needs to be looked into, but I would like to inquire if the following workaround would be temporarily acceptable:

Would saving a variable with the current playback point using “SaveAudioPosition” right before performing the load and then loading that when you load give close enough results, or is the gap in playback too long for you? (Depending on save time and load time, there might be a slight stutter in the playback)

Thanks for the reply. After thinking it over, I feel this approach won’t work. I’m not quite sure how to set a variable for the playback position,

and I’d prefer the music to continue playing without interruption; a break would feel quite abrupt :sweat_smile:

Is it currently impossible for AGM to fulfill this requirement using its existing logic?

Could future updates possibly include an option to read BGM without interruption? :rofl:

I think that in the future it should be possible. But besides player and enemy status, what else needs to quickly reset? Besides music, what else needs to continue?

If we better understand the structure you need, it’ll be easier to implement or suggest an effective workaround.

Thank you very much. We look forward to additional options in the future.

For now, in my personal project, only the BGM needs to be preserved and not reset when saving or loading.

I haven’t thought of any other content that requires this at the moment.

Thank you for the clarification! I’ll add it to the request list!

1 Like

Create an Autoload node, which should be able to play music continuously. By using custom script actions, you can control this Autoload node arbitrarily. In theory, this requirement can be met. Also, what does [Global Control] refer to?