Music DAT files - reducing space needed?
Moderator: Locomotion Moderators
Music DAT files - reducing space needed?
I was wondering the other day why on earth the game needs to take up sooooo much disk space. I suspected it had to do with the music, as when I got hold of the Loco demo, there were two versions, one without music being 100MB (!) smaller than the musical one.
So, I checked out the 'Data' directory. There are lots of files along the lines of 20s1.dat, 20s2.dat, 40s1.dat, etc. It seems these names refer to the period - e.g. 1920's, 1940's, etc.
I then loaded up one of these files into my trusty hex editor. Lo-and-behold, what do I find? The bleedin' music files are simply RIFF format WAV files! No wonder they're flipping huge! Simply renaming from '.dat' to '.wav' enables you to play them in your usual media player. (Side question: if they're simple WAVs, where are the track names stored?)
Has Chris Sawyer never heard of MP3, Ogg Vorbis, etc?!?
Therefore, I was wondering if it would ever be feasible to make a modification to the game in order to get it to play the music from a different format? Some kind of interception routine, perhaps? Then, we could all have the music compressed using, say, MP3 and save ourselves 400MB of disk space!
So, I checked out the 'Data' directory. There are lots of files along the lines of 20s1.dat, 20s2.dat, 40s1.dat, etc. It seems these names refer to the period - e.g. 1920's, 1940's, etc.
I then loaded up one of these files into my trusty hex editor. Lo-and-behold, what do I find? The bleedin' music files are simply RIFF format WAV files! No wonder they're flipping huge! Simply renaming from '.dat' to '.wav' enables you to play them in your usual media player. (Side question: if they're simple WAVs, where are the track names stored?)
Has Chris Sawyer never heard of MP3, Ogg Vorbis, etc?!?
Therefore, I was wondering if it would ever be feasible to make a modification to the game in order to get it to play the music from a different format? Some kind of interception routine, perhaps? Then, we could all have the music compressed using, say, MP3 and save ourselves 400MB of disk space!
wow never realised it took up that much space, wav formats tho?? it does seem to add to the list of slightly dodgy and illogical things chris has done with this game..
But i suppose making the game 400mb larger through wav makes it harder to download illegaly, until someone realises they can compress the files down and include an uncompressor...
But i suppose making the game 400mb larger through wav makes it harder to download illegaly, until someone realises they can compress the files down and include an uncompressor...
There is no ?
Yeah, I doubt it's specifically an anti-piracy measure. It's not exactly hard to convert WAV->MP3->WAV. Anyway, if the game does appear on P2P, it'll likely be in the form of a complete ISO of the game, which people always compress anyway.jules wrote:But i suppose making the game 400mb larger through wav makes it harder to download illegaly, until someone realises they can compress the files down and include an uncompressor...
My guess for the reasoning behind the WAVs is that either CS didn't want to pay for a 3rd party codec to play the music, or didn't have the time or the inclination to program one in assembler himself.
Just a quick note for those curious: the WAV files are 16-bit, 22050MHz stereo PCM format.
I guess seeing as Loco goes through DirectX for sound, etc. I was gonna try simply encoding the WAVs into MP3, renaming to '.dat' and see if DirectX handles it transparently. But, my MP3 encoder (BladeEnc) doesn't support 22KHz raw files!
I guess seeing as Loco goes through DirectX for sound, etc. I was gonna try simply encoding the WAVs into MP3, renaming to '.dat' and see if DirectX handles it transparently. But, my MP3 encoder (BladeEnc) doesn't support 22KHz raw files!
- orudge
- Administrator
- Posts: 25137
- Joined: 26 Jan 2001 20:18
- Skype: orudge
- Location: Banchory, UK
- Contact:
That won't work. Locomotion reads the WAV files and decodes the headers, etc, itself - it doesn't get DirectSound or DirectShow to read it. Because of this, you can't even use an Ogg Vorbis or MP3 file wrapped in a WAV header: Locomotion will only work with a 22,050Hz, 16-bit stereo PCM WAV file. Try converting one of them to a 44,100Hz or 11,025Hz file - it should play faster or slower, as Loco is expecting a fixed set of parameters, and ignores anything else.
Unfortunately, just discovered that myself. I just this minute tried using a compressed WAV format, but to no avail.orudge wrote:Because of this, you can't even use an Ogg Vorbis or MP3 file wrapped in a WAV header
I used the Sound Recorder app in Windows to load up 20s1.dat (renamed to '.wav'), hit 'Save As', changed the format to 'MPEG Layer-3' at '56Kbps, 22,050 Hz, Stereo' and replaced back in the Data directory (as '.dat'). It didn't work - Loco refused to play the track.
Shame, really...
Looks like this may be patch territory.
in fact, even if direct x was loading the objects, it still wouldn't work, because direct X can't load anything other than wav or midi.orudge wrote:That won't work. Locomotion reads the WAV files and decodes the headers, etc, itself - it doesn't get DirectSound or DirectShow to read it. Because of this, you can't even use an Ogg Vorbis or MP3 file wrapped in a WAV header: Locomotion will only work with a 22,050Hz, 16-bit stereo PCM WAV file. Try converting one of them to a 44,100Hz or 11,025Hz file - it should play faster or slower, as Loco is expecting a fixed set of parameters, and ignores anything else.
every program that does use other formats has had to import a custom file loader to do so.
Creator of the Openttd Challenge Spinoff, Town Demand patch
After action reports: The path to riches, A dream of skyscrapers
After action reports: The path to riches, A dream of skyscrapers
lol just checked Err you can download it for 100mb, same size as the demo, its been ripped by myth, which afaik means that they compress the sound and have their own uncompressor which is how they make it so small, its is also in iso, yes.jax184 wrote:That was a rather optomistic thing to say...HwAoRrDk wrote: if the game does appear on P2P,
There is no ?
-
- Director
- Posts: 516
- Joined: 02 Aug 2003 23:45
chris sawyer is just soo old school.. he just doesnt have the touch he used to have back in the day (mid 90s or so) now that technology has moved up so far in advanced.. Chris Sawyer just could not keep up with the times.. IMO lol...
a lil O\T but when I loaded the game at my work.. someone commented on locomotion.. and how old was the game.. and I said it just came out.. and my buddy at work giggled ... and said...
"yaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
a lil O\T but when I loaded the game at my work.. someone commented on locomotion.. and how old was the game.. and I said it just came out.. and my buddy at work giggled ... and said...
"yaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
may i add... its compressed in mp3jules wrote:lol just checked Err you can download it for 100mb, same size as the demo, its been ripped by myth, which afaik means that they compress the sound and have their own uncompressor which is how they make it so small, its is also in iso, yes.jax184 wrote:That was a rather optomistic thing to say...HwAoRrDk wrote: if the game does appear on P2P,
Which P2P did you check?jules wrote:lol just checked Err you can download it for 100mb, same size as the demo, its been ripped by myth, which afaik means that they compress the sound and have their own uncompressor which is how they make it so small, its is also in iso, yes.jax184 wrote:That was a rather optomistic thing to say...HwAoRrDk wrote: if the game does appear on P2P,
Edonkey has had it for download since the very day it came out in full ungodly sized ISO.
If it's worth doing, it's worth overdoing.
- Overlord1191
- Traffic Manager
- Posts: 172
- Joined: 09 Sep 2004 14:12
- Location: Georgia, USA
- Contact:
Well, go ahead! There's nothing to stop you. There are simply three things to bear in mind:Overlord1191 wrote:Just throwing this out here. If the files are wavs renamed, why can't we add some more music to the game and rename a wav file with the same name as the actual file.
I like the piano in 1920s but it gets pretty damn old after you've heard it for 6 hours.
- The WAV files must be saved as 16-bit, 22,050Hz stereo PCM format. Anything else and it won't play at all, or play too fast/slow.
- They must replace the existing files, using the exact same filenames.
- You'll have to remember which Loco track names correspond to your actual tracks (e.g. Chuggin' Along = Oops, I Did It Again by Britney )
Who is online
Users browsing this forum: No registered users and 4 guests