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.36 Bug Reporting thread
    Solutions and more information may already be available.

Need Help With AI Nav

Discussion in 'Troubleshooting: Bugs, Questions and Support' started by Dead_Mouse, Jul 16, 2018.

Tags:
  1. Dead_Mouse

    Dead_Mouse
    Expand Collapse

    Joined:
    Jun 27, 2016
    Messages:
    183
    So i have this map i found and i want to add support for AI, but i have a problem. the actual thing you drive on is a TSStatic (pics included). So i want to know how i would or could go about doing this.
     

    Attached Files:

    • screenshot_00007.png
  2. Nadeox1

    Nadeox1
    Expand Collapse
    Spinning Cube
    BeamNG Team

    Joined:
    Aug 5, 2012
    Messages:
    14,697
    Placing waypoints and defining routes (map.json) manually.
    Have a look at some of the official maps.
     
  3. Dead_Mouse

    Dead_Mouse
    Expand Collapse

    Joined:
    Jun 27, 2016
    Messages:
    183
    Can i ask how you do that. iv looked into it and dont fully understand it.
     
  4. Occam's Razer

    Occam's Razer
    Expand Collapse

    Joined:
    Aug 7, 2013
    Messages:
    1,258
    Ah, FlatOut 2/UC. Brings back memories...

    Okay, so, to summarize. When you aren't using or can't use decal roads, you need to use waypoints. They can be found in the editor in the scenetree window, under library>level>BeamNG:
    Screenshot5.png
    Place however many of these you need to create your layout. You don't need to name them anything in particular, but you'll need to type these names into the map.json file in order, so naming conventions aren't a bad idea. You'll also need to scale them according to how wide of a path you want the AI to be able to take:
    Screenshot6.png

    In the map.json file for your level, you'll need something like this:

    Code:
    {
      "segments" : {
    
        "myPath" : {
          "nodes" : ["wp1", "wp2"],
          "drivability" : 1
        }
        }
    }
    Just replace 'wp1' and 'wp2' with the names of whatever waypoints you're using, and add to the list as you need. Just be sure to put double quotes around each name, and a comma between them.
     
    • Agree Agree x 1
    • Informative Informative x 1
  5. Dead_Mouse

    Dead_Mouse
    Expand Collapse

    Joined:
    Jun 27, 2016
    Messages:
    183
    Thanks i really understood that. will try in a bit.
    --- Post updated ---
    Ok so i have a problem. when i did what you say, the AI just goes in circles(video linked). what do i do.
     

    Attached Files:

  6. Occam's Razer

    Occam's Razer
    Expand Collapse

    Joined:
    Aug 7, 2013
    Messages:
    1,258
    It looks like your path is working (at least in part). Bring up the AI control UI app, and set the map debug mode to 'Navigraph'. This should give you a series of green lines showing how your path nodes should connect. I can see the path nodes are working for the straights, but I'm not too sure about the corners. If the corners are somehow being skipped in the path build, that is part of the cause. This debug probably won't actually reveal any problems, but it may be useful for diagnosing pathing issues in the future.

    Now, I should clarify that when you list off the waypoints, it doesn't necessarily require the AI to tackle those waypoints in order. In particular since the path crosses itself at grade, which automatically creates an intersection. To make the AI drive the exact route you want it to, you may need to program the AI's path, and I only know how to do that in a scenario.
     
  7. Dead_Mouse

    Dead_Mouse
    Expand Collapse

    Joined:
    Jun 27, 2016
    Messages:
    183
    Ok so i have a problem. when i did what you say, the AI just goes in circles(video linked). what do i do.
    so here you go
     

    Attached Files:

  8. Occam's Razer

    Occam's Razer
    Expand Collapse

    Joined:
    Aug 7, 2013
    Messages:
    1,258
    Hey, sorry it took so long for me to get back to you. Alright, it looks like the paths are present on the corners, as they should be. Next, I want you to try putting the AI Mode to 'Manual,' and selecting one of the corner waypoints as the 'Target.' Use the Navigraph view to find the waypoint's name so you can find it.

    If there are no problems with the AI paths, the vehicle should go to that waypoint using the shortest accessible path, then stop. If the paths don't work properly, the vehicle will remain stationary.
     
  9. Dead_Mouse

    Dead_Mouse
    Expand Collapse

    Joined:
    Jun 27, 2016
    Messages:
    183
    ok so i just went into the map and i had saved it from before and now all my waypoints are gone. do i have to put them back in manually or what.
    --- Post updated ---
    the map.json file is still in the game files but not in beamng
     
  10. Occam's Razer

    Occam's Razer
    Expand Collapse

    Joined:
    Aug 7, 2013
    Messages:
    1,258
    Okay, to be clear: are you saying that the file still exists, but in a different location than where you left it, or are you saying that the file still exists and is in the correct location, but the waypoints aren't showing up in BeamNG?
     
  11. Dead_Mouse

    Dead_Mouse
    Expand Collapse

    Joined:
    Jun 27, 2016
    Messages:
    183
    the map.json file is in the .zip file that is the map. but the waypoints are gone in beamng and so is the map.json file. its like the map is back to its original from
     
  12. Occam's Razer

    Occam's Razer
    Expand Collapse

    Joined:
    Aug 7, 2013
    Messages:
    1,258
    Oh, when I'm building a map, I usually won't build it inside a .zip file. I usually just drop the raw, uncompressed level into the Documents>BeamNG>levels folder. When you save changes to a map, the files will go there and not into the .zip, so that could be part of the problem.
     
  13. Dead_Mouse

    Dead_Mouse
    Expand Collapse

    Joined:
    Jun 27, 2016
    Messages:
    183
    i dont have a Documents>BeamNG>levels folder(pic inlcuded)
    --- Post updated ---
    so should i just redo the waypoints
     

    Attached Files:

    • Capture.png
  14. Occam's Razer

    Occam's Razer
    Expand Collapse

    Joined:
    Aug 7, 2013
    Messages:
    1,258
    Strange, I would have thought one would be created when you saved. Tell you what, go ahead and create a levels folder in that spot, and then unzip your level into there. Just be sure that there are no extra folders in between the levels folder and whatever directory you have the map.json file in.

    To keep from clogging this part of the forum, go ahead and PM me from here on out.
     
  15. Dead_Mouse

    Dead_Mouse
    Expand Collapse

    Joined:
    Jun 27, 2016
    Messages:
    183
    so should
    ok
     
  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