1. Trouble with the game?
    Try the troubleshooter!

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

    Dismiss Notice
  3. Before reporting issues or bugs, please check the up-to-date Bug Reporting Thread for the current version.
    0.35 Bug Reporting thread
    Solutions and more information may already be available.

Does AI manual mode work?

Discussion in 'Troubleshooting: Bugs, Questions and Support' started by hw06531, Jul 12, 2017.

  1. hw06531

    hw06531
    Expand Collapse

    Joined:
    Jul 6, 2017
    Messages:
    8
    In WIKI, Manual mode does not work currently.

    Is the t Manual mode working properly in v0.9?

    Can AI cars move to the determined path?
     
  2. Nadeox1

    Nadeox1
    Expand Collapse
    Spinning Cube
    BeamNG Team

    Joined:
    Aug 5, 2012
    Messages:
    14,696
    Manual mode cannot be used via the app currently, but via scripts (for example in a scenario, where you want the AI to drive along specific paths).

    See below
     
    #2 Nadeox1, Jul 12, 2017
    Last edited: Jul 19, 2017
  3. hw06531

    hw06531
    Expand Collapse

    Joined:
    Jul 6, 2017
    Messages:
    8
    BUT, I don't know how to. In Crush junctions mod, he implemented it really well as I wanted. There is any reference or video or anything for tutorial?

    https://www.beamng.com/resources/crash-junctions.1558/
     
  4. Nadeox1

    Nadeox1
    Expand Collapse
    Spinning Cube
    BeamNG Team

    Joined:
    Aug 5, 2012
    Messages:
    14,696
    There is no documentation on that, as the thing is still under work.
    What you can do is taking other scenarios as example.
     
  5. hw06531

    hw06531
    Expand Collapse

    Joined:
    Jul 6, 2017
    Messages:
    8
    I see, When adjusting an AI car in a scenario, is there any other parameter? Can I adjust the speed?
    I find aggression parameter is related car speed. But I cannot adjust the speed accurately.
     
  6. Nadeox1

    Nadeox1
    Expand Collapse
    Spinning Cube
    BeamNG Team

    Joined:
    Aug 5, 2012
    Messages:
    14,696
    Aggression is basically how much the AI will dare when driving.
    Higher means it will take more risks. Lower values will make it go for a more normal driving.
    You can see the range values in the 'AI Control App'.

    The speed and all that stuff is auto-calculated based on the road and that value.
     
  7. hw06531

    hw06531
    Expand Collapse

    Joined:
    Jul 6, 2017
    Messages:
    8

    Can I change it through lua coding of an AI car?
     
  8. retrospek

    retrospek
    Expand Collapse
    BeamNG Team

    Joined:
    Feb 23, 2016
    Messages:
    19
    Hey hw,

    contrary to what it says in the wiki (which needs to be updated) manual mode does work through the AI app, albeit for simple paths.

    To use it first select "Manual" from the AI app -> "AI Mode" drop down list. Then select a destination from the "Target -> Map" drop down list. The list of destinations are the nodes in your map.

    If for any reason the AI cannot find a path to your selected destination you will get a message in the top left corner of your screen telling you so.



    To control the speed of the AI vehicle for your chosen path you have two options. The first is to adjust the "Risk" Parameter in the AI app. The lower the risk the more conservatively the AI will tend to drive through to your destination.

    The second is to use the Route Speed settings in the AI app. Select a speed, and then select a Mode. There are two modes. The "limit" mode will make drive at a speed less than or equal to your selected speed value, the "set" mode will force the AI to drive at your selected speed value.




    You can also manually specify the exact path (along with other parameters) that you would like an AI vehicle to follow by using the following API in the in-game console (which you bring up by pressing "~" while on a map). This is also used by scenario creators.

    Code:
    ai.driveUsingPath(arguments)
    
    where "arguments" is a Lua table with the following entries
    
    arguments = {
        wpTargetList -> 'a table of waypoint names (i.e. strings)'
        noOfLaps -> 'a number value'
        aggression -> 'a number value'
        driveInLane -> 'on' or 'off'
        routeSpeed -> 'a number value'
        routeSpeedMode -> 'limit' or 'set' }
    Now lets go through them to explain exactly what each one does:

    ### wpTargetList (a Lua table)
    A list of the waypoints specifing the path the AI vehicle should follow
    Example: wpTargetList = {'wp1', 'wp2', 'wp3', 'wp4'}

    Where you should replace 'wp1', 'wp2', etc. with the choosen waypoint names of your map.
    For example in your map in the picture you shared 'autojunction_1' is one of the waypoint name.

    NOTE:
    The AI will choose the shortest path between any two consecutive waypoints in 'wpTargetList'.
    If you find that despite the fact that you have specified a route the AI is not following it as you would like, you should constrain it further by adding more waypoints in 'wpTargetList'.
    If you would like to create a closed circuit as would be the case for a race on a race track you should have the first and last waypoints in the wpTargetList be the same

    ### noOfLaps (a number value)
    Specifies the number of laps the AI will do on a closed (!!) circuit (reminder: a closed circuit is one in which the first and last waypoints in 'wpTargetList' are the same)
    Example: noOfLaps = 5
    (If the circuit is not closed specifying the number of laps will have no effect. The AI vehicle will just follow the path from the first to the last waypoint and stop there.)

    ### aggression (a number value between 0.42 and 1.44, this range is possibly subject to change in future updates)
    This is exactly the same as the Risk parameter you find on the AI app and it specifies how close to the traction (see tire friction) limits the AI vehicle will attempt to drive. A higher aggression value will push the AI vehicle to drive faster i.e. brake harder, accelerate harder, make turns at higher speeds and generally come closer to its traction limits at the same time making it more risky. Higher values means riskier.
    Example: aggression = 1.3

    ### routeSpeed (a number value) and routeSpeedMode ('limit' or 'set')
    When routeSpeedMode = 'limit' then the AI vehicle will not exceed the speed specified by routeSpeed (in meters/sec). When routeSpeedMode = 'set' the AI vehicle will act to meet the speed specified by routeSpeed (meters/sec). (Again these settings can also be found on the AI app).
    Example: routeSpeed = 5, routeSpeedMode = 'limit'

    Putting all the above together in an Example:

    Code:
    ai.driveUsingPath{ wpTargetList = {'wp1', 'wp2', 'wp3', 'wp4', 'wp5', wp1}, noOfLaps = 5, aggression = 1.3 }
    In this example the AI vehicle will follow the route from 'wp1' through 'wp2'-'wp5' and back to 'wp1', doing 5 laps around the specified route.

    To use this press "~" (without the quotes) while on a map. This will bring up the in-game console. At the bottom left corner of the console you will find a drop down list with four options. Go ahead and select BeamNG - Vehicle Lua.



    To the right of that you will see a blank space with a blinking cursor. Go ahead and paste (or input) the above command replacing the arguments with your own options as you would like them.

    Alternatively, you can save the above command in a file, for example my_route.txt, in the beamNG game folder.

    And in the in-game console window (under BeamNG - Vehicle Lua) write dofile('my_route.txt') (Notice the quotes around the file name!). You can change (and save) the file at any time and re-run it at any time.
     
    • Like Like x 3
    • Informative Informative 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