Skip to content

Let hurrying bots path through smoke hazards - #2260

Merged
sunzenshen merged 3 commits into
NeotokyoRebuild:masterfrom
sunzenshen:bot-hurry-smoke-penalty-1016
Oct 17, 2026
Merged

sunzenshen merged 3 commits into
NeotokyoRebuild:masterfrom
sunzenshen:bot-hurry-smoke-penalty-1016

Conversation

@sunzenshen

@sunzenshen sunzenshen commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Description

A bot's default route treats every hazard area as impassable (path cost -1). That is right for a bot with time to spare, but a hurrying bot, such as a CTG interceptor chasing the ghost carrier (CNEOBotCtgEnemy, and the CNEOBotAttack chase under it), has nowhere to go when a smoke covers the only way to its target: the chase path comes back partial, ChasePath reports FAIL_NO_PATH_EXISTS, and the bot stands at the smoke's edge until the path fail timer runs out, then tries again with the same result.

With this change:

  • CNEOBotPathCost reads ShouldHurry once when it is built.
  • For a hurrying bot on the default route, a hazard area that is not deadly, such as smoke, costs 20 times as much (ConVar neo_bot_path_penalty_hurry_hazard_multiplier, default 20, the same factor as a navmesh avoid area) instead of being impassable. A detour that costs less still wins, and when none exists the path goes through the smoke and is complete, so the chase no longer stalls.
  • Deadly hazards (frag grenade areas) stay impassable for every bot; the grenade flee already handles them. A new CNEOBotPathReservationSystem::IsAreaDeadlyHazard tells the two kinds apart.
  • Non-hurrying bots, the fastest and safest routes, and bots commanded by a player are unchanged. The tactical monitor already skips the hazard retreat while a bot is in a hurry, so a bot that enters the smoke is not pulled back out.

#2179 (bots avoid the NPC tank) extends the same check to the tank's line-of-sight marks, so a hurrying chaser can push through them too.

Toolchain

  • Linux GCC (dedicated server build)

Linked Issues

A bot's default route treats every hazard area as impassable. When a
hurrying bot, such as a CTG interceptor chasing the ghost carrier, has
no detour around a smoke, its chase path comes back partial and it
stands at the smoke's edge until the path fail timer runs out.

A hurrying bot now pays a large cost multiplier for smoke areas
instead, so it still detours when a reasonable detour exists and goes
through the smoke when none does. Deadly hazards such as frag grenade
areas stay impassable, and only the default route is affected.
Expose the smoke cost multiplier for hurrying bots as
neo_bot_path_penalty_hurry_smoke_multiplier, next to the other path
penalty ConVars, so it can be tuned without a rebuild.
@sunzenshen
sunzenshen marked this pull request as ready for review October 17, 2026 04:37
@sunzenshen
sunzenshen requested a review from sunmachine October 17, 2026 04:37
@sunzenshen sunzenshen added the Bots Related to bot players label Oct 17, 2026
sunzenshen added a commit to sunzenshen/neo that referenced this pull request Oct 17, 2026
Expose the cost multiplier for hurrying bots crossing the tank's sight
as neo_bot_path_penalty_hurry_hazard_multiplier, next to the other path
penalty ConVars, matching the smoke penalty in NeotokyoRebuild#2260.
The multiplier applies to every hazard that is not deadly, not only
smoke, so name the ConVar and its comment for that.
sunzenshen added a commit to sunzenshen/neo that referenced this pull request Oct 17, 2026
A bot chasing on DEFAULT_ROUTE treated every area the tank can see as
impassable, so a hurrying interceptor stalled when no detour existed.
The turret mark is no longer also written as a deadly mark, so the
hurry penalty for hazards that are not deadly (NeotokyoRebuild#2260) now covers it:
in a hurry a bot crosses the tank's sight at a large path cost and
still detours when a detour exists. Grenades and the tank's own area
(run over) stay deadly, and every other hazard check counts the
turret mark as before.

@sunmachine sunmachine left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

@sunzenshen
sunzenshen merged commit 03ffcff into NeotokyoRebuild:master Oct 17, 2026
9 checks passed
sunzenshen added a commit to sunzenshen/neo that referenced this pull request Oct 17, 2026
A bot chasing on DEFAULT_ROUTE treated every area the tank can see as
impassable, so a hurrying interceptor stalled when no detour existed.
The turret mark is no longer also written as a deadly mark, so the
hurry penalty for hazards that are not deadly (NeotokyoRebuild#2260) now covers it:
in a hurry a bot crosses the tank's sight at a large path cost and
still detours when a detour exists. Grenades and the tank's own area
(run over) stay deadly, and every other hazard check counts the
turret mark as before.
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