Tonight, I was playing around with bots on pl_erosion_a6 (because I have a lot of time on my hands, like custom maps, and like watching bots) and I encountered a bit of an oddity.
I've seen something like this before, where despite having perfectly valid spawn exits, bots decide that the way the crow flies (the closest part of which in this particular instance happens to be that corner of the spawn) is the best way - and their AI refuses to tell them that the door nearby is actually working perfectly. I've seen this issue before on even official maps like Badwater, so the fact that it's a custom map has no bearing on this glitch.
First, I thought it was a nav mesh issue. The nav mesh generator is weird - sometimes it loves making these connections that make no physical sense, and sometimes it just doesn't like to connect two adjacent locations. With nav_edit 1 on (on a different match to make sure):
Connections look fine to me. Corner is correctly identified and everything.
It wasn't until I turned on tf_show_mesh_decorations 1 that the problem becomes more apparent:
Despite the fact that third is capped (see hud), the mesh is showing the logic for second point being the blue respawn area.
So with this, we can identify that the nav mesh is not correctly being updated. But what causes this?
This, I wasn't able to get a screenshot of, so I'll need to take a moment to explain something about how payload works on a technical level. When a blue player touches the trigger_capture_area nestled around the cart, an impulse is sent to the cart to move forward. Then, the payload checks to see if a red player is standing nearby. If so, it blocks further impulses to move forward until the red player is dealt with or the blue player leaves the trigger_capture_area. However, it does not block the first impulse to move forward. Which means that if the payload is a fraction (I'm talking fractions of hammer units) away from the capture path_track node, it will still move forward and capture, despite a red player being present on the payload.
This isn't the main issue causing what's happening here, but an aside that leads to the real issue. When a blue player leaves the trigger_capture_area, the cart decelerates to a quick stop. The stop isn't sudden, though, so there's a chance that it could still be moving onto, say, a path_track node that captures an area despite the deceleration process. If you want to recreate this, go onto a payload map, push the cart as close as you can to a checkpoint without capturing it, and then continuously move in and quickly outside of the cart's push zone. If you push it just the right amount, the cart will cross the capture point, and nobody will be standing inside the capture zone. THIS is the root cause of my initial issue. For some strange reason, this capture (which, by the way, won't show up in the kill feed or console, since nobody was standing inside of the capture zone when the point was captured) is why the nav mesh won't properly update, leaving the bots to obtain a sudden fascination with one particular corner of the spawn.
What can be done about this? I have no idea. Why does it happen? Beats me. Why am I reporting this? I dunno, I thought it would be a cool little thing to share that I've discovered. Is it relevant? Most likely not, since this primarily affects bots and I haven't yet seen any major other bugs stemming from this one.
Either way, thanks for reading!
I've seen something like this before, where despite having perfectly valid spawn exits, bots decide that the way the crow flies (the closest part of which in this particular instance happens to be that corner of the spawn) is the best way - and their AI refuses to tell them that the door nearby is actually working perfectly. I've seen this issue before on even official maps like Badwater, so the fact that it's a custom map has no bearing on this glitch.
First, I thought it was a nav mesh issue. The nav mesh generator is weird - sometimes it loves making these connections that make no physical sense, and sometimes it just doesn't like to connect two adjacent locations. With nav_edit 1 on (on a different match to make sure):
Connections look fine to me. Corner is correctly identified and everything.
It wasn't until I turned on tf_show_mesh_decorations 1 that the problem becomes more apparent:
Despite the fact that third is capped (see hud), the mesh is showing the logic for second point being the blue respawn area.
So with this, we can identify that the nav mesh is not correctly being updated. But what causes this?
This, I wasn't able to get a screenshot of, so I'll need to take a moment to explain something about how payload works on a technical level. When a blue player touches the trigger_capture_area nestled around the cart, an impulse is sent to the cart to move forward. Then, the payload checks to see if a red player is standing nearby. If so, it blocks further impulses to move forward until the red player is dealt with or the blue player leaves the trigger_capture_area. However, it does not block the first impulse to move forward. Which means that if the payload is a fraction (I'm talking fractions of hammer units) away from the capture path_track node, it will still move forward and capture, despite a red player being present on the payload.
This isn't the main issue causing what's happening here, but an aside that leads to the real issue. When a blue player leaves the trigger_capture_area, the cart decelerates to a quick stop. The stop isn't sudden, though, so there's a chance that it could still be moving onto, say, a path_track node that captures an area despite the deceleration process. If you want to recreate this, go onto a payload map, push the cart as close as you can to a checkpoint without capturing it, and then continuously move in and quickly outside of the cart's push zone. If you push it just the right amount, the cart will cross the capture point, and nobody will be standing inside the capture zone. THIS is the root cause of my initial issue. For some strange reason, this capture (which, by the way, won't show up in the kill feed or console, since nobody was standing inside of the capture zone when the point was captured) is why the nav mesh won't properly update, leaving the bots to obtain a sudden fascination with one particular corner of the spawn.
What can be done about this? I have no idea. Why does it happen? Beats me. Why am I reporting this? I dunno, I thought it would be a cool little thing to share that I've discovered. Is it relevant? Most likely not, since this primarily affects bots and I haven't yet seen any major other bugs stemming from this one.
Either way, thanks for reading!