Experimental Automatic Emergency Braking Prototype (not WIP)

Discussion in 'Content Creation' started by angelo234, Feb 21, 2021 at 10:40 AM.

  1. angelo234

    angelo234
    Expand Collapse

    Joined:
    Aug 11, 2017
    Messages:
    53
    I'm not gonna be working on this anymore due to the technical challenges with the game (needs an extreme amount of CPU power to make it work properly). But if anybody would like to try out what I've made so far, you can now give it shot! :)
    • Only ETK 800
    • Only works in straight lines
    • Can detect both dynamic (vehicles) and static objects
    • Doesn't work well with small objects and only detects objects in path of raycasts

    If it's not working for you, press Ctrl + L to reset Lua.

    Github repo here:
    https://github.com/angelo234/aeb_angelo234
     

    Attached Files:

    #1 angelo234, Feb 21, 2021 at 10:40 AM
    Last edited: Feb 23, 2021 at 5:10 AM
    • Like Like x 6
  2. The_Kazoo_Meme

    The_Kazoo_Meme
    Expand Collapse

    Joined:
    Jul 4, 2018
    Messages:
    33
    It works really great! Very good job on this!
     
  3. DaddelZeit

    DaddelZeit
    Expand Collapse

    Joined:
    Jul 17, 2019
    Messages:
    2,205
    Yes! Amazing work!
     
  4. HeepXJ40

    HeepXJ40
    Expand Collapse

    Joined:
    Feb 6, 2020
    Messages:
    212
    how do you use it?
     
  5. angelo234

    angelo234
    Expand Collapse

    Joined:
    Aug 11, 2017
    Messages:
    53
    It only works with the ETK 800 car so it won't work with other cars and it should work right away (you'll see rays shooting out of the front of the car)
     
    • Agree Agree x 1
  6. DaddelZeit

    DaddelZeit
    Expand Collapse

    Joined:
    Jul 17, 2019
    Messages:
    2,205
    That's pretty weird, it doesn't shoot rays out the front but it still works for meo_O
     
  7. angelo234

    angelo234
    Expand Collapse

    Joined:
    Aug 11, 2017
    Messages:
    53
    Wait you don't see the rays being shot out on the top of the windshield? o_O I downloaded my uploaded mod and I see the rays. Well if it works then that's what counts :p

    Capture.png
     
  8. DaddelZeit

    DaddelZeit
    Expand Collapse

    Joined:
    Jul 17, 2019
    Messages:
    2,205
     
    • Like Like x 2
  9. angelo234

    angelo234
    Expand Collapse

    Joined:
    Aug 11, 2017
    Messages:
    53
    Hmmm... I think it's the graphics mod you've got installed causing it not to appear probably.
     
  10. DaddelZeit

    DaddelZeit
    Expand Collapse

    Joined:
    Jul 17, 2019
    Messages:
    2,205
    I only have ReShade and PostFX which both only have an overlay...the first time I installed it it worked, then I restarted the game and it was gone :p
    --- Post updated ---
    wait...no
    *facepalm*, I edited the lua so that it doesn't shoot the rays

    my brain is broke
     
    • Agree Agree x 2
    • Like Like x 1
  11. SuperShep1

    SuperShep1
    Expand Collapse

    Joined:
    Apr 14, 2019
    Messages:
    1,567
    lol.

    this is an interesting mod, would it be able to happen to the k-series?
     
  12. angelo234

    angelo234
    Expand Collapse

    Joined:
    Aug 11, 2017
    Messages:
    53
    If you want to make it work for another car, you first need to unzip the mod. Create a folder in the "mods" folder called "unpacked" and place the "aeb_angelo234" folder in there. Then open the "aeb_angelo234" folder and add a folder inside the "vehicles" folder with the name of the car (in this case "etkc"). And add a folder inside the "etkc" folder and name it "lua". And then copy and paste my "aeb_angelo234.lua" file from the "etk800/lua" folder into that new "lua" folder.

    So the file directory should look like this: "mods/unpacked/aeb_angelo234/vehicles/etkc/lua/aeb_angelo234.lua"
     
  13. SuperShep1

    SuperShep1
    Expand Collapse

    Joined:
    Apr 14, 2019
    Messages:
    1,567
    ah ok.
     
  14. Szymon2007

    Szymon2007
    Expand Collapse

    Joined:
    Nov 30, 2017
    Messages:
    604
    how do you do that?
     
  15. DaddelZeit

    DaddelZeit
    Expand Collapse

    Joined:
    Jul 17, 2019
    Messages:
    2,205
    Open aeb_angelo234\scripts\aeb_angelo234\extension.lua
    Replace
    Code:
            hit = castRayDebug(origin, dest, includeTerrain, renderGeometry)    
    with
    Code:
            hit = castRay(origin, dest, includeTerrain, renderGeometry)    
     
  16. Szymon2007

    Szymon2007
    Expand Collapse

    Joined:
    Nov 30, 2017
    Messages:
    604
    i've done some testing and:
    It sometimes prevents from launching the car if your car is directed at a building
    it stops collisions up to ~95 kph/60 mph, anything more and you slam into the thing in front at low speeds
    i'll try porting it to other cars
     
  17. Zero

    Zero
    Expand Collapse

    Joined:
    Sep 2, 2012
    Messages:
    989
    Just like IRL.
    Idk if the speed matches but at X speed, the point is no longer to prevent the crash but to minimize how bad it will be.
     
    • Agree Agree x 2
  18. angelo234

    angelo234
    Expand Collapse

    Joined:
    Aug 11, 2017
    Messages:
    53
    Yeah, the algorithm I used to cast rays is pretty crappy honestly. If you can, you can try to change some of the parameters to make it shoot lower, in other directions, and from different positions however else you want. If you can find a way to find the direction vector of the car without influence from the car rolling and pitching under braking, then you wouldn't need to be shooting rays into the sky, since they point parallel to the ground under braking lol.
     
    • 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