1. Issues with the game?
    Check the Known Issues list before reporting!

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

How do I properly use and chart out a AI race with the Race/Path editor?

Discussion in 'Troubleshooting: Bugs, Questions and Support' started by Necronomic, Oct 28, 2021.

  1. Necronomic

    Expand Collapse

    Sep 16, 2020
    I've been wanting to make a street race with multiple cars along a specific route on WCUSA. This path specifically

    I don't want to use AI script path editor because I know if I do, multiple cars will just crash into each other along the exact same line. This Race/Path editor really caught my eye but I have no clue how to use it. Please help.
  2. Dummy1102

    Expand Collapse

    Sep 19, 2021
  3. KèrozéN

    Expand Collapse

    Feb 14, 2014
    So, don't reply uselessly?

    On other hand,
    For avoid crash, maybe try to move slightly checkpoint or make smoother curves?

    Also, there is some youtube tutorials that may be helpful:

    And some official and unofficial docs:
    - https://documentation.beamng.com/tutorials/ai/
    - https://wiki.beamng.com/First_scenario
    - https://steamcommunity.com/app/284160/discussions/2/1643170903492793374/? (read Nadeox's reply on this post, it link to an official AI video)

    I hope that can help you!
    • Like Like x 2
  4. Yash_gamin144

    Expand Collapse

    Apr 24, 2021
    you dunno how to reply properly:)
  5. Gamergull

    Expand Collapse
    BeamNG Team

    Jun 3, 2018

    Making AI races in BeamNG is a tricky thing to do. Hopefully, this process will improve in the future. The Race/Path Editor is very flexible, but also confusing for what to do when you're done. You can write a lengthy Lua script to use the race file, or you can create a flowgraph and use the Race/Path nodes to setup a race. Both methods take time to learn and do, but I've created a graph to help you out! See attached .zip file :) .

    To use it, copy the .zip file into your BeamNG mods/repo folder, load the West Coast USA level, press F11, go to Windows > Gameplay > Flowgraph Editor, and open up aiRace.flow.json . I've included a sample race, so you can press Play, and it will load the included aiRace.race.json and play the race (it can be a bit glitchy, because I made this flowgraph quickly; you might need to press your vehicle reset key if the scenario gets stuck).

    If you want to use your own saved race/path file, make sure that you have 4 start positions, named: start1, start2, start3, start4 . The position start1 is for the player, and the others are for the AI racers. You can name your race/path file as aiRace.race.json and overwrite the old one, or name it whatever you want and edit the File Path node in the flowgraph (at the far left side of the graph view). The current flowgraph supports 3 AI racers, but you can add more by copying, pasting, and linking some nodes. You can also edit the aggression (risk) and avoidance (avoidCars) variables in the Variables tab. I might edit the graph later to make things even more smooth. Let me know how this works for you!

    Edit: You can also open aiRace.race.json in the Race/Path Editor to see how I've set it up. That should help too.

    Edit 2: Fixed stuff in the .zip

    Attached Files:

    #5 Gamergull, Oct 31, 2021
    Last edited: Nov 4, 2021
    • Like Like x 2
  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