TUTORIAL Soft collision tyre walls with extended track physics

Discussion in 'Tracks' started by Gunnar333, Sep 30, 2021.

  1. Gunnar333

    Gunnar333 Well-Known Member

    Joined:
    Aug 5, 2017
    Messages:
    321
    Likes Received:
    618
    Location:
    Germany
    The latest CSP release can do this:

    Screenshot_ks_maserati_levante__testtrack_30-8-121-13-21-56.jpg

    But there's still no documentation about it. So I wrote Ilja and he told me how to do it. So here it is:


    first you’d need to enable extended track physics
    for that, change this parameter:

    Code:
    [SURFACE_0] WAV_PITCH=extended-0
    and then you can alter collide parameters like so:

    Code:
    [COLLISION_PARAMS_...]
    MESHES=?WALL?  ; of course, it would be better to list only soft walls here
    SOFT_ERP=0.6
    SOFT_CFM=0.001
    MAX_DEPTH=0.5
    BOUNCE=0.5
    FRICTION=0.1
    INTENSITY=0.1
    
    for more information on CFM and ERP, use:
    http://ode.org/ode-latest-userguide.html#sec_3_8_0

    Open Dynamics Engine
    http://ode.org

    and here is the actual soft walls bit:
    Code:
    [DEFORMING_WALLS_...]
    MESHES = material:barriers
    TESSELLATION = 1
    TESSELLATION_DISTANCE = 40, 100
    TESSELLATION_FACTOR = 15, 3
    
    with these settings it would switch to MultiMap shader with tessellation, considering how usually those walls aren’t meant to bend and don’t have enough triangles

    please note that I set that tessellation factor for spa which has very few triangles for that wall, you might need to reduce it for your track. or maybe not
    you can always use:

    Code:
    [SHADER_REPLACEMENT_...]
    CULL_MODE = WIREFRAME
    
    to see tessellation in action

    here is how it looks in action:
    https://files.acstuff.ru/shared/gtun/20210911-171509.mp4

    also, just to clarify, DEFORMING_WALLS_… reacts to actual collision depth, so it wouldn’t really work without soft wall colliders



    I did the simple test track that you can see at the first video and what can I say: It works!
    The track is attached to this post. So you can test it by yourself.

    It would be good to experiment more with the values. I still don't get what exactly should be changed to get a more rigit or solf wall behaviour. Also should not rendered collision walls also be treated like this?

    Please comment!
     

    Attached Files:

  2. luchian

    luchian Administrator Staff Member

    Joined:
    Jun 3, 2014
    Messages:
    3,009
    Likes Received:
    1,493
    :eek: this is very impressive! I can't remember how many times I thought "not really much else can be done", only to be proven wrong with each iteration.

    Coming back to your interogation.
    It seems this has to be modified, no?

    Code:
    [COLLISION_PARAMS_...]
    MESHES=?WALL?  ; of course, it would be better to list only soft walls here
    SOFT_ERP=0.6
    SOFT_CFM=0.001 -- from the documentation it seems that the higher this is, the more deformation (?)
    MAX_DEPTH=0.5 -- Could this be the distance in m, from the un-deformed state (?)
    BOUNCE=0.5
    FRICTION=0.1
    INTENSITY=0.1
    Didn't do any test tho, just guessing around :ninja:
     
    quetillo likes this.
  3. Gunnar333

    Gunnar333 Well-Known Member

    Joined:
    Aug 5, 2017
    Messages:
    321
    Likes Received:
    618
    Location:
    Germany
    Yes. I changed some values but I couldn‘t make out any difference. Maybe I was testing with a replay.
     
  4. fughettaboutit

    fughettaboutit aka leBluem

    Joined:
    Jul 21, 2014
    Messages:
    1,130
    Likes Received:
    383
    i can add some more possible params:
    Code:
    [DEFORMING_WALLS]
    MESHES = meshFilter
    ; defaults shown here
    MAX_DEPTH = 1.0
    RESTORATION_LAG = 0.8
    DEPTH_MULT = 1.0  ; x,y,z possible, single value = same for all
    RADIUS_MULT = 1.0  ; x,y,z possible
    TESSELLATION = 1
    TESSELLATION_DISTANCE = 20.0, 100.0
    TESSELLATION_FACTOR = 10.0, 3.0
    
    ALPHA_MODE = somestring ; didnt find what to put in here

    edit: possible alpha_modes
    NONE or DIFFUSE or NORMALS or REFLECTION

    edit2: you might not use that alphamode, i guess i read that wrong and its for looks idk
     
    Last edited: Oct 1, 2021
    quetillo likes this.
  5. fughettaboutit

    fughettaboutit aka leBluem

    Joined:
    Jul 21, 2014
    Messages:
    1,130
    Likes Received:
    383
    Thats in surfaces.ini?

    edit: oh i see in "ext_config.ini" too
     
    Last edited: Oct 1, 2021
    quetillo likes this.
  6. quetillo

    quetillo Member

    Joined:
    Mar 20, 2020
    Messages:
    363
    Likes Received:
    15
    Location:
    España
    I do not understand this system much, I do the circuits from the RTB program, then I pass it to KSEDITOR, should I put something in the KSEDITOR?
    or just by setting the parameters and assigning the mesh and material to it. Thank you
     
  7. fughettaboutit

    fughettaboutit aka leBluem

    Joined:
    Jul 21, 2014
    Messages:
    1,130
    Likes Received:
    383
    look at the example track from gunnar!
     
  8. quetillo

    quetillo Member

    Joined:
    Mar 20, 2020
    Messages:
    363
    Likes Received:
    15
    Location:
    España
    if I put those parameters and give the mesh and the material the name, the object disappears.
    but ami the nePerPixelMultiMap_blending shader does not come out. The one that I put on its track
     
  9. quetillo

    quetillo Member

    Joined:
    Mar 20, 2020
    Messages:
    363
    Likes Received:
    15
    Location:
    España
    Because this happens, it comes out like this, I go to extension I delete the name of the material and I put it again and it looks good.
     

    Attached Files:

  10. quetillo

    quetillo Member

    Joined:
    Mar 20, 2020
    Messages:
    363
    Likes Received:
    15
    Location:
    España
    This is how I look and when it collides the wall comes out but like this
     

    Attached Files:

  11. Johnr777

    Johnr777 Moderator

    Joined:
    Jul 26, 2017
    Messages:
    1,050
    Likes Received:
    615
    You need the patreon preview build for this to work.
     
    quetillo likes this.
  12. Mitch9

    Mitch9 Member

    Joined:
    May 2, 2021
    Messages:
    36
    Likes Received:
    10
    sorry, does this mean you need to bind this to the physical or the visual wall? if it´s for the visual, what happens to the physical then? I´ll try this later
     
  13. Johnr777

    Johnr777 Moderator

    Joined:
    Jul 26, 2017
    Messages:
    1,050
    Likes Received:
    615
    Good question... I for one, use a simple invisible 1WALL mesh and a visually detailed barrier named something else
     
    EKO Sim-Racing likes this.
  14. quetillo

    quetillo Member

    Joined:
    Mar 20, 2020
    Messages:
    363
    Likes Received:
    15
    Location:
    España
    I have the last csp of payment, because I am every month
     
  15. quetillo

    quetillo Member

    Joined:
    Mar 20, 2020
    Messages:
    363
    Likes Received:
    15
    Location:
    España
    The problem is the following, a wall that when putting those parameters you see the skeleton, it would still be better to create a NM and give the name of the material to the NM. I don't know I have no idea, I took the test and it looks the same to me. the latest CSP v0.1.76-preview92-ful
     
  16. Johnr777

    Johnr777 Moderator

    Joined:
    Jul 26, 2017
    Messages:
    1,050
    Likes Received:
    615
    This might be a bit too advanced for you at this moment.
     
    quetillo likes this.
  17. quetillo

    quetillo Member

    Joined:
    Mar 20, 2020
    Messages:
    363
    Likes Received:
    15
    Location:
    España
    fixed and solved, I code wrong, some in capital letters, that's why I got the error, I copied and entered my ex_confi and I tried, until I found the error. Advanced there is nothing as long as the codes are written correctly.
     
  18. quetillo

    quetillo Member

    Joined:
    Mar 20, 2020
    Messages:
    363
    Likes Received:
    15
    Location:
    España
    thanks Gunnar333 for your explanations
     
    Piereligio, Fat-Alfie and Gunnar333 like this.
  19. fughettaboutit

    fughettaboutit aka leBluem

    Joined:
    Jul 21, 2014
    Messages:
    1,130
    Likes Received:
    383
  20. Gunnar333

    Gunnar333 Well-Known Member

    Joined:
    Aug 5, 2017
    Messages:
    321
    Likes Received:
    618
    Location:
    Germany
  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