Skip to content

Conversation

@sunzenshen
Copy link
Contributor

Description

When bots are in the OnStuck behavior, bots record where they got stuck and which adjacent NavArea node they were going to in the path reservation system, so that other bots can avoid those trouble areas. This is intended to help smooth out bot behaviors in maps where the navmesh generation has not been cleaned up.

Toolchain

  • Windows MSVC VS2022

@sunzenshen sunzenshen requested a review from a team January 10, 2026 07:27
@sunzenshen
Copy link
Contributor Author

One way to test this behavior is to cherry pick the bot following PR #1345, on a branch that doesn't have the NavArea jump eligibility fix #1558, and loading up ntre_oilstain_ctg along with applying the following console script:

sv_neo_bot_cmdr_enable 1;
sv_neo_bot_cmdr_debug_pause_uncommanded 1;
neo_ctg_round_timelimit 99;
bot_class 1;

The above script enables bot commanding, increases the time limit, and forces the bots to choose assault class.

Then at the part of the map where there was a problematic jump clearance issue with the truck trailer, commanding the bots to go to the other side of the trailer leads to them getting stuck:

bot-nav-avoid-onstuck-navareas-start-training-1.mp4

After a few iterations of commanding the bots to cross over to the other side of the trailer, eventually the bots choose paths that avoid common sticking points:

bot-nav-avoid-onstuck-navareas-after-training-2.mp4

The area avoidance penalties can be disabled at any point to revert to the original pathing behavior for comparison:

bot-nav-avoid-onstuck-navareas-after-training-disable-penalty-3.mp4

@sunzenshen sunzenshen added the Bots Related to bot players label Jan 10, 2026
@sunzenshen sunzenshen force-pushed the bot-onstuck-navarea-avoidance branch from 124b9cd to ef6060f Compare January 13, 2026 01:39
@sunzenshen sunzenshen force-pushed the bot-onstuck-navarea-avoidance branch from ef6060f to 4228d58 Compare January 20, 2026 06:37
@sunzenshen
Copy link
Contributor Author

Clicked the rebase branch in the GitHub web UI, so this rebased build should have the bot commands feature.

One can test bots getting stuck awkward locations in maps by using the following commands:

sv_neo_bot_cmdr_enable 1;
sv_neo_bot_cmdr_debug_pause_uncommanded 1;
neo_ctg_round_timelimit 99;

Then one can press use on the paused teammate bots to get them to follow you, and then use the ping button to have bots walk between different areas that might be suspicious.

One example area to try this kind of testing is the Rabbit-Frog spawn near the large crane/lifter model. Because the NavMesh generation didn't properly implement nav_crouch annotations at the crane/lifter base, the bots can get stuck running into the crane base:

bot-nav-avoid-onstuck-navareas-saitama-crane.mp4

(In the above test, one side already had OnStuck penalties, while the other side did not, as at this part of the clip I had already executed a few move commands)

@sunzenshen
Copy link
Contributor Author

Intentionally NOT rebasing on top of #1601, in order to make this easier to test.

This proposal I expect to be a bit more controversial since it's both a cheat and a bandaid on top of awkward NavMeshes, so open to feedback on whether this is even an approach we want to consider at this point.

Comment on lines 71 to 73
CUtlMap<int, ReservationInfo> m_Reservations[MAX_TEAMS];
CUtlMap<EHANDLE, BotReservedAreas_t> m_BotReservedAreas;
CUtlMap<int, int> m_AreaPathCounts[MAX_TEAMS];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated to this PR, but pointing out that we might wanna use TEAM__TOTAL (4) instead of MAX_TEAMS (32) for the map sizes.

@Rainyan Rainyan requested a review from a team January 20, 2026 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bots Related to bot players

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants