Skip to content

Keep background music (silently) playing when not inside the GUI - #169

Merged
wlhlm merged 2 commits into
masterfrom
play-music-continuously-in-background
Sep 29, 2026
Merged

wlhlm merged 2 commits into
masterfrom
play-music-continuously-in-background

Conversation

@wlhlm

@wlhlm wlhlm commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

Summary

gtnh-vending-machine-music-continuity.mp4

When you open the VM just for a quick purchase, you mostly get to hear the same initial notes/beats of the track. I thought it would be more immersive if the track would continue to silently play in the background and you get to hear a different portion of it depending on when you open the GUI.

This is built upon @eigenraven's work from the GT Jukebox that added ISeekingSound.

Note that the way I implemented the calculation of the seek time just based on system time, players will typically never hear the exact beginning of the track. I could think of maybe starting the timer from the first the GUI is opened per login, but depending on how often the machine is accessed this could still lead to the player mostly only hearing the beginning of the song.

Checklist

  • I have tested this PR in DevEnv
  • I have tested this PR in Fullpack
  • This PR is in compliance with the GTNH AI Policy
  • This PR requires another PR in order to merge

Instead of always starting to play the VM GUI music from the beginning, start with an offset based on time. This gives the illusion that the music continues playing while the players in not in the GUI
@wlhlm wlhlm changed the title Keep background music playing (silently) playing when not inside the GUI Keep background music (silently) playing when not inside the GUI Sep 29, 2026

@cubefury cubefury left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

im a fan of this change

@wlhlm
wlhlm merged commit 931ffbb into master Sep 29, 2026
1 check passed
@wlhlm
wlhlm deleted the play-music-continuously-in-background branch September 29, 2026 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants