Skip to content

Conversation

@fbraz3
Copy link

@fbraz3 fbraz3 commented Jan 28, 2026

This PR prevents the game from getting stuck showing the “Insert CD” dialog during the splash-screen initialization phase.

Motivation

While testing the executable from a non-standard install location (outside the usual Windows install directory / without expected registry setup), the game repeatedly prompted for the CD. The goal here is to improve portability and make development/testing setups work reliably even when Windows registry keys are missing or not pointing to a “retail-style” install path.

Result

The game can start without requiring a physical CD prompt in scenarios where registry-driven install detection is not available (e.g., portable installs, custom directories, dev environments).

Note: This is intentionally a minimal, targeted change focused on removing the blocking dialog during startup, without altering broader CD-check logic elsewhere.

@greptile-apps
Copy link

greptile-apps bot commented Jan 28, 2026

Greptile Overview

Greptile Summary

This PR removes the blocking "Insert CD" dialog that appeared during audio initialization when music files couldn't be found. Previously, the game would repeatedly prompt the user to insert the CD during the splash screen, which could cause the game to hang in non-standard install scenarios.

Changes made:

  • Removed the OSDisplayWarningBox call that displayed the CD insert prompt
  • Simplified the else-block to immediately break out of the loop with an explanatory comment
  • Removed commented-out RTS_DEBUG preprocessor conditionals that were no longer needed

Impact:
The game now gracefully continues initialization even when music files aren't found, improving portability for development environments, custom install locations, and scenarios where registry-based install detection isn't available. The m_musicPlayingFromCD flag is still set, preserving any downstream logic that depends on it.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The change is minimal and targeted, removing only a blocking dialog without altering the core audio initialization logic. The loop still attempts to load music from CD via loadMusicFilesFromCD(), and the m_musicPlayingFromCD flag is still set appropriately. The game continues gracefully whether music is found or not.
  • No files require special attention

Important Files Changed

Filename Overview
Core/GameEngine/Source/Common/Audio/GameAudio.cpp Removed blocking CD insert prompt dialog during audio initialization, allowing the game to continue with local music files

Sequence Diagram

sequenceDiagram
    participant Game as Game Engine
    participant AudioMgr as AudioManager::init()
    participant FS as FileSystem
    participant User as User (Dialog)

    Game->>AudioMgr: Initialize audio system
    AudioMgr->>AudioMgr: Load INI files
    
    alt Music not loaded and not headless
        AudioMgr->>AudioMgr: Set m_musicPlayingFromCD = TRUE
        AudioMgr->>AudioMgr: Enter while(TRUE) loop
        
        AudioMgr->>FS: loadMusicFilesFromCD()
        FS-->>AudioMgr: Return
        
        AudioMgr->>AudioMgr: Check isMusicAlreadyLoaded()
        
        alt Music found (after this PR)
            AudioMgr->>AudioMgr: break - Exit loop
        else Music not found (after this PR)
            Note over AudioMgr: Previously: Display CD insert dialog
            Note over AudioMgr: Now: Break immediately
            AudioMgr->>AudioMgr: break - Exit loop
        end
    end
    
    AudioMgr->>AudioMgr: Create MusicManager
    AudioMgr->>AudioMgr: Create SoundManager
    AudioMgr-->>Game: Initialization complete
Loading

@Stubbjax
Copy link

I wonder if it would be better to introduce a preprocessor directive (if one does not already exist) for toggling CD logic?

@fbraz3
Copy link
Author

fbraz3 commented Jan 28, 2026

I’d rather keep this as a minimal, always-on fix. We still try loadMusicFilesFromCD() first, but we avoid a system-modal/infinite “Insert CD” prompt when it fails, which is the common case in modern/dev installs. Besides who use CD nowdays?

@xezon
Copy link

xezon commented Jan 29, 2026

The way EA has set this up does make sense in principle. Are there more CD related tests like this in the game?

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.

3 participants