Cancelled Airbags proof of concept?

Discussion in 'Mods and Skins' started by JsZ, Aug 21, 2020.

Thread Status:
Not open for further replies.
  1. JsZ

    JsZ
    Expand Collapse
    Banned

    Joined:
    Feb 11, 2018
    Messages:
    595
    So after the lackluster door hydros for the Zephyr and a failed attempt at making a backup camera, i thought i'd do something different and try and make an airbag similar to an early test by @NOCARGO .
    Originally it was going to be just a small feature for my vehicle mod here, but I was suggested to add it to other cars too.
    Also, a lot of people were wondering how they worked, which is the main purpose of this thread

    Heres a quick demo


    How does it work? (assuming you know a bit about how BeamNG works)
    The frontal airbags (driver and passenger) have a fixed node on the steering wheel and dash that is surrounded by 8 nodes each that act as the undeployed airbag. The mesh for this uses a glowmap and is set to invisible until the airbag deploys

    jbim-Copy.png

    There are then hydros(expandable beams) connecting each node to the central fixed node
    I made a simple lua script that uses g-sensors to detect when to explode the airbag for both the front and side. The hydros then expand and the material for the airbag is set to be visible



    The side airbags are a bit different but also similar. Traditional curtain airbags deploy from the roof and go downwards. so a central fixed node would not be viable. Instead, I used a rail of fixed nodes attached to the roofline, and another rail of nodes underneath that use hydros to move downwards.
    The hydros need to move very fast in order for this to work. This gif is in 100x slow motion and should explain it pretty well:
    topsecret.gif


    Does it work?
    Well, since there aren't really drivers in BeamNG cars, i can't really say for sure. But I tried using synsol's crash test dummy to test and it works ok, i guess? There isn't any way to tell if the dummy "survived" so you'd probrably have to use your imagination



    Issues:
    The main issues are improving the reaction time of the sensors. The lua is loosely based off the pre-existing "postCrashBrake" script that modern vehicles use to stop after crashing. However the response time is not the best and upon improving it I noticed sometimes the airbag misfires after going over rough bumps.

    Plans to improve this would be to use something similar to "beamState", where an action can be triggered upon breaking of a beam in conjunction to the g-sensors to improve accuracy

    this took a while to type lol im going to bed
     
    • Like Like x 101
    • Agree Agree x 4
    • Staff Pick Staff Pick x 2
  2. BoredFish

    BoredFish
    Expand Collapse

    Joined:
    Dec 24, 2018
    Messages:
    117
    some cars do do that because some bumps when going over can simulate a crash. Maybe raise the tolerances a bit. Modern cars don’t have their airbags go off if the speed and impact is too low. Older cars tho any impact will trigger it. Great idea tho, I’ve been waiting years for a mod like this. Gonna follow closely and will help any way I can.
     
    #2 BoredFish, Aug 21, 2020
    Last edited: Aug 21, 2020
    • Like Like x 3
    • Agree Agree x 3
  3. FiveSixSeven

    FiveSixSeven
    Expand Collapse
    Banned

    Joined:
    Apr 12, 2020
    Messages:
    96
    dang that sounds really complicated, but its cool to see airbags in beamng finally! hope it can released soon
     
    • Agree Agree x 1
  4. RedHorizon

    RedHorizon
    Expand Collapse

    Joined:
    Aug 17, 2012
    Messages:
    417
    Dang, that looks good!
     
    • Agree Agree x 1
  5. Alieu

    Alieu
    Expand Collapse

    Joined:
    Dec 30, 2017
    Messages:
    1,190
    Could you possibly have the airbags deploy faster? Atm, it looks like if there was a high speed crash, the dummy would hit the steering wheel, or the door, before the airbags deploy.
    Or, the dummy could have the airbag deploy while on the steering wheel, which could be a fatal blow. Otherwise, it's dope!
     
    • Agree Agree x 1
  6. Trophy

    Trophy
    Expand Collapse

    Joined:
    Aug 26, 2019
    Messages:
    1,644
    i hope you perfect this!
     
  7. jon_miata

    jon_miata
    Expand Collapse

    Joined:
    Mar 14, 2020
    Messages:
    80
    I watched the ETK crash video and a huge grin came across my face
     
    • Agree Agree x 1
  8. NOCARGO

    NOCARGO
    Expand Collapse

    Joined:
    Apr 1, 2019
    Messages:
    1,514
    Oh WOW ! It seems you really pulled it off catching Buster with the airbag before he slams the wheel ! :cool:

    Very very well done @JsZ !
     
    • Agree Agree x 5
    • Like Like x 1
  9. SlickNick924

    SlickNick924
    Expand Collapse

    Joined:
    Aug 19, 2018
    Messages:
    332
    Ingenious! this is super cool, great job
     
    • Agree Agree x 1
  10. oioioioo

    oioioioo
    Expand Collapse

    Joined:
    Jul 1, 2019
    Messages:
    92
    In reality I think they use G sensors to determine "survival" rates. If you could rig some sort of 3-axis accelerometer into the dummies' head, you may be able to see if there's a tangible difference in the G load the dummy experiences upon impact. The big problem I see with that is BeamNG vehicles already use an internal accelerometer built into the jbeam for things like wheel alignment, camera position ETC. so if you add a second accelerometer to the dummy there would be 2 of them in 1 vehicle, which might break the game... IDK how else you'd measure "survivability" though...
     
  11. iPlayzTG-BMG

    iPlayzTG-BMG
    Expand Collapse

    Joined:
    Jun 18, 2018
    Messages:
    162
    Looks pretty epic
     
    • Agree Agree x 1
  12. zysom

    zysom
    Expand Collapse

    Joined:
    Aug 11, 2018
    Messages:
    111
    This looks sick! Good work!
     
    • Agree Agree x 1
  13. RobloxFan2

    RobloxFan2
    Expand Collapse

    Joined:
    Aug 28, 2019
    Messages:
    811
    Awesome!
     
  14. JsZ

    JsZ
    Expand Collapse
    Banned

    Joined:
    Feb 11, 2018
    Messages:
    595

    added to vivace and improved sensor reaction time as well as accuracy
     
    • Like Like x 21
  15. P_enta

    P_enta
    Expand Collapse

    Joined:
    Jan 11, 2020
    Messages:
    3,029
    The only problem i have is that the airbag models are very unrealistic.

    Other wise this is outstanding
     
  16. JsZ

    JsZ
    Expand Collapse
    Banned

    Joined:
    Feb 11, 2018
    Messages:
    595
    not sure how that'd work tbh but its a good idea

    yes i am working on it

    they're kinda unrealistic because in order to have the hydro pull it down without causing weird things, the mesh has to be low poly
    however i could work around this by using some glowmap trickery to switch out the mesh to a more realistic/highpoly one after the lowpoly airbag fully inflates
     
    • Like Like x 5
  17. P_enta

    P_enta
    Expand Collapse

    Joined:
    Jan 11, 2020
    Messages:
    3,029
    that would be great as well as real textures
     
  18. RadeS

    RadeS
    Expand Collapse

    Joined:
    Aug 6, 2019
    Messages:
    446
    this is most awsome thing what i have seen on the forum:D! this is so ambitious!!
     
  19. etca1515

    etca1515
    Expand Collapse

    Joined:
    Jan 14, 2019
    Messages:
    798
    well i hadn't seen that one coming
     
  20. zysom

    zysom
    Expand Collapse

    Joined:
    Aug 11, 2018
    Messages:
    111
    You guys should become developers, your doing what was said couldn't be done.
     
    • Agree Agree x 5
Thread Status:
Not open for further replies.
  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