Find the hash code for a specific .wav sound file in sounds.dat54.rel and game.dat151.rel
I'm about to create my own dlc engine sound mod for a 90s Chevy Suburban SLE that replaces the landstalker. Since I'm a complete newbie in sound modding or modding in general, I followed the guides provided by @a63nt-5m1th to create my own dlc engine and link it to the landstalker. Thanks to those instructions I was able to get the mod to work on a basic level. There is still a lot of adjustment left to do but I'm happy to see how far I was able to go so far.
However, there's one really weird thing that I noticed when I first created the mod based on the vanilla landstalker engine (suv_1_eur_v6): Next to the regular sound files like ENGINE_ACCEL, ENGINE_IDLE ..., I found some strange sound files in the .awc that seemed completely out of place (DIGGER_LIFTER.wav and DIGGER_STOP.wav). They were never audible in the vanilla game when using the landstalker. But with my own engine sound mod, they suddenly just appear in game when revving up the engine in a seemingly random sequence.
I removed those sound files from my dlc engine mod files but since I used the landstalker game.dat151 and sounds.dat54 lines for my own dlc engine, there could still be a link to those wav files in a vanilla file. Now, I want to investigate which part of the game.dat and sounds.dat is responsible for playing these files when I rev up my engine in game, but in order to do so, I need to find the hash code for those two weird DIGGER_LIFTER and DIGGER_STOP.wav files.
Is there a way to simply do a backwards search with the names of these .wav files to find their hash codes? Or in other words, how can I decode the hashes used in the .rel files?
Thanks a million and cheers!
Yeah, you can reverse lookup those. You can go from English etc words to hashes no problem.
Just so you know, going the other way, hash to words, is pretty impossible (without brute forcing them), unless there is some sort of naming structure/strategy that Rockstar use that allows you to guess at what it might be & test out your guesses to see if you get the correct hash back etc.
So, converting all the hashes in the '.rel.xml' to words would be a pretty big & time consuming job (without using some sort of brute force script & word file at least).
Also worth noting, if you start converting hashes to words inside the files, is that CodeWalker or the game (not sure) converts words to hashes on import, unless those names are included in a nametable file, so either, create/edit & keep updated a nametable file or always keep backups outside of the game of what you are working on & work in those files rather than working on fresh files exported from the game each time you edit/change something from hash to words (otherwise you will lose any words you have converted from hashes each time you import/export the file etc. ie they will revert back to being hashes the next time you look in the '.rel.xml' file & any hash>words conversion you have done previously will be lost).
If you don't manually convert hashes to words inside your files, you can ignore that last paragraph.
In this case:
DIGGER_LIFTER = hash_49055D7E
DIGGER_STOP = hash_4EB68F58
You can use the Hash Generator in OpenIV ('Tools' tab > 'Hash Generator') to convert from words to hashes:
You then take the resultant hashes:
remove the '0x' from the start of them & replace it with 'hash_' to convert them to the format the game uses (or just search for the last 8 digits):
These are the parts in the 'sounds.dat54.rel.xml' file that reference those hashes:
<Item type="SimpleSound"> <Name>hash_E98E1426</Name> <Header> <Flags value="0x00008000" /> <Category>vehicles</Category> </Header> <ContainerName>streamed_vehicles_granular/suv_1_eur_v6</ContainerName> <FileName>hash_49055D7E</FileName> <!-- *** here...*** --> <WaveSlotNum value="0" /> </Item> <Item type="SimpleSound"> <Name>hash_E18C2036</Name> <Header> <Flags value="0x00008000" /> <Category>vehicles</Category> </Header> <ContainerName>streamed_vehicles_granular/suv_1_eur_v6</ContainerName> <FileName>hash_4EB68F58</FileName> <!-- ***...& here *** --> <WaveSlotNum value="0" /> </Item>
If you remove/disable those lines/sections the 'DIGGER_LIFTER/DIGGER_STOP' sounds will be disabled for all vehicles that use the 'suv_1_eur_v6.awc' (10 vehicles in the base game, couldn't find any in dlc's). Depends on whether that is important to you or not, & whether any actually exist, but one way to avoid that would be to create your own '.awc' & direct your Landstalker etc to that instead. Then you're free to edit it however you like without affecting any other vehicles.
Alternatively, if you find the vehicles that use 'suv_1_eur_v6' (as mentioned, 10 in base game files, doesn't appear to be any others in dlc's, but maybe) & need the 'DIGGER_LIFTER/DIGGER_STOP' sounds working (if there actually are any) & then change the engine sound they use to another vehicle that has the 'DIGGER_LIFTER/DIGGER_STOP' sounds included also, it wouldn't be an issue (there are 4 '.awc's in the base game that include the 'DIGGER_LIFTER/DIGGER_STOP' sounds, including 'suv_1_eur_v6', see below, possibly more in dlcs, but I didn't find any, so pretty sure it's just the 4 listed below).
Base game '.awc's that use the 'DIGGER_LIFTER/DIGGER_STOP' sounds:
- box_van_1.awc (vehicle 'audioNameHash's: 'mule3', 'riot', 'stockade', 'stockade3'... & 10 others)
- rig_2.awc ('cutter', 'docktug', 'dump', 'mixer2'... & 17 others)
- saloon_4_eur_4cyl.awc ('rebel', 'ratloader')
- suv_1_eur_v6.awc ('crusader', 'rebel2', 'sandking', 'sandking2', 'cavalcade', 'cavalcade2', 'landstalker', 'rancherxl', 'rancherxl2'... & one other, but that last one appeared to lead nowhere, just a 'VehicleEngineGranular' section on it's own, not attached to any specific vehicle name)
Barring the 'cutter/dump/mixer/mule' etc industial/delivery vehicles (& they don't use 'suv_1_eur_v6.awc' anyway), it looks like most of those vehicle's listed probably don't need the 'DIGGER_LIFTER/DIGGER_STOP' sounds. You may well be safe to completley disable them for 'suv_1_eur_v6' & then, if you have any issues in future, change the 'audioNameHash' to 'cutter/docktug/dump/mixer2' etc for any vehicle's you might find down the line that use 'suv_1_eur_v6' & do need them (if any exist, doesn't look like it to me tho, think you're safe to remove/disable those '<Item type="SimpleSound">' sections (in the codeblock example above) ).
Alright, thanks for those detailed instructions! I really appreciate that help. Also thanks for your hint about the hash mechanics. All of the hashes that I changed for my dlc engine are included in the nametable. I just checked that again to see if I might have missed something but all the hashes I replaced with my own words are found in the nametable.
@a63nt-5m1th said in Find the hash code for a specific .wav sound file in sounds.dat54.rel and game.dat151.rel:
but one way to avoid that would be to create your own '.awc' & direct your Landstalker etc to that instead. Then you're free to edit it however you like without affecting any other vehicles.
Well, here's the strange thing. When I followed your guide for creating an custom dlc engine, I already created my own .awc and also linked that engine to the landstalker in the vehicles.meta already. In the dlc sounds.dat and the dlc game.dat for my engine I didn't include any code lines that would directly link to any of those DIGGER sounds.
Just to make sure, I tried to disable the respective code lines in the vanilla sounds.dat leading to the digger sounds, but unfortunately even after doing that the issue persists and the digger sounds appear when driving the landstalker.
So, somewhere in the lines for my dlc engine, either in my dlc game.dat or my dlc sound.dat there must be hidden link to those sounds somewhere. When checking the hashes in my dlc game.dat, parts of the 'VehicleEngine' section are linked to the muscle_car_3.awc but I don't really think that this could be the problem since we didn't find those sounds there.
I'm getting really confused at this point since I only have a limited overview of the links between all the different .rel files and .awc's.
Upload your dlc engine add-on somewhere like https://www.mediafire.com/ & send me the link & I'll download it & take a look. I would have thought there should be ways to avoid whatever it's doing to utilize those sounds
Try these edited '.oac's. So basically, export your 'chevroletv8/chevroletv8_npc' '.awc's to openformats & then replace the '.oac's with the ones in the download (or if you have an extenal copy of them, just replace those '.oac's instead etc) & then reimport them back into OpenIV using drag & drop & test the result ingame.
I think that should be them fixed, I noticed references in the '.oac' files to 'DIGGER_LIFTER' & 'DIGGER_STOP' & removed them before testing anything (Note: you can open & edit '.oac's with any text editor. Right-click > 'Open with' > Notepad++ etc) & the engine sound ingame works 100% correctly & those digger sounds don't appear for me. Test it out & let me know & if you're still having issues I'll investigate further.
Yes, as you said, the sounds don't appear in-game anymore when using the landstalker after having replaced the .oac files with your edited ones! Thanks a million for editing the .oac's for me. I never even thought about the option to edit the .oac directly but removing the lines of code there really was the solution. Now I can finally move ahead with actually modding the engine sound since the audio files I used for the engine so far were only quickly edited test files. Finally getting rid of these strange files is a big relief!
Thanks again for providing all this help here!
No probs bud, glad it worked