Music DAT files - reducing space needed?

Discuss, get help with, or post new modifications, graphics or related tools for Locomotion in this forum.

Moderator: Locomotion Moderators

HwAoRrDk
Engineer
Engineer
Posts: 33
Joined: 26 Sep 2004 18:44
Location: United Kingdom

Music DAT files - reducing space needed?

Post by HwAoRrDk »

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?!? :shock:

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!
User avatar
jules
Traffic Manager
Traffic Manager
Posts: 169
Joined: 11 Aug 2004 07:56

Post by jules »

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...
There is no ?
HwAoRrDk
Engineer
Engineer
Posts: 33
Joined: 26 Sep 2004 18:44
Location: United Kingdom

Post by HwAoRrDk »

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...
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.

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.
HwAoRrDk
Engineer
Engineer
Posts: 33
Joined: 26 Sep 2004 18:44
Location: United Kingdom

Post by HwAoRrDk »

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! :cry:
User avatar
orudge
Administrator
Administrator
Posts: 25137
Joined: 26 Jan 2001 20:18
Skype: orudge
Location: Banchory, UK
Contact:

Post by orudge »

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.
HwAoRrDk
Engineer
Engineer
Posts: 33
Joined: 26 Sep 2004 18:44
Location: United Kingdom

Post by HwAoRrDk »

orudge wrote:Because of this, you can't even use an Ogg Vorbis or MP3 file wrapped in a WAV header
Unfortunately, just discovered that myself. I just this minute tried using a compressed WAV format, but to no avail. :(

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... :cry:

Looks like this may be patch territory.
User avatar
Korenn
Tycoon
Tycoon
Posts: 1735
Joined: 26 Mar 2004 01:27
Location: Netherlands
Contact:

Post by Korenn »

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.
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.
every program that does use other formats has had to import a custom file loader to do so.
User avatar
jax184
Engineer
Engineer
Posts: 16
Joined: 12 Sep 2004 02:31
Location: Vancouver, Canada
Contact:

Post by jax184 »

HwAoRrDk wrote: if the game does appear on P2P,
That was a rather optomistic thing to say...
If it's worth doing, it's worth overdoing.
User avatar
jules
Traffic Manager
Traffic Manager
Posts: 169
Joined: 11 Aug 2004 07:56

Post by jules »

jax184 wrote:
HwAoRrDk wrote: if the game does appear on P2P,
That was a rather optomistic thing to say...
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.
There is no ?
User avatar
Bart
Tycoon
Tycoon
Posts: 1110
Joined: 02 Mar 2003 13:43
Location: Stompetoren, the Netherlands
Contact:

Post by Bart »

Actual game content itself is very small... after converting all music to 192 kbps mp3 it is only 120 megabytes or so. Mr. Sawyer, you're a dumb ass...
[url=CALLTO://Sgreehder]Image[/url]
alphanumeric
Director
Director
Posts: 516
Joined: 02 Aug 2003 23:45

Post by alphanumeric »

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"
Matt86
Engineer
Engineer
Posts: 20
Joined: 19 May 2004 09:30

Post by Matt86 »

jules wrote:
jax184 wrote:
HwAoRrDk wrote: if the game does appear on P2P,
That was a rather optomistic thing to say...
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.
may i add... its compressed in mp3 :roll:
User avatar
jax184
Engineer
Engineer
Posts: 16
Joined: 12 Sep 2004 02:31
Location: Vancouver, Canada
Contact:

Post by jax184 »

jules wrote:
jax184 wrote:
HwAoRrDk wrote: if the game does appear on P2P,
That was a rather optomistic thing to say...
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.
Which P2P did you check?
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.
User avatar
Overlord1191
Traffic Manager
Traffic Manager
Posts: 172
Joined: 09 Sep 2004 14:12
Location: Georgia, USA
Contact:

Post by Overlord1191 »

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.
Dark Rain
Engineer
Engineer
Posts: 4
Joined: 20 Sep 2004 22:30

Post by Dark Rain »

A lot of games still use good old wav because they don't take much CPU time to decode.
User avatar
jules
Traffic Manager
Traffic Manager
Posts: 169
Joined: 11 Aug 2004 07:56

Post by jules »

jax184 wrote:
Which P2P did you check?
Edonkey has had it for download since the very day it came out in full ungodly sized ISO.
Just checked again, and its actually 65mb... yea i looked on emule so edonkey.
There is no ?
lumted
Traffic Manager
Traffic Manager
Posts: 181
Joined: 20 Oct 2002 10:56
Location: Norway
Contact:

Post by lumted »

The "ungodly sized ISO"-image is: 629675978 bytes = 614917,9 kilobytes = 600.5 megabytes large.
Yes, I have it, but I have the original CD as well. I just couldn't wait to play the game :)
User avatar
jules
Traffic Manager
Traffic Manager
Posts: 169
Joined: 11 Aug 2004 07:56

Post by jules »

lumted wrote:The "ungodly sized ISO"-image is: 629675978 bytes = 614917,9 kilobytes = 600.5 megabytes large.
Yes, I have it, but I have the original CD as well. I just couldn't wait to play the game :)
Err... i was talking about the myth rip that is 65mb, the iso is indeed 600mb
There is no ?
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5602
Joined: 13 Sep 2004 13:21
Location: The Moon

Post by PikkaBird »

You could always convert the files to .mp3, and then play them through winamp rather than Lomo? :)
HwAoRrDk
Engineer
Engineer
Posts: 33
Joined: 26 Sep 2004 18:44
Location: United Kingdom

Post by HwAoRrDk »

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.
Well, go ahead! :D There's nothing to stop you. There are simply three things to bear in mind:
  • 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 :lol: )
I guess the internal track name listing could be modified somehow with custom names of your choice, but we just need to find which pesky DAT files they're in...
Post Reply

Return to “Locomotion Graphics, Modifications & Tools”

Who is online

Users browsing this forum: No registered users and 4 guests