Cel Damage talkToMe.dat archive

Codecs, formats, encoding/decoding of game audio, video and music
puggsoy
Posts: 161
Joined: Sat Dec 13, 2014 1:01 am

Cel Damage talkToMe.dat archive

Post by puggsoy »

First of all I'd like to say thank you to aluigi for creating this forum. I have always found XeNTaX a helpful place for information about game file formats, but the registration fee has always prevented me from participating myself. I'm glad that there's finally a free alternative, and by the creator of QuickBMS no less :D
--------------------------

Anyway, a friend asked me to check out this file from the game Cel Damage (Gamecube version I think). After looking at it it looks like the first 0x2030 bytes are file pointers in 2 pairs of longs; the first is the offset, the second is the length. After that there's 10 null bytes, then the file data.

I made this BMS script to extract the files:

Code: Select all

# Cel Damage talkToMe.dat format
#
# Written by puggsoy
# script for QuickBMS http://quickbms.aluigi.org

get OFFSET long

for OFFSET = OFFSET != 0
   get SIZE long
   set NAME OFFSET
   
    log NAME OFFSET SIZE
   get OFFSET long
next

When extracting them though, the program says "coverage file 0 29% 5178736 17790976". So apparently I'm only extracting 29% of the total file, which isn't a lot.

In any case, the extracted files look compressed or otherwise obfuscated, I have no idea how to use them. Again, I'm probably extracting them wrong so that might have something to do with it. You can download the file in question here.

Any help would be appreciated :)
barti
Posts: 34
Joined: Sun Nov 09, 2014 2:40 pm

Re: Cel Damage talkToMe.dat archive

Post by barti »

Gamecube has a Big endian processor, and this file is Little endian. So I think it's more likely to be PS2 or Xbox version.
puggsoy
Posts: 161
Joined: Sat Dec 13, 2014 1:01 am

Re: Cel Damage talkToMe.dat archive

Post by puggsoy »

Well, I asked and the person who initially got the file has confirmed that it is in fact from the Gamecube version. They did note that it's a direct port from the Xbox version though, so that's probably it. The game's code might do some fancy work to allow it to read in little endian.
puggsoy
Posts: 161
Joined: Sat Dec 13, 2014 1:01 am

Re: Cel Damage talkToMe.dat archive

Post by puggsoy »

I took a better look and it looks like my script was wrong. It stops when it reads an offset of 0, however this actually happens a couple of times in between the offset data; specifically at 0xAA8, 0x19A8 and 0x1D28. At each of these locations, instead of an offset an length there are just 8 null bytes. Weird.

Anyway, I've rewritten the script to skip these bits (and print their location), and instead stops once it reaches 0x2030 (which I know is the end of the offset and length data):

Code: Select all

# Cel Damage talkToMe.dat format
#
# Written by puggsoy
# script for QuickBMS http://quickbms.aluigi.org

savepos CURRPOS

for CURRPOS = CURRPOS < 0x2030
   savepos CURRPOS
   get OFFSET long
   get SIZE long
   set NAME OFFSET
   
   if OFFSET != 0
      log NAME OFFSET SIZE
   else
      print "null offset at %CURRPOS|hex%"
   endif
next

Now it doesn't stop early, and actually outputs 99% of the data :) Looks like I'm on target then.

Still wondering how in the world to actually read the extracted files though. Any ideas?
barti
Posts: 34
Joined: Sun Nov 09, 2014 2:40 pm

Re: Cel Damage talkToMe.dat archive

Post by barti »

You're right - they could've just taken files from the Xbox version and switched bits around to make it work on the Gamecube. What reassured me about this is when I looked through files from the PS2 version - music files in this version have the XMA extension, even though the files inside are actually VAG files :mrgreen:

Anyway, I looked at the TalkToMe.dat file from the PS2 version, since I'm more familiar with PS2's audio formats (your QuickBMS script also works on it), and I found out that in fact they take a VAG file, strip its header (first 48 bytes) and store the remaining information. So I took a random .vag file from the game and pasted the header into one of the extracted files. As a result, I got a working .vag file, but there's no correct sample rate provided so it's all sped up and 7 minutes long (with mostly silence).

After some editing and guessing the sample rate, this is what I got:
https://dl.dropboxusercontent.com/u/14123015/235968.wav
puggsoy
Posts: 161
Joined: Sat Dec 13, 2014 1:01 am

Re: Cel Damage talkToMe.dat archive

Post by puggsoy »

Awesome, thank you! Apparently that voice is still a bit low, but turning the pitch up by +13 in Audacity makes it more or less correct. Would you be able to modify the header to make it sound like that?
barti
Posts: 34
Joined: Sun Nov 09, 2014 2:40 pm

Re: Cel Damage talkToMe.dat archive

Post by barti »

I went a step ahead and modified your QuickBMS script to extract playable VAG files (works only on PS2 version), which you can play with vgmstream or any VAG player of your choice. I'd like to get on the Gamecube version next, but I'd need some hints as to what audio format it might use.

Code: Select all

# Cel Damage Overdrive (PS2) talkToMe.dat format
#
# Written by puggsoy and barti
# Thanks to psdevwiki.com for VAG format specification
#
# script for QuickBMS http://quickbms.aluigi.org

get FTABLESIZE long
goto 0

for CURRPOS = 0 < FTABLESIZE
   get OFFSET long
   get SIZE   long

   string NAME p= "%s.vag" OFFSET
   
   if OFFSET > 0
      if SIZE > 0
          callfunction makeVag
      endif
   endif

   savepos CURRPOS
next

startfunction makeVag
    log MEMORY_FILE 0 48

    endian big
    putVarChr MEMORY_FILE 0 0x56414770 long # "VAGp"
    putVarChr MEMORY_FILE 4 32         long # Version
    putVarChr MEMORY_FILE 12 SIZE      long # Waveform data size (in bytes)
    putVarChr MEMORY_FILE 16 22050     long # Sampliing frequency (in Hz)
    putVarChr MEMORY_FILE 30 0         long # No. of channels (0-1 - mono, 2 - stereo)
    endian little

    append
    log MEMORY_FILE OFFSET SIZE
    append

    get SIZE asize MEMORY_FILE
    log NAME 0 SIZE MEMORY_FILE
endfunction


And here's the PS2 version's talkToMe.dat file:
https://dl.dropboxusercontent.com/u/141 ... LKTOME.DAT
puggsoy
Posts: 161
Joined: Sat Dec 13, 2014 1:01 am

Re: Cel Damage talkToMe.dat archive

Post by puggsoy »

Oh brilliant, thanks a bunch! Works perfectly, very much appreciated :) Extracting from the PS2 version was sufficient for the original intent, but I'd also like to figure out how the Gamecube file works (maybe for modding or whatnot). I might be able to ask on the HCS forum to see if anybody recognises the waveforms.