Bots Stuck

Discussion in 'Mapping Questions & Discussion' started by mairoz, Jul 26, 2017.

  1. mairoz

    mairoz L1: Registered

    Messages:
    17
    Positive Ratings:
    2
    I was trying to test my first map with bots but they are running and jumping towards wall why is that?
     
  2. Da Spud Lord

    aa Da Spud Lord L0: Crappy Member

    Messages:
    758
    Positive Ratings:
    517
    Have you generated a navigation mesh? If not, use the console commands sv_cheats 1 followed by nav_generate to create one.

    Also, while testing a map with bots for functionality and gamemode logic is fine, don't design your layout or balance your map around bot tests, as bots are a poor representation of human behavior and aren't good at playing certain classes.
     
  3. mairoz

    mairoz L1: Registered

    Messages:
    17
    Positive Ratings:
    2
    yes i have created navigation file and they used to work fine but now they don't work i just need them to get on the point so i can test my thing if there was no nav file they would just sit and not move
     
  4. Da Spud Lord

    aa Da Spud Lord L0: Crappy Member

    Messages:
    758
    Positive Ratings:
    517
    In that case, your problem is that bots cannot plot a course to the control point, for whatever reason. When this happens, bots will walk in a straight line towards the point, with no regard for walls or other obstacles. Use the cheat command nav_edit 1 and check on the floor where the bots are jumping against the wall. You should see a mesh of boxes that looks something like this:
    [​IMG]
    Each of those boxes is called an "area" and represents an area of the map that a bot can walk. If you don't see that, that means the mesh is missing or the automatic mesh generator missed that area. This can be fixed by covering the floor of the area that doesn't have a mesh with nav_mark_walkable marks, which look like wireframe purple pyramids. Space these every few hundred hammer units. Then use nav_generate_incremental. This should fix that problem.

    If that's not the problem, then look for the area(s) closest to the wall in question. Is there a connection through that wall? A connection connects two areas and indicates that bots can move from one area to the other. These connections are denoted by a light or dark blue line. If you see a light or dark blue line that goes through that wall, then follow these steps to remove the connection: Aim at the first area, use nav_mark, aim at the second area, and then use nav_disconnect.

    After any and all changes to the navigation mesh, make sure you use the command nav_analyze to save the mesh and compute certain data that bots need to function well.
     
  5. mairoz

    mairoz L1: Registered

    Messages:
    17
    Positive Ratings:
    2
    Thank you that is very helpful i will try that but the area where they start jumping towards wall is area where you normally can not go (without teleport) but they go there using teleport (built in map) but there is exit to the control point but they are still jumping opposite wall to the giant hole which leads to the control point and that wall is near respawnroom.
     
  6. Da Spud Lord

    aa Da Spud Lord L0: Crappy Member

    Messages:
    758
    Positive Ratings:
    517
    In that case, you definitely need the first solution. The automatic navmesh generator works by flood-filling out from spawnpoints, so areas of the map with no info_player_teamspawn entities (such as teleport rooms) won't get a navmesh. Additionally, bots won't take teleporters on purpose, and they're tricky to get into the navmesh. You'll either need to tell bots to avoid the teleporter, or generate a mesh in the teleport room using the above technique and follow it up by linking up the teleports using nav_mark and nav_connect. (If that doesn't work, try using the splice tool to link the areas instead.) However, areas can only be connected if they are horizontally or vertically aligned- you can't create diagonal connections. If possible, in your VMF, try to line up the teleporter entrances and exits so that linking them becomes easier. If that isn't doable, then try creating rooms for the navmesh to go through, but are actually inaccessible to players, like seen here:
    Screenshot_20170726-222754~2.png
    The red nav mesh rooms can be look like whatever you want, as the player should never be able to access them. They're only there to allow you to link up the navmesh. Bots will try to walk towards those nav mesh rooms along the navmesh, accidentally take the teleporter, and end up at where they were trying to go, so it should work fine. Make sure your connections are one-way connections so that the bots don't try to go through the teleporter backwards.
     
Tags: