more muddy mud?

Discussion in 'Content Creation' started by warsenf, Mar 23, 2019.

  1. warsenf

    warsenf
    Expand Collapse

    Joined:
    Dec 24, 2016
    Messages:
    28
    Ive been making a map recently and I found that the only way to make the driving in the mud challenging is by adding a lot of hills to the terrain, but thats not exactly what I wanted.

    So I need to make the mud slippier/deeper, any way to do that?
     
    • Like Like x 1
  2. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,782
    You need to setup a depth map for that I believe. Then play with density etc.

    In editor you can export terrain heightmap, that should give you depth map too, which you can paint darker shade of gray where you need more depth.

    Numbers I used for snow might be something to try for mud, it is easy to move from there, just be aware that my numbers cause bugging out in tunnels, which I have not found much anything about.
    https://www.beamng.com/threads/terrain-depth-bugging-out.61455/

    You will need yourlevelname/groundmodels folder

    There you will need myGroundModels.json file, like so:
    Code:
    /*******************************************************************************
    This is an example of how to add per-level custom groundmodels
    *******************************************************************************/
    {
     "ASPHALT": {
        "staticFrictionCoefficient"  : 1,
        "slidingFrictionCoefficient" : 0.68,
        "hydrodynamicFriction"       : 0,
        "stribeckVelocity"           : 4,
        "strength"                   : 1,
        "roughnessCoefficient"       : 0,
    
        "defaultDepth"               : 0,
        "collisiontype"              : "ASPHALT",
        "skidMarks"                  : true,
        "aliases"                    : ["groundmodel_asphalt1", "grid", "concrete", "concrete2"]
      },
       "MUD":{//MUD
        "staticFrictionCoefficient"  : 0.55,
        "slidingFrictionCoefficient" : 0.55,
        "hydrodynamicFriction"       : 0.01,
        "stribeckVelocity"           : 6,
        "strength"                   : 1,
        "roughnessCoefficient"       : 0.5,
    
        "fluidDensity"               : 7000,
        "flowConsistencyIndex"       : 2000,
        "flowBehaviorIndex"          : 0.5,
        "dragAnisotropy"             : 0.75,
        "shearStrength"              : 4000,
        "defaultDepth"               : 0.15,
        "collisiontype"              : "MUD",
        "skidMarks"                  : false
      },
      "SNOW" : {
       "staticFrictionCoefficient"  : 0.55,
        "slidingFrictionCoefficient" : 0.35,
        "hydrodynamicFriction"       : 0.01,
        "stribeckVelocity"           : 2,
        "strength"                   : 1,
        "roughnessCoefficient"       : 0.5,
    
        "fluidDensity"               : 400,
        "flowConsistencyIndex"       : 2000,
        "flowBehaviorIndex"          : 0.5,
        "dragAnisotropy"             : 0.45,
        "shearStrength"              : 4000,
        "defaultDepth"               : 0.8,
        "collisiontype"              : "MUD",
        "skidMarks"                  : false,
        "aliases"                    : ["mud", "snow"]
      },
    }
    
    In your levels/yourlevelname folder:
    yourlevelterrainfilename.ter.depth.png

    Linear 8bit grayscale is png format

    Now I can't remember if one needed to have lines for depth map in yourlevelname.terrain.json, but at least Mammoth Valley where I changed depth map and created new groundmodel for snow seems to work without.

    It was not very difficult to make it work, but you might need some head beating to wall as can't remember all the details for all that.
     
  3. warsenf

    warsenf
    Expand Collapse

    Joined:
    Dec 24, 2016
    Messages:
    28
    Okay, if I understand this correctly, I can modify the heightmap so that the muddy areas are deeper.
    I think I dont really need to do that.
    Then go in the terrain file and change some settings for the terrain?
     
  4. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,782
    You can get depthmap from your heightmap and you can set depth of mud in that depthmap to be anything between 0 (white) to 3.8 meters (black) 255 steps with shades of gray between those.

    Or you can have depthmap as transparent, then it is default depth that defines depth of your mud instead.

    Not sure if it is default depth even when you omit that depthmap completely.

    In map editor you need to then use name of material for painting mud that matches to name of your custom groundmodel that you defined in myGroundModels.json.

    For example customMud, you would make new material in world editor with that exact name and have customMud made to myGroundModels.json before hand, then you paint with customMud and you get properties you set for your customMud on your terrain.

    With depth map, you paint areas in gimp, which is bit less accurate, but can cover large areas faster.
     
  5. warsenf

    warsenf
    Expand Collapse

    Joined:
    Dec 24, 2016
    Messages:
    28
    Dont know how, but I got custom materials working.

    I have three different mud materials that have different depth and different texture darkness.

    The result is pretty good but there is something with the settings, I want to make driving in the mud generally slower, while not just making the car slide out more, do you have an idea what settings that could be?
     
  6. Danny Werewolf

    Danny Werewolf
    Expand Collapse

    Joined:
    Mar 31, 2017
    Messages:
    2,268
    https://wiki.beamng.com/Physics_Materials

    I found this by searching up "Groundmodel" in the wiki.
     
  7. warsenf

    warsenf
    Expand Collapse

    Joined:
    Dec 24, 2016
    Messages:
    28
    well I got a lot of depth right now, up to 2.0
    I found two values that affect the handling in the mud and im mostly just playing around with them.
     
  8. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,782
    That is pretty much how everyone does it :D

    Values I posted for snow make it so that it kinda is more sticky than normal, I just changed values of mud to make it so, but can't say I would have all the understanding from the stuff, then there is even translation layer to different language complicating things.

    Change one value at time and do testing, that way you quickly get hang of what to change. Also I did some reading about Stribeck curve and trying to figure out how to get that to somewhat realistic, however I have not learned that enough yet.

    Eventually with enough changes and testing one can get quite nice sticky behavior, much much better than typical flatness and close to water like behavior.
     
  9. DuneWulff

    DuneWulff
    Expand Collapse

    Joined:
    Apr 25, 2016
    Messages:
    1,034
    Yep, I have a mudpot texture I'm using in my newest map, and I've been playing around with making super deep, sticky, almost sludge-like terrain exclusively for it.
    If I end up tweaking it to something that I feel represents it most accurately, I'll update a post here. :p
     
    • Like Like x 1
  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