1. Thread posting restricted: Only the BeamNG team members can post new threads in this sub-forum in order to prevent spam. New: Feel free to reply and comment :)

AI - work

Discussion in 'Microblogs' started by tdev, May 24, 2018.

  1. RyvyLo

    RyvyLo
    Expand Collapse
    Staff Member

    Joined:
    May 15, 2014
    Messages:
    419
    You can use the new ai code, you can see a working example in the Road Atlanta scenarios (overtaking challenge for example). The trick to make sure it can find the waypoints is to use the decalRoad waypoints instead of the scenario waypoints. You can find their name in the AI control app, with the debug mode map set as NaviGraph
     
  2. HighDef

    HighDef
    Expand Collapse

    Joined:
    Aug 4, 2013
    Messages:
    527
    Oooo, that is a very interesting idea. So I type them the same as scenario waypoints but with the names of the decalroad node names?
     
  3. RyvyLo

    RyvyLo
    Expand Collapse
    Staff Member

    Joined:
    May 15, 2014
    Messages:
    419
    In the .json, you keep the waypoints name, but in the .lua you type in a list of decalRoad node names that follow the same path as the waypoint names. The onRaceStart function in the lua code would look like this :
    Code:
    local function onRaceStart()
      --log('I', logTag,'onRaceStart called')
      reset()
    
      local arg1 = {vehicleName = aiInstance1,
                  waypoints = {'AI_Path56','AI_Path64','AI_Path93','AI_Path109', 'AI_Path3','AI_Path56'},
                  }
      helper.setAiPath(arg1)
    end
     
    • Informative Informative x 3
    • Like Like x 1
  4. audi4141

    audi4141
    Expand Collapse

    Joined:
    May 13, 2017
    Messages:
    331
    this is exciting for me,it will give a whole new level of experience to beam ng.
    Me likey alot.;-)
     
  5. StrangeTamer

    StrangeTamer
    Expand Collapse

    Joined:
    Nov 30, 2013
    Messages:
    3
    I've been waiting so long for the AI to be able to obey traffic laws and avoid ramming into each other on the roads. My absolute favorite thing to do is let car randomly drive around on a map and chase them down, but unfortunately most of them crash into each other first eventually lol. Keep up the good work guys!
     
    • Agree Agree x 10
    • Like Like x 2
  6. Spicymeymeys420

    Spicymeymeys420
    Expand Collapse

    Joined:
    Aug 2, 2018
    Messages:
    33
    I hope that they also make the chase ai less suicidal by not making it crash full speed when going trough a sharp corner.
     
    • Agree Agree x 4
    • Like Like x 2
  7. LoSboccacc

    LoSboccacc
    Expand Collapse

    Joined:
    Feb 22, 2016
    Messages:
    5

    also a parameter for vehicle performances. AI already supports a 'risk' factor that tells how faster to drive above baseline, but currently you have to set risk appropriately for each vehicle. it'd be great for it to be embedded in the cars directly. automation exporter could then use car max cornering g to set this to an appropriate default.
     
  8. Car8john

    Car8john
    Expand Collapse

    Joined:
    May 12, 2016
    Messages:
    5,083
    The risk factor (or douchebag factor as I call it) is pretty handy, but doesn't it just take the stats of the vehicle, max speed, rpm, cornering, etc, and use that? It would already be embedded in the vehicle, just change the facter, simple once you think about changing a slider from 1 to 1.44
     
  9. LoSboccacc

    LoSboccacc
    Expand Collapse

    Joined:
    Feb 22, 2016
    Messages:
    5
    not just yet, that was the point, it should, but doesn't know the car really, only the car creator knows
     
  10. Cubecar123

    Cubecar123
    Expand Collapse

    Joined:
    Aug 24, 2018
    Messages:
    1
    Wow, I've never seen the AI so sophisticated before! They'll usually find a way to crash or get stuck. I was dumbfounded when I saw the Pigeon actually standing upright!

    Congratulations to the BeamNG Devs!
     
    • Like Like x 1
  11. NaxNir

    NaxNir
    Expand Collapse

    Joined:
    Jan 28, 2014
    Messages:
    623
    No, they are probably still using their existing traditional AI with some extensions.
     
  12. Castline'25

    Castline'25
    Expand Collapse

    Joined:
    Aug 24, 2018
    Messages:
    70
    Sooo, does this mean I can actually have a normal police chase, and not ''accidentally'' hit the car because it full-stops mid-chase one day?
     
    • Like Like x 1
  13. 1UZ-FE

    1UZ-FE
    Expand Collapse

    Joined:
    Oct 13, 2014
    Messages:
    331
    Any plans on driving behaviors or dynamic AI behavior?

    Example of the 1st: for traffic mode, choose from a standard, law abiding responsible driver, or turn things up with a constant overtaker that's almost 15 minutes late to work and honks you once the light turns green. Or even more exciting, have your AI drive around like an all-bark-no-bite ricer with unnecessary, and sometimes dangerous (in small, busy areas with cars and/or low speeds, like a city vs a blank highway with better speeds and less cars, less dangerous) pulls and maneuvers. Imagine watching a sketchy 3 lane merge in one move with cars all around! We also can't forget about our grandma drivers that take speed limits literally.


    There also should be levels of aggression or factors to have the AI decide how much they will bend the law, kind of like the "risk" variable, but more advanced (go x much more over the speed limit/ignore red lights, use the opposing lane etc).

    Example, one type could carefully troll through a red light/use opposing lane slowly/speed with caution/etc (will perform any illegal move to beat traffic but always done with caution), breaking the law but still attempting to be safe, the latter wouldn't care and does illegal maneuvers/speed excessively without care or caution, just enough to keep himself alive, for the time being.....



    When I say dynamic AI behavior, I am talking about AI style/character temporarily, or permanently changing, based on the actions by other drivers around.


    Let's say you're at a red light, or cruising on the highway neck and neck with a car, and honk your horn 3 rhythmic, consecutive times, and the AI floors it after your 3rd honk until a certain speed depending on the road, or depending how long YOU keep your pull going. Depending on the AI character (ricer that needs to prove something vs confident driver), the next time you go to honk 3x to race, he'll either go harder, or not even do the pull with you.

    What if you were driving erratically around an AI? Their first move should be to stay a farther distance from you, likely in front of you, so they're not worried about you coming their way.

    Gotta also have your road rage AI where once they suspect you've disrespected them on the road(cut them off, brake check, bad merge, nose into their lane badly, excessive honking, they will try to keep up with you and intimidate you, cut you off, block you during merging/traffic, brake check, be up your ass, or maybe even try to push you off the road.

    Thinking a little more advanced.... if the vehicle assigned to an AI overheats, the AI should attempt to drive it not as hard to preserve it, or if it chooses to throw in the towel, will pull over with its hazards.



    I understand that a good amount of this is advanced/may be too performance hogging and won't be around for some time, but I think some of the more basic features of this could be done in the short term. It's also nice just to share my thoughts and see what others have to say.
     
    #53 1UZ-FE, Sep 4, 2018
    Last edited: Sep 5, 2018
    • Like Like x 8
    • Agree Agree x 5
  14. Dorgado

    Dorgado
    Expand Collapse

    Joined:
    Aug 22, 2018
    Messages:
    3
    how i make the AI follow me without hitting me? (i'm new in the forum, i don't know where to make a question like this, sorry)
     
  15. Ai'Torror

    Ai'Torror
    Expand Collapse

    Joined:
    Aug 29, 2015
    Messages:
    1,465
    Welcome to the forums!
    Right now it is not possible, unless you go back a few version (which is not possible without going to shady sites or making your own backups). The feature you see described in this thread is one of the features which will be added in one of the future updates.
     
    • Like Like x 1
  16. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    4,885
    I guess you could have AI follow leash part made, you would set single beam between vehicles that could become really really long, but never quite so short that vehicles can hit, it would need to be rather soft too so that it just softly cushions approaching AI vehicle. Surely it would not be quite optimal solution, but possible, anything is possible given enough effort time and resources :D
     
  17. Flippi 284

    Flippi 284
    Expand Collapse

    Joined:
    May 2, 2017
    Messages:
    2,945
    Suggestions for AI options:
    Traffic: AI behaves like how they do in the video
    (all the existing AI presets)
    Follow: would be like the old Follow mode
    Pursue (can't think of a good name): Would be like Chase but the AI will only bump you at most
    Destination/Race: You have the ability to draw a course on the minimap and the AI will follow that course (with settings for how dangerous the AI will drive) I don't think this is currently possible to make without a bit of editing but would be cool.
     
    • Agree Agree x 2
  18. Danny Werewolf

    Danny Werewolf
    Expand Collapse

    Joined:
    Mar 31, 2017
    Messages:
    1,091
    Just going to try and add something.

    Wish this was a thing, but if you're wanting the chaser to stay behind the bandit, the best thing I use is having both of them chasing another still car as a waypoint. That's the only way I know of making that work, and that still doesn't resolve the hitting issue totally. Also, both vehicles have to have similar/identical performance classes, yet that limits a lot.

    As said above, the best way by doing this is having the destination being a vehicle that is chaseable. Most likely if you want it to be close, they will have to be similar again. All I can think of.
     
    • Agree Agree x 1
  19. Flippi 284

    Flippi 284
    Expand Collapse

    Joined:
    May 2, 2017
    Messages:
    2,945
    But the AI will still choose a random route to get to the destination. Also what if you wanted them to say...do a lap around Belasco city?
     
  20. Danny Werewolf

    Danny Werewolf
    Expand Collapse

    Joined:
    Mar 31, 2017
    Messages:
    1,091
    The two AI cars will choose the same exact route with every reset as long as the waypoint vehicle doesn't move. Imagine the GPS's in other games. Sadly, they won't choose your route because they are stubborn so rip.
    Might be tedious, but try pausing and teleporting the waypoint to another close-ish section of the track/route every time the racers get close. I'd say use a pigeon as the waypoint btw. I bet using the Replay App would allow to watch the race in it's whole.
     
  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