Skip to content

Bots apply nav pathing penalties based on weapon limits#1805

Merged
sunzenshen merged 5 commits into
NeotokyoRebuild:masterfrom
sunzenshen:bot-shotgunners-prefer-enclosed-spaces
Jun 18, 2026
Merged

Bots apply nav pathing penalties based on weapon limits#1805
sunzenshen merged 5 commits into
NeotokyoRebuild:masterfrom
sunzenshen:bot-shotgunners-prefer-enclosed-spaces

Conversation

@sunzenshen

Copy link
Copy Markdown
Contributor

Description

Bots consider relative level of exposure of a NavArea when deciding paths through the NavMesh

  • Bots with shotguns shy away from NavAreas that have many visibility connections
  • Bots with pistol caliber weapons slightly avoid areas but to a lesser degree
  • Bots with scoped/semi-auto weapons favor exposed NavAreas with long sightlines
  • Generally, a minor penalty is applied for NavArea exposure for bots to avoid wide open exposed NavAreas, unless they have a scoped/battle rifle

Toolchain

  • Windows MSVC VS2022

@sunzenshen sunzenshen requested a review from a team March 9, 2026 03:54
@sunzenshen

sunzenshen commented Mar 9, 2026

Copy link
Copy Markdown
Contributor Author

Gallery of interesting paths now that bots are incentivized to avoid the most wide open areas when traversing the map:

Screenshot 2026-03-08 212054

Bots now generally hug walls as those NavAreas have fewer visibility connections along that edge:

Screenshot 2026-03-08 204006

A bot with a Supa takes the slightly long way around to take advantage of the closed off visibility area:

Screenshot 2026-03-08 205854

The cars, particularly the bus and truck, provide defilade protection when advancing:

Screenshot 2026-03-08 212642 Screenshot 2026-03-08 212750 Screenshot 2026-03-08 214102

The nudge away from exposed NavAreas encourages bots to use the defiladed ponds as cover.

Screenshot 2026-03-08 214130

The NavArea valleys under the rocks also have a reduced visibilty penalty for traversal and are now relatively less costly for bots as path choices:

Screenshot 2026-03-08 214228

An NSF Recon bot with a ZRL advancing to the garden (bottom center) moves to a NavArea that has many visibility connections due to exposure to both the garden and the pathway:

Screenshot 2026-03-08 214750

A bot with a semi-auto battle rifle uses a path that has wide open views:

Screenshot 2026-03-08 214844

Comment thread src/game/server/neo/bot/neo_bot_path_cost.cpp Outdated
Comment thread src/game/server/neo/bot/neo_bot_path_reservation.cpp
@sunzenshen sunzenshen added the Bots Related to bot players label Mar 9, 2026
@sunzenshen sunzenshen force-pushed the bot-shotgunners-prefer-enclosed-spaces branch from 0b2be5c to f6b8450 Compare March 13, 2026 03:32
@sunzenshen sunzenshen force-pushed the bot-shotgunners-prefer-enclosed-spaces branch from f6b8450 to 9d80dd3 Compare March 21, 2026 01:39
@sunzenshen sunzenshen force-pushed the bot-shotgunners-prefer-enclosed-spaces branch from 9d80dd3 to 3e11e84 Compare April 3, 2026 04:58
AdamTadeusz
AdamTadeusz previously approved these changes Apr 4, 2026
@sunzenshen sunzenshen requested a review from a team April 4, 2026 17:05
@sunzenshen sunzenshen force-pushed the bot-shotgunners-prefer-enclosed-spaces branch from 3e11e84 to dcc9d1d Compare April 4, 2026 17:08
@sunzenshen sunzenshen force-pushed the bot-shotgunners-prefer-enclosed-spaces branch from dcc9d1d to 25114e3 Compare May 28, 2026 01:28
@Rainyan Rainyan requested review from Rainyan and removed request for a team June 5, 2026 09:55
@sunzenshen sunzenshen force-pushed the bot-shotgunners-prefer-enclosed-spaces branch from 25114e3 to eca69c6 Compare June 6, 2026 04:30
Comment thread src/game/server/neo/bot/neo_bot_path_cost.cpp Outdated
Comment thread src/game/server/neo/bot/neo_bot_path_cost.cpp Outdated
Comment thread src/game/server/neo/bot/neo_bot_path_cost.cpp Outdated
Comment thread src/game/shared/neo/weapons/weapon_neobasecombatweapon.h Outdated
@Rainyan

Rainyan commented Jun 6, 2026

Copy link
Copy Markdown
Member

@sunzenshen What was the console command to display those orange paths as shown in the screenshots above?

@sunzenshen

Copy link
Copy Markdown
Contributor Author

@sunzenshen What was the console command to display those orange paths as shown in the screenshots above?

nb_debug path

sunzenshen added a commit to sunzenshen/neo that referenced this pull request Jun 6, 2026

@sunzenshen sunzenshen left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Changing the CNEOBotPathCost penalty from distance to cost for weapons enhanced the bot tendency to hide behind cover, which results in bunching up, so I further increased the path reservation penalties to encourage taking alternate paths or to dividing up a room.

This is the script I paste into the console for observation:

(Divided up into forcing TDM mode, speeding up the round resets, showing grenade paths, showing pathing, and speeding up the rounds 2x.)

sv_neo_gamemode_enforcement 3; sv_neo_gamemode_single 0; neo_vote_game_mode 0; mp_restartgame 1;

sv_neo_bot_grenade_debug_behavior 1; mp_chattime 2; sv_neo_preround_freeze_time 2; cl_neo_grenade_show_path 1; sv_neo_grenade_show_path 1;
sv_neo_pvs_cull_roaming_observer 0;

nb_debug_path;
host_timescale 2;

Comment thread src/game/server/neo/bot/behavior/neo_bot_ctg_enemy.cpp
Comment thread src/game/server/neo/bot/neo_bot_path_cost.cpp
Comment thread src/game/server/neo/bot/neo_bot_path_cost.cpp
Comment thread src/game/server/neo/bot/neo_bot_path_reservation.cpp

@Rainyan Rainyan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, cool to see the bots taking more nuanced routes!

- Bots with shotguns shy away from NavAreas that have many visibility connections
- Bots with pistol caliber weapons slightly avoid areas but to a lesser degree
- Bots with scoped/semi-auto weapons favor exposed NavAreas with long sightlines
- Generally, a minor penalty is applied for NavArea exposure for bots to avoid wide open exposed NavAreas
@sunzenshen sunzenshen force-pushed the bot-shotgunners-prefer-enclosed-spaces branch from 9aea8eb to 6f66fde Compare June 12, 2026 01:36
Comment thread src/game/server/neo/bot/neo_bot_path_cost.cpp
@sunzenshen sunzenshen merged commit eb8f4e6 into NeotokyoRebuild:master Jun 18, 2026
7 checks passed
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.

3 participants