Log in to reply
 

How do you add a turbo sound to an engine sound?



  • How do I add a turbocharger to an engine sound? I'm talking like... without the need to slap a turbocharger on as a tuning option. Some sounds in the game come turbocharged by default, and sometimes putting on one via tuning will change the BOV or something.

    Anyways, how can I achieve this for engine sounds that don't come with a turbo?



  • @mrwallace888
    Have you tried adding one of these into the vehicle's 'game.dat151.rel/.rel.xml'?

       <Turbo>hash_E159A100</Turbo>
    
       <Turbo>hash_943127C0</Turbo>
    
       <Turbo>hash_11CD1928</Turbo>
    
       <Turbo>hash_D7E28E12</Turbo>
    
       <Turbo>hash_F4BC47C5</Turbo>
    
       <Turbo>hash_90084437</Turbo>
    

    It will be a similar process to the one used in your bomb bay doors thread.

    Note:
    I haven't tried this, but there is a good chance it will work. As always, make backup/s first.

    Basically:

    • Export the correct (see 'Finding DLC '.rel' Files:' in link below if editing dlc vehicles) 'game.dat151.rel' from the game using CW's RPF Explorer's 'Export to XML...'
    • Open '.rel.xml' with text editor of choice
    • Search for vehicle name
    • Once found, scroll down & in the 'VehicleEngine' section for that vehicle, you will find the '<Turbo>' line (probably this '<Turbo>null_sound</Turbo>')
    • Edit the line to one of the above hashes

    More detailed & similar info in this tutorial if you need it :thumbsup:



  • @a63nt-5m1th Do these different hashes have different sounds/effects?



  • @a63nt-5m1th It worked. I used the Elegy Retro Custom's turbo and dump valve sounds. While you're here, I need to know another thing, how can I replace engine sounds correctly for rel files?

    I needed to know this question regarding turbos so I can make the (Vanillaworks) Annis Euro's engine sound be turbocharged. But I also liked the naturally aspirated version (default), since it sounds similar to a 350z engine. So I wanted to make the ZR380's actual audio (rather than just the audio hash in the vehicles.meta, I'm talking the actual rel files) the naturally aspirated Euros sound. What I tried doing was replacing sections of lines in the rels that had the ZR380 stuff in the 151 and 54 rel files with the lines from the Euros rel files (basically just copy/pasting sections). However, doing this has resulted in the ZR380 being dead silent. Not even sounds from tire skids and offroading and stuff.



  • Or instead, is it possible to make a copy of a Euros and its audio?

    I've messed with files in the past to change a model's spawn name and stuff, or its audio name hash in the vehicles.meta. But it mostly just involves me finding every instance in the .rpf of files named with that model or mentions of the name in text files and adding a "2" to it or whatever else I'm changing. So I can do that part.

    But how can I do the same with an audio rel? How can I clone it so that there's a separate "Euros 2" sound basically that's the naturally aspirated version? I can probably set the audio name hash on the ZR380 to it in the vehicles.meta if I could do this.



  • @mrwallace888
    I'm in the middle of sussing out what can be done with '.rel' files the now & it's all pretty new, so don't know everything yet & also, this post is likely to be a bit of a 'anything & everything that might help at some point' kinda post lol. Ignore anything you know already, I write a lot of my posts for the next guy that might come along & read it looking for the same info etc, so forgive me if I ever appear patronising, just covering all the bases :thumbsup:

    @mrwallace888 said in How do you add a turbo sound to an engine sound?:

    Do these different hashes have different sounds/effects?

    Probably slightly different, I haven't actually tested, just thought it would work :thumbsup:

    @mrwallace888 said in How do you add a turbo sound to an engine sound?:

    how can I replace engine sounds correctly for rel files?

    The easiest way is to edit the:

       <EngineAccel>hash_4173DD5C</EngineAccel> 
       <ExhaustAccel>hash_A5C6E3AA</ExhaustAccel>
    

    lines in 'game.dat151.rel.xml' to the 'hash_#######' of a different vehicle, but without editing the 'Vehicle', 'VehicleEngine' & 'VehicleEngineGranular' section values, some of them anyway, I guess not all choices of vehicle engine sound will sound right/good/same as original.

    Note:
    There are also hidden audio flags to contend with, possibly uneditable ones (not 100% sure on that), meaning it might not always be possible to swap engine sounds from one car to another & have them sound identical.
    I'm still investigating that part.

    I know for a fact tho, that all the '<ContainerName>' lines for any one ''<Item type="GranularSound">'' section (in 'sounds.dat54.rel.xml') need to be the same, you can not mix & match lines from different '.awc' files or you will get a silent engine in-game:

    Example (broken = silent engine in-game):

      <Item type="GranularSound">
       <Name>hash_4173DD5C</Name>
       <Header>
        <Flags value="0x00208001" />
        <Flags2 value="0x9555AAAA" />
        <Category>hash_F7C35252</Category>
        <Unk18 value="150" />
       </Header>
       <WaveSlotIndex value="0" />
       <Wave1>
        <ContainerName>streamed_vehicles_granular/muscle_car_2_us_v8</ContainerName> <!-- This 'muscle_car_2_us_v8' here will cause silent engine in-game. It needs to be 'sportscar_4_eur_4_cyl' like the rest -->
        <FileName>engine_accel</FileName>
       </Wave1>
       <Wave2>
        <ContainerName>streamed_vehicles_granular/sportscar_4_eur_4_cyl</ContainerName>
        <FileName>exhaust_accel</FileName>
       </Wave2>
       <Wave3>
        <ContainerName>streamed_vehicles_granular/sportscar_4_eur_4_cyl</ContainerName>
        <FileName>engine_decel</FileName>
       </Wave3>
    

    I had the rest of the sounds, just the engine & exhaust was silent, but there might be other prerequisites in other values that cause them to be silent too.

    @mrwallace888 said in How do you add a turbo sound to an engine sound?:

    How can I clone it so that there's a separate "Euros 2" sound

    Duplicating the 'Vehicle', 'VehicleEngine' & 'VehicleEngineGranular' sections & creating renamed clones would be where I would start (sounds like that is what you're doing :thumbsup:).

    Note:
    Be careful to copy the correct ones, they 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 (just so you are aware)

    You can, however, use OpenIV's Hash Generator ('OpenIV' > 'Tools' > 'Hash Generator') to confirm you have the right ones.

    They are in this format:

    Example:

      <Item type="Vehicle" ntOffset="362535">
       <Name>vigero</Name> <!-- 'vehiclename' -->
       
      <Item type="VehicleEngine" ntOffset="362542">
       <Name>vigero_engine</Name> <!-- 'vehiclename_engine' -->
       
      <Item type="VehicleEngineGranular" ntOffset="362556">
       <Name>vigero_granular_engine</Name> <!-- 'vehiclename_granular_engine' -->
    

    So, say we want to confirm the three vigero sections, we would first

    • find vigero in the 'game.dat151.rel.xml' file
    • then scroll down to find the next 'VehicleEngine' line
    • 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 &
    • 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')
    • You would then do the same for 'vigero_granular_engine' (aka 'hash_33290B6F')

    Note:
    If generating more than one name to hex hash one after the other, after the first one you need to hit the '[Generate]' button (bottom rightish) to get the hex hash to refresh on the right (it's only automatic on the first attempt) :thumbsup:

    Caveat:
    The only trouble with this method, is you need to know the English character format ('vehiclename_granular_engine' etc) of the 'hash_#######' value before you can double-check it (I'm not sure there's a reliable way to go from 'hash_#######' to written words directly, none I have discovered anyway).

    Luckily tho, some vehicles have certain stuff written with the correct names ('tampa' for example has some stuff in plain English) that you can grab the correct format from.

    Your silent vehicle issue:
    After you create duplicates of the 'Vehicle', 'VehicleEngine' & 'VehicleEngineGranular' sections of the 'euros2', you want to make sure you change the three main 'name/hash_#######' values of the duplicates to the name of the vehicle you are adding the sounds to (they can also be put in using the English names, they don't have to be converted back to hashes once you've translated the format etc).

    Example:

      <Item type="VehicleEngineGranular" ntOffset="362556">
       <Name>hash_8F9C9E95</Name> <!-- aka '<Name>euros2_granular_engine</Name>' -->
    

    would become:

      <Item type="VehicleEngineGranular" ntOffset="362556">
       <Name>hash_81CE67AE</Name> <!-- aka '<Name>zr380_granular_engine</Name>' -->
    

    OR

      <Item type="VehicleEngineGranular" ntOffset="362556">
       <Name>zr380_granular_engine</Name> <!-- aka '<Name>hash_81CE67AE</Name>' -->
    

    There might be other hashes to be translated, aside from the main 'Vehicle' (always in English afaik, so just change the name), 'VehicleEngine' & 'VehicleEngineGranular' ones, but those are the main ones & I reckon there's a good chance most, if not all, of the sounds will work if you edit them correctly.
    As a rule of thumb, if you search for a 'hash_#######' in the 'sounds.dat54.rel.xml' files & can find it there, it doesn't need to be translated in the 'game.dat151.rel.xml' file & will work on any vehicle.

    I'm going to have a look at translating as much as I can of the format of the 'Vehicle', 'VehicleEngine' & 'VehicleEngineGranular' sections the now, see what turns up :thumbsup:



  • Do I have to go in and change anything in the dat and nametables besides the filename? Is there a way to do so if I have to?



  • I just went in and changed every filename and every thing in the files that had "euros" in it and changed it to "euros2".

    Adding the euros2 folder to my dlclist, it says it's an invalid model if I try to spawn it, and it doesn't show up in Menyoo.



  • @mrwallace888 said in How do you add a turbo sound to an engine sound?:

    Do I have to go in and change anything in the dat and nametables besides the filename? Is there a way to do so if I have to?

    I'm not sure, I haven't got that far :slight_smile:.
    I'm updating three tutorials & various other posts as & when I find info that's relevant.
    Just been taking my time with it & making sure everything is as correct & detailed as possible (7 days ago, I didn't even know '.rel' files existed, this is all totally new to me, love this sort of stuff tho :slight_smile: :thumbsup:)

    @mrwallace888 said in How do you add a turbo sound to an engine sound?:

    changed every filename and every thing in the files

    That was possibly overkill. Are we still talking audio '.rel' files or other files now as well?
    I presumed you had the euros2 installed & working & just wanted to change the audio, correct?



  • @a63nt-5m1th Well I haven't tried cloning a DLC before. Usually I've just changed the name of everything to match like I mentioned and it works (I had a dlc called 68mustang and I changed the filenames and their contents to say mustang68 instead, forgot what I did it for though). But I tried doing that same method by creating a copy of the dlc and then just doing that process, and then adding the new copied dlc to the list. Unfortunately, that didn't seem to work. Also, when the dlc was enabled, something must've conflicted because then the audio for the regular Euros didn't play (except for everything else like tire skids, the turbo I added, etc.)



  • @mrwallace888
    If you link to the original euros add-on download & then upload your 'dlc.rpf' to somewhere like Mediafire etc, I'll download it & take a look if you like?



  • Sure thing. I've got a Dropbox. By the way for the .nametables, what I also tried doing was trying to open it with Notepad++ (it shows NUL for the periods for some reason but it still worked, even when I saved it still showed the periods in the hex viewer so eh). Don't know if that made a difference.
    Here's the original modpage.

    And here's my Dropbox. The "euros" folder is the one I modified, just giving it a turbo. "euros2" is the standard one, that I tried to modify to act as a cloned DLC.



  • @mrwallace888
    euros2 dlc 'vehicles.meta':

    <?xml version="1.0" encoding="UTF-8"?>
    <CVehicleModelInfo__InitDataList>
      <residentTxd>vehshare</residentTxd>
      <residentAnims />
      <InitDatas>
        <Item>
          <modelName>euros</modelName>
          <txdName>euros</txdName>
          <handlingId>EUROS</handlingId>
          <gameName>EUROS</gameName>
    

    Notice anything?

    I haven't tested the cars yet, just looking through files & noticed this.
    That will defo stop a car spawning tho :thumbsup:

    Edit:
    Cars tested, euros spawns & has sound, euros2 spawns, but has no engine/exhaust sound.
    I'll take a look at that the now.



  • Pretty sure I replaced all the Euros in the vehicles meta with Euros2



  • @mrwallace888
    It happens.
    euros2 loaded on it's own (without euros installed) works & has engine & exhaust sound :thumbsup:
    So yeah, defo some sort of audio conflict between the two of them somewhere :thumbsup:



  • @a63nt-5m1th So when you loaded Euros1, it had a turbo, right? And the second didn't?



  • @mrwallace888
    I have the turbo & dump valve sounds muted in my game atm so couldn't check that.
    Going by the '.rel's tho, that's how I would imagine it to work, yeah, I didn't see anything obviously wrong with the turbo setup :thumbsup:

    Edit:
    Actually, it looks like euros has turbo & dump valve & euros2 has turbo ('hash_36E13C1E'), but no dump valve (just going by the '.rel's)



  • @a63nt-5m1th Yeah the jester intake. It's not a turbo, probably just a sort of supercharger?



  • @mrwallace888
    Messing about with the '#####_game.dat151.rel.xml' files randomly I've got either to work, but never at the same time so far. One always has a silent engine & exhaust. :thinking:

    Edit:
    Noticed another small error, doesn't change anything to do with the sound or anything vital, but:

    ...\mods\update\x64\dlcpacks\euros2\dlc.rpf\x64\vehicles.rpf\euros_hi2.yft

    should be:

    ...\mods\update\x64\dlcpacks\euros2\dlc.rpf\x64\vehicles.rpf\euros2_hi.yft



  • Oh I didn't notice that lol.



  • @mrwallace888
    euros2 'carvariations.meta' - check the vehicle name:

    <?xml version="1.0" encoding="UTF-8"?>
    
    <CVehicleModelInfoVariation>
      <variationData>
        <Item>
          <modelName>euros</modelName>
          <colors>
            <Item>
              <indices content="char_array">
    

    I swapped the euros & euros2 audiohash lines around in the 'vehicles.meta's. Seems like euros sound works on both & euros2 sound doesn't work on either. So, presumably, something wrong with euros2 '.rel's or sound setup somewhere.



  • I don't really care about the car lol, just the sound. And since people have made add-on sounds I wonder if we can just convert the sound itself to an addon like what SKypilane does with his sounds so I could set it as the audio hash in the vehicles.meta



  • @mrwallace888
    It's obviously possible, given others have done it, just have to work through all the prerequisites & see what can & can't be done until we know the rules.
    It's similar to what I'm working on, I love reverse engineering things, so taking my time & making sure I know everything there is to know about what the files can & can't be used for. :thumbsup:


  • Banned

    @mrwallace888 to make an add on sound would be the same as replacing a current sound. Try as I could, I couldn't get the game to recognize new sounds because of how the hash works. The add on sounds on here are just copy and paste of other rel files. So without a way to generate new hashes for new audio, the add on sounds are just rel edits of existing vehicles just placed in their own DLC pack. A way of replacing audio without touching thd original audio, just rerouting the directories to new files.

    I think you had it right with just adding the turbo sounds, but if I read that right you copy pasted the whole section overwriting the cars original hashes with the ones you copy pasted?




Log in to reply
 

Looks like your connection to GTA5-Mods.com Forums was lost, please wait while we try to reconnect.