.gin and .abk sound formats (Need for Speed mw 2005)(help)

Codecs, formats, encoding/decoding of game audio, video and music
id-daemon
Posts: 1040
Joined: Sun Mar 22, 2015 7:09 pm

Re: .gin and .abk sound formats (Need for Speed mw 2005)(help)

Post by id-daemon »

No, music use the same codec as ABK files.

The last array table is table of offsets in the first data section.

What about ABK files, are they different for other games? What do they use it for? Engine sounds or something else?
V12-POWER
Posts: 71
Joined: Thu Jul 02, 2015 10:43 pm

Re: .gin and .abk sound formats (Need for Speed mw 2005)(help)

Post by V12-POWER »

id-daemon2 wrote:No, music use the same codec as ABK files.

The last array table is table of offsets in the first data section.

What about ABK files, are they different for other games? What do they use it for? Engine sounds or something else?


the abk files are used for almost any sound fx in these NFS games, NFSUG onwards. all except speeches and music.

Basically the ABK files received a small update in the transition to NFSCarbon, it is really identical to the abk files you're working with now (NFSMW2005), the big data section at the start, the offset table at the end, sound ID, all the same but instead of a BNKl section, we have this

Image

all in big endian. in this case we had only 1 sample but it's the same for more. The audio data offset is relative to it's position in the file. And for the rest of the offsets, we have to start counting from the first given audio data offset onwards. frequency is 44.1khz, same as the .gins from NFSPS and NFSUC.

so if audio data offset 1 is at offset 100, audio data offset 2 value, lets say 120, we have to start counting from offset 100 because audio data offset 1 is at such offset, hope it clears some stuff. I also don't know if these new abk use the same codec or not.

edit: for now it seems like the first part of the data is a big clusterfuk...a lot of relative offsets, but the standpoint is unknown really, some are fixed some not.
id-daemon
Posts: 1040
Joined: Sun Mar 22, 2015 7:09 pm

Re: .gin and .abk sound formats (Need for Speed mw 2005)(help)

Post by id-daemon »

Good news. Now i know why swapping ABK files didn't work. They have car ID at 0x126c. Just change that ID and you can replace any car ABK with another. That proves that there's nothing specific for different ABK files and the game can use any of them if needed.

Bad news is that ABK structure has a lot of sound properties and I don't think we can ever identify them all. Let's just hope we can identify those that you really need.

As for encoder, this is not a problem. I did that before and I'm sure I can do this. Just need some time.

What about newer NFS games, like 2009 or later? Do they use any of ABK or GIN formats?
V12-POWER
Posts: 71
Joined: Thu Jul 02, 2015 10:43 pm

Re: .gin and .abk sound formats (Need for Speed mw 2005)(help)

Post by V12-POWER »

id-daemon2 wrote:Good news. Now i know why swapping ABK files didn't work. They have car ID at 0x126c. Just change that ID and you can replace any car ABK with another. That proves that there's nothing specific for different ABK files and the game can use any of them if needed.

Bad news is that ABK structure has a lot of sound properties and I don't think we can ever identify them all. Let's just hope we can identify those that you really need.

As for encoder, this is not a problem. I did that before and I'm sure I can do this. Just need some time.

What about newer NFS games, like 2009 or later? Do they use any of ABK or GIN formats?


the gin and abk was dropped after NFSUndercover, because they no longer used the EAGL engine. after this you have a lot of formats from different engines, chameleon, nfs shift formats and frostbite formats, which we all know how long they took to decode let alone encode which is not even done yet.

I can understand what the sound properties do with trial and error as the data is uncompressed. The last section, however, has some interesting properties, right before the BNKl section. I am going to test what does this part affects and then go with the rest. It would be of real help to parse all the strings using the offset table at the end, because it seems like there are many of them that are similar (same lenght, varied information, same byte signatures, etc)
id-daemon
Posts: 1040
Joined: Sun Mar 22, 2015 7:09 pm

Re: .gin and .abk sound formats (Need for Speed mw 2005)(help)

Post by id-daemon »

Right before the BNKl section there are some tables forming sort of curves like on the pictures I posted before. Wonder what they can be used for.

How would you like me to output the parsed strings?
V12-POWER
Posts: 71
Joined: Thu Jul 02, 2015 10:43 pm

Re: .gin and .abk sound formats (Need for Speed mw 2005)(help)

Post by V12-POWER »

id-daemon2 wrote:Right before the BNKl section there are some tables forming sort of curves like on the pictures I posted before. Wonder what they can be used for.

How would you like me to output the parsed strings?


yea that table is the same across all car sounds, and the offsets for this table/curve are given at the "middle" of the section (the section that follows the car ID byte) however it seems to vary when you look at turbo sound files and more sfx. it hasn't got that much effect in the sound however (it contains volume for engine set actually but just that)

using the offset table, we would be left with a bunch of byte sequences. some are similar in lenght (12, 15, 18 bytes most common) I tell you this because it seems like this information cant be changed or shared across abk files. I tried cutting a small part with the same size and the game crashed. It's strange cause it doesn't seem to contain any obvious information, but i'll keep playing with them

edit: it does not crash now, forgot to edit the array table offset at the header and file size. definetly, the first part is where the sound filters, effects and crossfade are made/stored.
id-daemon
Posts: 1040
Joined: Sun Mar 22, 2015 7:09 pm

Re: .gin and .abk sound formats (Need for Speed mw 2005)(help)

Post by id-daemon »

I see no big reason for changing GIN files, its hardly even heard in game. Most of the engine sound is formed from that ABKs 8 samples:

1 - low idle
2 - idle
3 - low slowdown
4 - high slowdown
5 - low speedup
6 - middle speedup
7 - high speedup
8 - overrev
Last edited by id-daemon on Fri Oct 09, 2015 7:48 pm, edited 1 time in total.
V12-POWER
Posts: 71
Joined: Thu Jul 02, 2015 10:43 pm

Re: .gin and .abk sound formats (Need for Speed mw 2005)(help)

Post by V12-POWER »

id-daemon2 wrote:I see no big reason for changing GIN files, its hardly even heard in game. Most of the engine sound is formed from that ABKs 8 samples:

1 - low idle
2 - idle
3 - high slowdown
4 - low slowdown
5 - low speedup
6 - middle speedup
7 - high speedup
8 - overrev


well just the opposite is what I think, having the original gin files with new sounds sort of killed the modded sound set. However we can "replace" the need for gin files by using more samples and make the engine rpm buildup with more than 8 samples. Anyways, if the idea is to move to NFSPS or NFSUC then sooner or later we will need to change gin files as the engine sounds are purely gin files inside the .tmx
id-daemon
Posts: 1040
Joined: Sun Mar 22, 2015 7:09 pm

Re: .gin and .abk sound formats (Need for Speed mw 2005)(help)

Post by id-daemon »

Can you give me an example of a car where I can hear GIN file? Because on low end cars I almost can't hear it.
V12-POWER
Posts: 71
Joined: Thu Jul 02, 2015 10:43 pm

Re: .gin and .abk sound formats (Need for Speed mw 2005)(help)

Post by V12-POWER »

id-daemon2 wrote:Can you give me an example of a car where I can hear GIN file? Because on low end cars I almost can't hear it.


you can try swapping some abks. the not so obvious becomes obvious when you listen to the rpm buildup sequence. As I said, we can "fix" the need for gin replacement by using more samples in the abk, but this will need more file knowledge for samples crossfade and mixer properties. yet again if the plan is to move to later games like pro street then we will be forced to replace gin files. their format is .tmx but is a container, gin files reside inside it
id-daemon
Posts: 1040
Joined: Sun Mar 22, 2015 7:09 pm

Re: .gin and .abk sound formats (Need for Speed mw 2005)(help)

Post by id-daemon »

V12-POWER wrote:you can try swapping some abks


That's what I did. I tried VW Golf with GINs from audi and ferrari and can't hear almost any difference. That's why I'm asking for an example.

Another info. ABK files from Carbon use yet another codec.
V12-POWER
Posts: 71
Joined: Thu Jul 02, 2015 10:43 pm

Re: .gin and .abk sound formats (Need for Speed mw 2005)(help)

Post by V12-POWER »

id-daemon2 wrote:
V12-POWER wrote:you can try swapping some abks


That's what I did. I tried VW Golf with GINs from audi and ferrari and can't hear almost any difference. That's why I'm asking for an example.

Another info. ABK files from Carbon use yet another codec.


when I used (abks) from lamborghini gallardo, tvr_cerbera (bmw m3 gtr), corvette, or truck sounds I noticed that the gin is used in the background in the higher rpm range, having dominance in the middle rpm range. when shifting or lifting the throttle you hear the gin sound. there's also small hints of the gin when coming close to the rev limiter. I tested this over and over to be sure that it wasnt a mistake of perception.

replacing the gins should have the same effects, otherwise those guys who used to make "sound mods" by exchanging .gin files were doing nothing at all
id-daemon
Posts: 1040
Joined: Sun Mar 22, 2015 7:09 pm

Re: .gin and .abk sound formats (Need for Speed mw 2005)(help)

Post by id-daemon »

Thank you for the example, I'll check it.

V12-POWER wrote:... those guys who used to make "sound mods" by exchanging .gin files were doing nothing at all


Yes, they couldn't exchange ABK files and now we know why.

Can we return to that SX.exe problem? What could be wrong? Are you sure you used the right options? Did you use original WAV extracted on changed it somehow?
V12-POWER
Posts: 71
Joined: Thu Jul 02, 2015 10:43 pm

Re: .gin and .abk sound formats (Need for Speed mw 2005)(help)

Post by V12-POWER »

it works now, forgot to tell ya, I did input the command lines wrong so thats why it did not work. I used many samples, however in game it does not sound as someone would expect it - im talking about completely different sounds when comparing in-game to audacity samples - I changed the sample rate and put it to mono, but not in anyway it should sound like it does in game (think about a big v8) instead of a small 4 cylinder engine

This might be because of sample rate (original 44.1khz to 22.05khz) and nothing serious but felt the need to say it

About the new Abks of nfscarbon. I knew about the new codec because of the audio organization, but did not recognize the exact codec however
id-daemon
Posts: 1040
Joined: Sun Mar 22, 2015 7:09 pm

Re: .gin and .abk sound formats (Need for Speed mw 2005)(help)

Post by id-daemon »

Did you change the sample length in ABK?
V12-POWER
Posts: 71
Joined: Thu Jul 02, 2015 10:43 pm

Re: .gin and .abk sound formats (Need for Speed mw 2005)(help)

Post by V12-POWER »

id-daemon2 wrote:Did you change the sample length in ABK?


used the same lengths as the original abk.
id-daemon
Posts: 1040
Joined: Sun Mar 22, 2015 7:09 pm

Re: .gin and .abk sound formats (Need for Speed mw 2005)(help)

Post by id-daemon »

Ok tried gallardo and yes, for this car GIN file is playing a big part. I haven't played NFS since 2000, now just started this MW game, so everything I had was that Golf with the first race engine and for this one GIN is not that important.

Give me some time to make experiments.
V12-POWER
Posts: 71
Joined: Thu Jul 02, 2015 10:43 pm

Re: .gin and .abk sound formats (Need for Speed mw 2005)(help)

Post by V12-POWER »

take all the time you need bro
id-daemon
Posts: 1040
Joined: Sun Mar 22, 2015 7:09 pm

Re: .gin and .abk sound formats (Need for Speed mw 2005)(help)

Post by id-daemon »

I tried installing locomotive engine onto WV Golf. That was fun, yet you can hear when 3 parts of speedup sound overlaps, they must be accurately adjusted or you get phase artifacts like these.

p.s. can you describe which samples you replaced, and give me your wav files?
V12-POWER
Posts: 71
Joined: Thu Jul 02, 2015 10:43 pm

Re: .gin and .abk sound formats (Need for Speed mw 2005)(help)

Post by V12-POWER »

id-daemon2 wrote:I tried installing locomotive engine onto WV Golf. That was fun, yet you can hear when 3 parts of speedup sound overlaps, they must be accurately adjusted or you get phase artifacts like these.

p.s. can you describe which samples you replaced, and give me your wav files?


sure, I use rfactor sounds as I have them at hand. I replaced the 2 off throttle samples, replaced the 2 on throttle samples and then the idle sound which is the one that works the most. the number of the samples is 6 for high rpm on throttle, 3 for high off throttle, 1 for idle, 2 and 4 for low rpm off and on throttle. I did cut parts of these files to match the original sizes.

the attached file lacks the veryhigh sample, which is attached in my post above

edit: the locomotive sounds awesome!