Engine startup sounds

Discussion in 'Content Creation' started by SlickNick924, Jan 20, 2020.

  1. SlickNick924

    SlickNick924
    Expand Collapse

    Joined:
    Aug 19, 2018
    Messages:
    332
    Ok, so I am editing the s550 mod by @Tsutarja495 so that the i4 and v6 have their engine sounds and startups restored from the previous version. When I first started, I didn't yet change the sfxBlend2D file, so they worked as long as the new s550.zip was accompanied by the old 1517mustang.zip file. However, it works independently now. My remaining problem is that the startup sounds only work if the lines shown below are in the mainengine sections of the engine jbeam and s550.zip is accompanied by 1517mustang.zip.

    "starterSample" : "s42_starter",
    "starterVolume" : 1.0,

    I tried to make it work with the current version of BeamNG independently of the old file with this:

    //starter motor
    "starterSample":"s550:>art>sound>starter>s42",
    "starterSampleExhaust":"s550:>art>sound>starter>s42.ogg",
    "shutOffSampleEngine":"event:>Engine>Shutoff>i4_2001_eng",
    "shutOffSampleExhaust":"event:>Engine>Shutoff>i4_2001_exh",
    "starterVolume":7.00,
    "starterVolumeExhaust":6.0,
    "shutOffVolumeEngine":2.0,
    "shutOffVolumeExhaust":1.36,
    "starterThrottleKillTime":0.6,
    "idleRPMStartRate":2,
    "idleRPMStartCoef":1,

    I think my problem is with the startersample file location. For reference, the sound files are in s550.zip/art/sound/starter. I have no idea how to set the file path for this in the jbeam. I have tried many different approaches to this but the startup sounds refuse to work, although the shutoff sounds located somewhere in the vanilla game work fine. Any help is appreciated.
     

    Attached Files:

  2. naguluna

    naguluna
    Expand Collapse

    Joined:
    Aug 31, 2013
    Messages:
    345
    this "starterSample":"s550:>art>sound>starter>s42",

    should be "starterSample":"file:>art>sound>starter>s42",

    if you are using an fmod event (not sure how to yet) use "event:->->->"

    if you are using a file use "file:>->->"

    i sometimes have problems when using custom sound with volume and stuff
     
  3. SlickNick924

    SlickNick924
    Expand Collapse

    Joined:
    Aug 19, 2018
    Messages:
    332
    Thanks for responding, but even with these changes, nothing happens. I've turned the volume for the starter motor up, but still nothing

    //starter motor
    "starterSample":"file:>art>sound>starter>s42.ogg",
    "starterSampleExhaust":"file:>art>sound>starter>s42.ogg",
    "shutOffSampleEngine":"event:>Engine>Shutoff>i4_2001_eng",
    "shutOffSampleExhaust":"event:>Engine>Shutoff>i4_2001_exh",
    "starterVolume":7.00,
    "starterVolumeExhaust":6.0,
    "shutOffVolumeEngine":2.0,
    "shutOffVolumeExhaust":1.36,
    "starterThrottleKillTime":0.6,
    "idleRPMStartRate":2,
    "idleRPMStartCoef":1,
     
  4. NOCARGO

    NOCARGO
    Expand Collapse

    Joined:
    Apr 1, 2019
    Messages:
    1,514
    It should be this "starterSample":"file:>art/sound/starter/s42.ogg",
    or this "starterSample":"art/sound/starter/s42.ogg",
    same for exhaust of course :)
     
  5. SlickNick924

    SlickNick924
    Expand Collapse

    Joined:
    Aug 19, 2018
    Messages:
    332
    That worked! Another problem has arisen, however. I can't implement any loop sounds and the car tries to loop the starter sound. Also, when I shut the car off, my custom shutoff sound loops infinitely. How do I fix these issues?
     
  6. NOCARGO

    NOCARGO
    Expand Collapse

    Joined:
    Apr 1, 2019
    Messages:
    1,514
    https://www.beamng.com/threads/changing-soundfiles-with-fmod.67066/#post-1097688

    :)

    It's kinda complicated, currently the entire sound setup of the game is sort of fragmented all over the
    place. The more you 'visit' the same files the more you're able to understand what is going on.
    Sometimes rules (read code) are overridden by other rules in certain situations and then not and then
    yes and so on.. So you must find the right file were 'AudioDefaultLoop3D' is to be replaced by 'AudioDefault3D'
    for the sound in question. Hope this helps
     
    #6 NOCARGO, Jan 21, 2020
    Last edited: Jan 21, 2020
  7. SlickNick924

    SlickNick924
    Expand Collapse

    Joined:
    Aug 19, 2018
    Messages:
    332
    Thanks for the help! However, in the mustang file, there does not appear to be any lua in relation to audio that I can change. Also, from the example in your post, the line including AudioDefault3D is in a .cs file, or specifically audioProfiles.cs. It mentions to copy and paste the profile into the engine jbeam, but how would I define it as the ignition loop? Sorry for my lack of understanding jbeams, kind of new to this lol.
     

    Attached Files:

  8. NOCARGO

    NOCARGO
    Expand Collapse

    Joined:
    Apr 1, 2019
    Messages:
    1,514
    OK I'm only responding vague because I often do several things at the same time, hope you don't mind.
    If you found the profiles.cs you can start and try to change the profile of the sound in question from there. It's very likely that won't
    work because I found out that in the core file of the turbocharger the blow-off sound is set to 'AudioDefaultLoop3D'. The turbo
    has nothing to do with your starter of course but this points out that there are things not always set to right circumstances as I
    mentioned in post#6 :) The devs are kind enough to let us mod as much as possible, even before everything got sorted out for
    them, I guess :) Like if you visit the 'deprecated' wiki's sound section you will read that 'AudiDefaultLoop3D' is always to be set
    as default when you don't know what to use else but the other profiles aren't even listed or explained, even 'defaultloop3D' isn't
    really explained. Sound is very complicated to setup right, just as graphics are. I've been playing around with it and if you mess things
    up just a little, even the whole game acts weird as a consequence. Sorry for drifting off.. What I mean is that LUA is always the
    cause of looping or not looping the sounds, you just have to find in which file the setting is taking effect without overrides from
    other file settings. Okay now I got this far that I better check if can find your problem right ? Hold on :)

    Alright, so this line of text is to be found in the combustionEngine.lua (core file for engine)

    starterSoundEngine = obj:createSFXSource2(device.jbeamData.starterSample or "event:>Engine>Starter>Old_V2", "AudioDefaultLoop3D", "", device.engineNodeID, 0),


    This means that the games starter sound is looped for if the starter takes a longer time to start the
    engine. Your sample is probably not made to be set as a loop but just to play once. Thus the
    game goes looping your sample. Better is not to change the core file but to edit the sound sample
    itself, so it becomes 'loopable'.
     
    #8 NOCARGO, Jan 22, 2020
    Last edited: Jan 22, 2020
  9. SlickNick924

    SlickNick924
    Expand Collapse

    Joined:
    Aug 19, 2018
    Messages:
    332
    Again, thanks so much for helping! While your explanations are helping me to understand the arbitrary world of LUA in beamng, there simply does not seem to be any core engine file containing any lua in the s550 mod after searching through all possible directories. Also, I used audacity to convert sounds to .ogg and trim them so I have both an engine startup and rollover sound. Should I find the source code for the engine lua and modify it? Thanks
     
  10. NOCARGO

    NOCARGO
    Expand Collapse

    Joined:
    Apr 1, 2019
    Messages:
    1,514
    Well that's exactly what I explained in the previous post :D

    You don't find the lua in your mod because every engine is using the core file combustionEngine.lua .
    I showed you the text within :
    starterSoundEngine = obj:createSFXSource2(device.jbeamData.starterSample or "event:>Engine>Starter>Old_V2", "AudioDefaultLoop3D", "", device.engineNodeID, 0),

    Do you see the "AudioDefaultLoop3D" ? That's why your starter sample is looped. Good to see you're confident with Audacity because
    you will have to 'rhythm out' your sample so it becomes perfectly 'loopable' . If you take the 'loop' out of the code above (so that means changing the core file) then all the other starter sounds will be messes up and if you update the game the core file will be replaced again
    of course. :)
     
  11. SlickNick924

    SlickNick924
    Expand Collapse

    Joined:
    Aug 19, 2018
    Messages:
    332
    From what I am understanding, the game uses the same file for both the startup and turnover sounds and determines the part of the file that will be looped for the rollover? If so, that seems unnecessarily complex. Then how do I edit an ogg file for it to match the game's audio system? From what I can tell, the game's .bank files for audio are encrypted, so it is impossible to use them as an example.
     
  12. Diamondback

    Diamondback
    Expand Collapse
    Vehicle Systems Lead
    BeamNG Team

    Joined:
    Apr 8, 2014
    Messages:
    1,957
    You can't recreate our setup of starter sounds at the moment. The sounds are using fmod (and indeed the same event for the initial phase, the looped part and the outro), so this is not accessible to modders atm.
     
  13. SlickNick924

    SlickNick924
    Expand Collapse

    Joined:
    Aug 19, 2018
    Messages:
    332
    Oh, ok. Thanks for clearing things up everyone.
     
  14. NOCARGO

    NOCARGO
    Expand Collapse

    Joined:
    Apr 1, 2019
    Messages:
    1,514
    I have to be fair and say there is a workaround for this but that gets rather complicated !
    Nevertheless my prove is there , its to find in my new mod I'm working on, its waterproof and it doesn't hurt any other features
    of the game BUT that takes some moderate programming skills. :/
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice