Repository navigation
Duck under low headroom the navmesh does not mark as crouch - #2235
Draft
sunzenshen wants to merge 2 commits into
Draft
sunzenshen wants to merge 2 commits into
sunzenshen wants to merge 2 commits into
Conversation
CNEOBotLocomotion overrode AdjustPosture with an empty body, carried over from the TF / HL2MP bot template, so bots never crouched to get under something unless the nav area was marked CROUCH. A bot standing under a beam, a light fitting or a lintel it could duck under pushed into it until the stuck monitor fired. AdjustPosture now sweeps a standing hull from step height 32 u towards the move goal. When that hits the world or a prop and a crouched hull does not, the bot holds crouch. Players are ignored, since they move.
The headroom check swept two hulls on every Approach call, every tick for every moving bot. Run it every 0.2 s instead, looking as far ahead as the bot moves before the next check plus a hull width, and let one crouch press (0.3 s) last until the next check. Skip it in a crouch area, where the bot already holds crouch, and in an area at a ladder's foot or top: bots approaching a ladder ducked under the ladder's own frame and failed to mount.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Bots crouch to move only where the navmesh marks an area
NAV_MESH_CROUCH.nav_generatedecides crouch from brush-only traces, so headroom that a static prop or a thin beam takes away (a pipe, a lintel, a seat box overhead) is left unmarked, and a bot of any class walks into it upright and presses until its stuck handling gives up.CNEOBotLocomotionoverridesAdjustPosturewith an empty body ("never crouch to navigate", from the TF / HL2MP bot template), so nothing else makes it duck.ntre_terminal_jgr's spawn exit has such a lintel (area 147): on its master navmesh bots were stuck under it about 100 times a match in an older test (September 30). On the research navmesh used below no bot was stuck there in either arm, and with this PR bots ducked under it 168 times in 5 matches.What this PR does
neo_bot_locomotion.{cpp,h}only.AdjustPosturenow sweeps the bot's standing hull from step height towards its move goal; when that hits the world or a prop and the bot's crouched hull does not, the bot holds crouch. Players are ignored, since they move. The check runs:Its class's own hull heights are used, so a Support ducks only where 59 u fits. This is the half of "too tall to fit" that the planner cannot see: #2199 makes Support and the Juggernaut plan around crouch areas their ducked hull does not fit, which needs the mesh's crouch marks; this PR handles the low headroom that has no mark.
How to test
map ntre_terminal_jgr,neo_bot_quota 12, join spectator.nav_goto_area 147withsv_cheats 1): bots crouch as they pass under it. Onntre_tarmac_ctg(the largest drop in stuck below) compare 1-round matches with and without this PR.Risk
ntre_rogue_ctga crouch window on the upper floor (around (-245, -670, 200)) holds a glass pane over a drop: with this PR alone, bots in one of 5 matches ducked onto the sill and pressed the glass (3 stuck events in the round; without this PR no bot reached the sill). Bots break a vent cover in a crawl gap along their path #2231 ("Break a vent cover in a crawl gap", draft) breaks such a pane; with both, 0 stuck there in 10 matches (5 visits to the sill).Cost
Two hull traces per moving bot every 0.2 s at most (the crouched sweep runs only when the standing one hits), instead of up to two every movement update in an ungated version.
Results
Linux dedicated servers, Release builds of upstream master (at #2203) with test-only logging (kills, stuck events, positions, round and match end), without and with this PR (the "with" build also logged each duck); our research navmeshes. A spawn sweep: every ghost / juggernaut spawn of 9 maps once,
ntre_bullet_tdm4 matches; 1 round, 30 bots, default damage 1.485, 8 wide, both arms of a pair back to back; XP held at one rank tier per match, rotated across spawns. 146 of 146 matches reached match end with 0 asserts and a clean exit. Stuck isOnStuckplusFAIL_STUCKmove failures without the round-start spawn crowd and weapon pickups; ratios are paired with a bootstrap 95 % interval.ntre_tarmac_ctg(10)ntre_terminal_jgr(5)ntre_rogue_ctg(5)Where the bots ducked (a match):
ntre_terminal_jgr128 (168 of them at the spawn exit lintel, area 147, over 5 matches),ntre_sentinel_jgr102,ntre_subsurface_ctg61,ntre_bullet_tdm55 (the seat boxes), 7 to 28 on the others. Onntre_rogue_ctgthe rise is one bot at a wall on the ground floor that never ducked (20 events), plus the window above.ntre_saitama_ctgarea 544, where an ungated version added stuck, had 2 events without and 6 with (3 bots).Debug build (upstream master with this PR and the same logging): one 30-bot match on
ntre_terminal_jgr, match end, 0 asserts, 149 ducks.Not run: a Windows build.
Approaches tried and dropped
ntre_tarmac_ctg(bots approaching a ladder ducked) and on two other maps; stuck while approaching a ladder now goes down instead.nav_generatewould drop the marks on the next regeneration, and every map with a prop overhead needs its own edit.Toolchain
Linked Issues