• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Gaias Retaliation music addon issues

Status
Not open for further replies.

Jumbo

Hosted Project GR
Level 19
Joined
Jun 22, 2007
Messages
1,316
Hello everyone.

I made a collection of music tracks that I replaced some tracks in the WC3 MPQ with. I made this for Gaias Retaliation ORPG
(link to the thread: http://www.hiveworkshop.com/forums/gaias-retaliation-orpg-649/music-addon-gaias-retaliation-orpg-263325/ )

The problem, as can be read in the thread, is that the music stops playing after one playthrough. In the map (Gaias Retaliation) this happens when it is used as sound (i.e. not as music). In all other maps, however, where it works as normal music this problem persists: The music plays tracks once and then goes silent no matter if you turn music off/on. So it apparently has something to do with the files and not whether its regarded as music or sound by the game.

Can anyone help with a way to fix ?
 
Could you provide a sample file or perhaps a test map? Just one individual music file that isn't working. It would take a while to download the whole 700 mb to run tests.

Are they mp3 or wav? Find one music file that isn't working, and try reducing the sample rate to 22050 Hz and switch it to mono. Try running it through audacity, implement LAME codec in it (google it, there is a wiki page on instructions), and have it spit out the mp3. Keep in mind that this is just to find out what the issue is. If you can happen to convert it to a form that runs fine in wc3, that is a victory in itself. Wc3 has some strange requirements, so I expect it is something subtle. It is also an old game, so newer encoders might malfunction on an older platform.
 

Zwiebelchen

Hosted Project GR
Level 35
Joined
Sep 17, 2009
Messages
7,236
I noticed that the default WC3 music tracks vary a lot in sample rates and MPEG layers. Several tracks are Layer 1 and Layer 2, some are Layer 3. I also couldn't find a pattern for what sample rates are used and why.
I suppose they did this to keep the filesize low. When WC3 was released, disc space was still a thing.

If you could do some trial & error research on this, that would be a huge benefit for the community.


Anyway, here's a wild guess:
Based on the premise above, I assume the bug you encountered happens when either the sample rate or the MPEG layer (or both) of the default music file and the replacing music file do not match.
This would explain why some tracks work and some won't. Maybe you coincidently picked the right MPEG layer/sample rate for those tracks.

So before you go on a wild goose-hunt, make sure to compare sample rate and MPEG layer of the original tracks with your replacement tracks. Maybe we can already find a pattern here. I suspect the MPEG layer.


There must be an MP3 decoder somewhere in WC3's game code. Considering all the hardcoded stuff in WC3, I wouldn't be surprised if there is a hardcoded "interpreter" table that decides which music track gets encoded on which MPEG layer.

So, if the default track is layer 2 and your imported track is layer 3; the decoder will throw an error.


Another wild guess:
You said you encountered music "dropouts" of several minutes and then suddenly the music started again? This would make sense if we compare sample rates: If you have experience with audio encoding, you will notice that converting a 44khz file into a 22khz file without interpolation of sampling points (any audio software will do that nowadays) will cause the audio to be "stretched". Basicly, your file will be twice as long (and the pitch will shift by a whole octave).
So, if, for whatever reason, the sound plays at correct speed, but WC3 "thinks" it is working with a 22khz file, when in fact it is a 44khz file, it will probably think that the music file is twice as long than it actually is, starting the next file in the queue after the extended duration.

So, depending on the sampling rate of your replacement file and the sampling rate of the original file, you might encounter long audio dropouts:

original file: 16khz sampling rate - 3 minute length
replacement file: 48khz sampling rate - 3 minute length
--> the replacement file plays correctly, but the game thinks it is actually 48/16*3 minutes = 9 minutes long, which causes a 6 minute audio dropout.


You can find out MPEG layers and sampling rate easily in the sound editor of Newgen.
 
Last edited:

Jumbo

Hosted Project GR
Level 19
Joined
Jun 22, 2007
Messages
1,316
Thank you both guys. And Ziewb, the first of your guesses is probably the right one. The other is not because the music only restarted due to Gaias regional music system.
 
Status
Not open for further replies.
Top