Skip to content

Honor StartNewModule movie arguments and suppress world audio during movie playback#99

Merged
modawan merged 5 commits intomodawan:masterfrom
Eldbury:clean-pr-movie-audio-suppression
Apr 25, 2026
Merged

Honor StartNewModule movie arguments and suppress world audio during movie playback#99
modawan merged 5 commits intomodawan:masterfrom
Eldbury:clean-pr-movie-audio-suppression

Conversation

@Eldbury
Copy link
Copy Markdown

@Eldbury Eldbury commented Apr 21, 2026

Summary

This PR fixes two closely related movie-playback issues:

  1. StartNewModule was parsing movie args (sMovie1..sMovie6) but ignoring them, so transition BIKs were skipped.
  2. Once movie playback was restored, already-playing world/ambient audio continued underneath the movie because active AudioType::Sound sources were left alive.

Changes

1. Honor StartNewModule movie arguments before transition

Scripts were already passing movie args correctly, e.g.:

  • StartNewModule("STUNT_00", "", "01c", "", "", "", "", "")
  • StartNewModule("tar_m02af", "", "01f", "", "", "", "", "")

but the runtime parsed sMovie1..sMovie6 and then immediately scheduled the module transition without honoring them, so the BIKs were skipped.

The fix makes StartNewModule collect non-empty movie args, play them through the existing movie backend, and only let the pending module transition proceed after those movies finish.

2. Suppress world audio during movie playback

Currently movie start stops _music, but leaves active world AudioType::Sound sources alive, so ambient/module audio continues while the movie is playing.

The fix adds type-based stopping in the mixer and suppresses active AudioType::Sound sources when a movie begins, while leaving movie audio intact.

Scope

  • no movie-resref special casing
  • no Taris wake-up placement fix
  • no aspect/stretch fix
  • no broad movie/audio subsystem rewrite

@modawan
Copy link
Copy Markdown
Owner

modawan commented Apr 21, 2026

Thanks a lot! Looks good to me overall. Need to update tests (add stop function to test/fixtures/audio.h).

Copy link
Copy Markdown
Owner

@modawan modawan left a comment

Choose a reason for hiding this comment

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

Ugh, I didn't publish the comments.

Comment thread src/libs/game/game.cpp Outdated
bool Game::playNextModuleTransitionMovie() {
while (!_moduleTransitionMovies.empty()) {
auto name = std::move(_moduleTransitionMovies.front());
_moduleTransitionMovies.erase(_moduleTransitionMovies.begin());
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Maybe use std::queue instead?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Addressed in the latest branch revision: _moduleTransitionMovies now uses std::queue, so the transition movies are consumed FIFO without erasing from the front of a std::vector.

Comment thread src/libs/game/game.cpp Outdated
return false;
}

_services.audio.mixer.stop(AudioType::Sound);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

There are 4 AudioTypes possible, but we only cancel Sounds. Is there a reason to not stop every audio source before playing a movie?

enum class AudioType {
    Music,
    Voice,
    Sound,
    Movie
};

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Addressed in the latest branch revision: movie startup now stops all existing audio sources before constructing/starting the movie, so world audio is suppressed while movie audio still plays correctly.

Copy link
Copy Markdown
Owner

@modawan modawan left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@modawan modawan merged commit 14cbea4 into modawan:master Apr 25, 2026
2 checks passed
@Eldbury Eldbury deleted the clean-pr-movie-audio-suppression branch April 26, 2026 00:58
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