1. Trouble with the game?
    Try the troubleshooter!

    Dismiss Notice
  2. Issues with the game?
    Check the Known Issues list before reporting!

    Dismiss Notice

BeamNG.py Artificial Intelligence

Discussion in 'General Discussion' started by Sameed Tariq, Dec 15, 2018.

  1. Sameed Tariq

    Sameed Tariq
    Expand Collapse

    Joined:
    Dec 8, 2018
    Messages:
    6
    I am trying to control the car intelligently by setting it waypoints in the code. The problem is that the car still needs user input to go from point A to Point B.


    Code:
    bng.load_scenario(scenario)
    bng.start_scenario()
    # Make the vehicle's AI span the map
    vehicle.ai_set_mode('span')
    vehicle.ai_set_target(pos=(-713, 70, 118))
    How to make car AI control using python. Secondly, how to set user input to false.

    The options are

    Code:
                * ``disabled``: Turn the AI off (default state)
                * ``random``: Drive from random points to random points on the map
                * ``span``: Drive along the entire road network of the map
                * ``manual``: Drive to a specific waypoint, target set separately
                * ``chase``: Chase a target vehicle, target set separately
                * ``flee``: Flee from a vehicle, target set separately
                * ``stopping``: Make the vehicle come to a halt (AI disables itself
                                                                 once the vehicle
                                                                 stopped.)
     
    • Like Like x 1
  2. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,781
    You can't as far as I know.

    You need to use LUA.
     
  3. tdev

    tdev
    Expand Collapse
    Developer
    BeamNG Team

    Joined:
    Aug 3, 2012
    Messages:
    3,074
    We'll reply to you on Monday, sorry for the delay :)
     
    • Informative Informative x 4
  4. Sameed Tariq

    Sameed Tariq
    Expand Collapse

    Joined:
    Dec 8, 2018
    Messages:
    6
    Can you provide me the directions that how I will use the lua for AI control of cars. I know how to declare waypoints and car in the game. What I have to do next.
     
  5. BeamNG.Lover2002

    BeamNG.Lover2002
    Expand Collapse

    Joined:
    Nov 6, 2018
    Messages:
    188
    does this mean the update is near?o_Oo_O:rolleyes::eek::D:p:cool::);)
     
  6. ManfredE3

    ManfredE3
    Expand Collapse

    Joined:
    Jan 9, 2016
    Messages:
    2,472
    Must’ve been near last week too by that logic...

     
    • Agree Agree x 1
  7. CN877

    CN877
    Expand Collapse

    Joined:
    Jun 27, 2017
    Messages:
    1,465
    No, it’s because it’s a complex question so he would need to ask people like estama or other programmers for info.

    Although the update is near, it’s been speculated for the 21st of December with pretty good evidence backing it up.
     
  8. BeamNG.Lover2002

    BeamNG.Lover2002
    Expand Collapse

    Joined:
    Nov 6, 2018
    Messages:
    188
    can u link this so called evidence
     
  9. CN877

    CN877
    Expand Collapse

    Joined:
    Jun 27, 2017
    Messages:
    1,465
    tdev said it will be released a couple days before Christmas and someone mentioned large updates are almost always on Fridays so therefore the only date that fits is the 21st. Although there is no way to say for sure, this is the best guess. Also this is incredibly off topic so let’s not discuss this any further.

    (I can’t be bothered to find the links because I’m on mobile but it’s either in update speculation thread or the ‘where are we going?’ Thread)
     
    • Informative Informative x 1
  10. Sameed Tariq

    Sameed Tariq
    Expand Collapse

    Joined:
    Dec 8, 2018
    Messages:
    6
    Guys. I add the 5 pathway points and 3 cars to prefab file. Now i want the cars to follow the waypoint (AI control) in the scenario. How will i do that with the lua code.
     
  11. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,781
    I recommend you to download this scenario and examine how it is made:
    https://www.beamng.com/resources/running-late-gull.6139/
     
  12. Palculator

    Palculator
    Expand Collapse
    Goose-typed

    Joined:
    May 24, 2018
    Messages:
    13
    The correct way to specify a target waypoint for the AI from Python is ai_set_waypoint().
     
    • Informative Informative x 1
  13. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,781
    Eh, since when there has been such python library? I feel horribly outdated here :p
     
  14. Palculator

    Palculator
    Expand Collapse
    Goose-typed

    Joined:
    May 24, 2018
    Messages:
    13
    It's been in development for a few months, mainly exposing BeamNG functionality in a research-oriented way. One of the more fun uses will be developing OpenAI Gym environments for deep learning experiments, though we just now started that with a simple race around the WC USA track. More to come.
     
    • Like Like x 3
  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