New Sound JSON Files

Discussion in 'Car Modding' started by redapg, Dec 29, 2022.

  1. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,386
    Likes Received:
    6,602
    Hi @Devin , any chance you could help out here? What are the possible values for collisionType, and are there plans for more specific options in future?
     
  2. doddynco

    doddynco Registered

    Joined:
    Dec 13, 2017
    Messages:
    574
    Likes Received:
    1,217
    I gotta say that the whole crossfade and array stuff is a nice way to keep the already massive sound files a bit more reasonable in size. I've not used the replace feature for collisions though, but I will when I feel like subjecting myself to an onslaught of collision sounds.

    We could use that missing documentation for the events and variables. The spray variable is non-functioning (not hooked up to physics) and there are many other weird things going on with the variables. A big issue at the moment is that the ai and the external cam use their own variable system. So you might get the tyres to sound great for the player, but the ai / external cam will be silent. Not sure what to do about this yet and am waiting on the documentation to help.

    I'm hoping that soon they enable the spray variable as I'd really like to get wet tyre sounds sorted. I'm soo ready for that!
     
    Last edited: Feb 19, 2023
    Corti likes this.
  3. Devin

    Devin Member Staff Member

    Joined:
    Dec 30, 2011
    Messages:
    235
    Likes Received:
    189
    Currently it has the following options:
    • special
    • object
    • car
    • wall
    Presently we do not differentiate between different kinds of material of those objects though it seems like tyrewall triggers a car event while other types of wall trigger a wall event. Not sure if we did that for any specific reason though.

    The spray variable should be hooked up to physics. Try sprayAvg for average spray, or the typical sprayFL, sprayRF, etc... Not sure what we expose in the debugger window but it might be incorrect. Note some things aren't available for AI, or result in different variables, as AI use different tyre physics from the player. Sadly there's not much we can do about that at this moment
     
  4. Devin

    Devin Member Staff Member

    Joined:
    Dec 30, 2011
    Messages:
    235
    Likes Received:
    189
    I just realised I somehow managed to fail to read this thread, so let me just go and answer a few questions.
    That was not done intentionally. You could just copy the ones from inside and if you want to use the cone feature, give it a sensible cone, and that should do it. Same counts for any other missing events.
    The SFX volumes are mostly incompatible for two reasons actually:
    1. The SFX system actually caps those at a certain value. I believe it was either 2 or 3 but I'd have to check in code. Not sure why so many mods use numbers so much higher because it would have changed absolutely nothing with the old engine.
    2. The new sound engine uses a completely new rolloff which may default to something vastly different from the variables specified in SFX files. However, since the new system is different to begin with, even SFX mixes may sound very different from the old sound engine as they are highly dependent on their positions as well.
    It's also very important to note that effects and filters have to be tweaked per car in some cases as they have a huge effect on the sound stage and mix. So the position the sounds are coming from also really matters. I didn't check out the tool but ideally some way to specify whether the car is front- or mid-/rear-engined can help a ton here. That said obviously modders can just take care of that after conversion.
    Unfortunately there is no way to do this. This was a somewhat deliberate decision, as currently we are trying to heavily discourage any asset swapping in upgrades, as those tend to cause major issues when playing online. The idea brought up about just having a switch actually sounds like a somewhat decent option but then the game would have to load all possible samples for a vehicle even if it only uses one set of them at a time. That's not something we want to encourage either however, so I'm not sure whether that'll become a feature soon.

    From the dev guide (https://docs.studio-397.com/developers-guide/car-development/car-sounds/using-the-new-sound-engine):
    List of Events and Variables
    While the JSON Schema should automatically suggest a full list of events and variables available to use, a full list of available events and variables can always be found in the Sound Debugger window's dropdown menus.

    Event/Variable names should suggest what they represent. A more detailed list with full descriptions will be added here at a later date.​
    A full list of descriptions wasn't added yet as we tried our best to make the events' names explain themselves. Same for variables.
    The moddev debugger has the full up to date lists of both, and variables can be inspected in realtime in that window, whether they are being used or not.
    It's not an editor, but a debugger. It isn't meant to be able to edit them. The reason it has an "add"-button is so it doesn't have to display every possible thing at the same time, but you get to choose which variable or event to inspect or test. This allows you to play back events at given variables to test their mixes, and to reload everything during playback after editing the JSON file externally.

    As for editors, we don't have any. We actually do the mixes in external software, then write the JSON files by hand at the moment, using code editors with JSON schema support to basically "write" them for us so to say. We chose the JSON format however because that would make it relatively easy for ourselves and modders to write web editors for these files, ironically enough.

    As discussed in later posts, you need an event (either of type multibank or crossfade, whichever you prefer functionally) that reads the key collisionType. The sub-event of each of the names specified will be played back when the according object was hit. What's actually inside of the events doesn't matter for this to work in that sense, but ideally you can just copy the contents of an existing collision event as those are set up to use position and gain suitable for the collision.
    While the skippy uses a template event for this which copy pastes and renames some stuff, this is not necessary at all. We simply do it because it saves us about 5x as much typing.

    Please do feel free to ping me in case you have any further questions!
     
    redapg and Corti like this.
  5. redapg

    redapg Registered

    Joined:
    Jan 16, 2012
    Messages:
    4,008
    Likes Received:
    2,875
    @Devin Thank you very much for the detailed Reply!
    I must say, that i am no Coder or Programmer and so i have Problems to understand some Things, like, in this Case, the JSON Scheme.
    In the SFX it was easy.
    Simply said, you did have 1 Line and the Sound was defined. Done
    My main Problem, to write a kind of Web-Editor for the Sound JSON Files, is, that there are so many Braces ({ }), that i haven't found a working Method, to read out all Events in a usable Way, that they can be edited, new Ones added and unnecessary Ones removed, yet.
    When i have found a Method to do that, i probably will come back to you. :)
     
    Corti, McFlex and Devin like this.
  6. Chris Lesperance

    Chris Lesperance Registered

    Joined:
    Nov 29, 2012
    Messages:
    1,301
    Likes Received:
    2,068
    Thanks again for the updates! I'll be testing this a bit more. I am having an issue. I've converted 3 sounds. 2 of the 3 work. I need to work on the sound levels yet. But the third sound will CTD with the following message in the trace. Odd thing is that it loads in ModDev.

    728.40s vehgfx.cpp 774: Exited AdjustVehicleLiveryMaterials
    728.54s vehgfx.cpp 3271: Exiting VehGraphics::Init()
    728.54s slot.cpp 548: sound init
    728.82s main.cpp 358: onFatalError 22
    728.93s main.cpp 358: onFatalError 11

    Any ideas? @redapg if you need a link to the mod, let me know. Let me know if you need the packaged file or the ModDev folder.
     
  7. redapg

    redapg Registered

    Joined:
    Jan 16, 2012
    Messages:
    4,008
    Likes Received:
    2,875
    @Chris Lesperance That sounds strange, that a Sound File should cause the Error Messages onFatalError 22 and 11, even if i still don't know what they mean. :D
    Are you sure that it is a specific Sound File or a Sound File at all?
    Did you package it again and did use a renamed working Sound File, to confirm that it is that Sound File?
    (With a renamed working Sound File it should load, if the Sound File is the Problem.)
    If yes, yes, send me a Link to the rfcmp, that i can test that in the main Game.
    And i need to know which Sound File causes the Problem.
    You can send me the Link by private Conversation here or by Mail (you still should have my Mail Adress :))
     
  8. Corti

    Corti Registered

    Joined:
    Sep 29, 2014
    Messages:
    1,363
    Likes Received:
    2,530
    I don't want to get out of the subject, but I want to ask about the "EffectDef.json" file
    This file influences the final result? I have created some variants from a document of contrasted values. I share them with you in case you want to try.
     

    Attached Files:

Share This Page