Quake 2 (GOG) Track Linker

The GOG release of Quake II: Quad Damage has a glaring error in that the music tracks provided, while entirely present and correct, have simply been thrown into a single folder without rhyme or reason, or even consideration for track order. As a result, tracks intended for the game’s expansion packs are mixed in with the base game’s own music and will play at the wrong time and place.

This bash script seeks to correct that error by correctly separating those tracks into folders corresponding to the correct game, based on information gleaned from fan wikis and music databases such as MusicBrainz and Discogs.

As the expansions have some duplicate tracks from the base game and even other expansions, rather than duplicate those tracks, the script instead keeps the files in their original order within a single folder and proceeds to create symbolic links in the separated folders to each track, keeping those symbolic links in order. This in turn meant that disk space wasn’t being hogged by duplicate tracks.

Due to the nature of this approach, this solution is restricted to Linux and possibly macOS, though it should be possible to replicate this with a Windows batch file.