[ Tutorial ] - How to change the pitch/frequency of a vehicle's engine (min, max & idle)
For this you are going to need a copy of:
- Codewalker - Get a new version from the Codewalker Discord as the one on this site (v.29) is 2.5 yrs out of date & will not allow you to export '.rel' files to XML.
- A Text Editor of choice (Notepad will do, but there are many advantages to using something a little more advanced like Notepad++)
DLC Vehicle Sounds:
I'll outline the process for the files containing the info for the main body of non-dlc GTA V vehicle engine sounds. For the DLC vehicles, all you have to do is follow the same process, but instead use the DLC counterpart files. They are all named similarly & easy to find in any DLC using OpenIV's Ctrl+F3 search box (see 'Finding DLC '.rel' Files:' at bottom of post).
Export 'game.dat151.rel' & 'sounds.dat54.rel' files to '.xml' Using Codewalker's RPF Explorer:
- Start up Codewalker & select '[<<]' (top right) > '[Tools...]' > 'RPF Explorer...'
- Wait for the 'RPF Explorer' to load fully (will say 'File cache loaded' bottom left) & then navigate to:
Note: ...\mods\update\ update.rpf \x64\audio\config (Not '...\mods\x64\audio\audio_rel.rpf\config')
- Once there, highlight the 'game.dat151.rel' & 'sounds.dat54.rel' files using Ctrl+left-click.
- Right-click on one of the files & select 'Export XML... Ctrl+S' & select a folder location to export the files.
Search the 'game.dat151.rel.xml' file for a Vehicle Name:
- Open both the 'game.dat151.rel.xml' & 'sounds.dat54.rel.xml' files with a Text Editor & then move to the 'game.dat151.rel.xml' file.
- Hit 'Ctrl+F' & use the search box to search for a vehicle name.
- Once you've found the vehicle, it should look something like this:
<Item type="Vehicle" ntOffset="369587"> <Name>rocoto</Name> <!-- vehicle name here --> <Unk00 value="0x90005A68" /> <Engine>hash_77F193EC</Engine> <EngineGranular>hash_9A96C7AD</EngineGranular> <Horns>hash_134DA50D</Horns> <DoorOpen>hash_1D48FFC4</DoorOpen>
Just a word of warning, the three sections ('Vehicle', 'VehicleEngine' & 'VehicleEngineGranular') do not have to be next to each other (they usually are, just 'VehicleEngine' & 'VehicleEngineGranular' swapped around sometimes), but the connections between the three sections are formed by the name/hashes directly under the 'Vehicle', 'VehicleEngine' & 'VehicleEngineGranular' lines, not their order in the file.
For the most part, you'll probably find the right sections just under each other, but if for some reason that doesn't work or you prefer to confirm beforehand, use the 'Troubleshooting:' post below this one to be sure you have the right three linked sections.
Right, back to the tutorial:
- From the vehicle name, navigate down one or two sections (it varies), until you find the next 'VehicleEngineGranular' line, like this:
<Item type="VehicleEngineGranular" ntOffset="369608"> <!-- This line --> <Name>hash_9A96C7AD</Name> <Unk00 value="0xAAAAA905" />
- Four lines under the 'VehicleEngineGranular' line you will find a '<EngineAccel>' line
- Copy whatever hash is in the '<EngineAccel>' line (in this case 'hash_4173DD5C'):
<Item type="VehicleEngineGranular" ntOffset="369608"> <Name>hash_9A96C7AD</Name> <Unk00 value="0xAAAAA905" /> <MasterVolume value="0" /> <EngineAccel>hash_4173DD5C</EngineAccel> <!-- copy the hash_######## part of this line --> <ExhaustAccel>hash_A5C6E3AA</ExhaustAccel> <Unk04 value="0" /> <Unk05 value="0" />
Find the 'UnkVecData' Values in 'sounds.dat54.rel.xml' to Edit the Engine Pitch:
- Now proceed to the 'sounds.dat54.rel.xml' file.
- Search for the 'hash_########' value you just copied from the 'game.dat151.rel.xml' file & you will usually find a few (2 or 3) results.
- Navigate to the 'hash_########' result just under the '<Item type="GranularSound">' line.
- From there, scroll down until you find the next '<UnkVecData>' line (usually about two pages).
- The first two values under the '<UnkVecData>' line are the engine & exhaust pitch minimum (left value) & maximum (right value).
- The next two values (usually the same) are the engine & exhaust idle pitch.
<UnkVecData> 10.47, 57.76 <!-- Engine & exhaust min & max pitch --> 15.75, 15.75 <!-- Engine & exhaust idle pitch--> </UnkVecData>
After you make your edit/s, save the file & reimport it back into the game where you got it using Codewalker's RPF Explorer.
To get 'Import XML... Ctrl+Ins' to appear, hit the '[ Edit mode]' button (top, middle, right) & confirm entering edit mode by hitting '[Yes]'.
Then right-click within the folder > 'Import XML... Ctrl+Ins' & select your edited '.rel.xml' files
File icons in the RPF Explorer for the files you are importing will turn dark for a moment until the import is complete.
There are two sets of 'UnkVecData' values for each engine sound, one for the player vehicle & another in the next '<Item type="GranularSound">' section, for the 'STREAMED_VEHICLES_GRANULAR_NPC.rpf' npc vehicles (ie the sound npc vehicles make when they drive past you)
Ideally, you probably want to edit both at the same time. They are not always the same values, so you may have to experiment to see what sounds best.
After that, save the file & then reimport the it back into the game where you got it, using Codewalker's RPF Explorer's right-click > 'Import XML... Ctrl+Ins'
Finding DLC '.rel' Files:
DLC 'game.dat151.rel' & 'sounds.dat54.rel' files are prefixed with their dlc name. Like 'dlcjanuary2016_game.dat151.rel' & 'dlcsmuggler_sounds.dat54.rel' for example.
Alternatively, searching for 'game.dat151.rel' or 'sounds.dat54.rel' will show all of those files & their locations in the game, allowing you to select the ones you want.
How the Three Sections are Linked:
The 'Vehicle', 'VehicleEngine' & 'VehicleEngineGranular' sections do not have to be next to each other (they usually are, just 'VehicleEngine' & 'VehicleEngineGranular' swapped around sometimes), but rather than their position/order in 'game.dat151.rel', the connections between the three sections are actually formed by the names & hashes directly under the 'Vehicle', 'VehicleEngine' & 'VehicleEngineGranular' lines.
<Item type="Vehicle" ntOffset="362535"> <Name>vigero</Name> <Item type="VehicleEngine" ntOffset="362542"> <Name>hash_E03115BB</Name> <Item type="VehicleEngineGranular" ntOffset="362556"> <Name>hash_33290B6F</Name>
Format of Three Main Names/Hashes:
They are in this format:
<Item type="Vehicle" ntOffset="362535"> <Name>vigero</Name> <!-- format = 'vehiclename' --> <Item type="VehicleEngine" ntOffset="362542"> <Name>vigero_engine</Name> <!-- format = 'vehiclename_engine' --> <Item type="VehicleEngineGranular" ntOffset="362556"> <Name>vigero_granular_engine</Name> <!-- format = 'vehiclename_granular_engine' -->
& from that (once you know the format of a value ('vehiclename_engine' &/or 'vehiclename_granular_engine' etc ), you can use OpenIV's Hash Generator ('OpenIV' > 'Tools' > 'Hash Generator') to confirm you are editing the right ones.
So, say we want to confirm we are editing the correct vigero sections, we would first:
- find vigero in the 'game.dat151.rel.xml' file
- then scroll down to find the next 'VehicleEngine' line:
<Item type="VehicleEngine" ntOffset="362542"> <Name>hash_E03115BB</Name>
- make a note of the hash below it ('hash_E03115BB'. The 'E03115BB' part is the part you want)
- then move to OpenIV's Hash Generator ('OpenIV' > 'Tools' tab > 'Hash Generator')
- Input 'vigero_engine' in the left box
- Change the 'Output format:' (bottom leftish) to 'Hex'
- Then compare the generated hex hash on the top right, (in this case '0xE03115BB') with the one below the 'VehicleEngine' line we made a note of earlier.
- As you can see they end with the same characters/digits ('E03115BB')
- If the last 8 digits of the hashes do not match, you are editing the wrong section for that vehicle & would need to look at another 'VehicleEngine' section hash & check that in the same way.
- You would use the same process to check the 'vigero_granular_engine' (aka 'hash_33290B6F') section name as well.