Skip to content

When there are no cap zones for their team, bots search for enemy - #2073

Open
sunzenshen wants to merge 4 commits into
NeotokyoRebuild:masterfrom
sunzenshen:bot-ctg-seek-and-destroy-if-no-cap-zones
Open

When there are no cap zones for their team, bots search for enemy#2073
sunzenshen wants to merge 4 commits into
NeotokyoRebuild:masterfrom
sunzenshen:bot-ctg-seek-and-destroy-if-no-cap-zones

Conversation

@sunzenshen

Copy link
Copy Markdown
Contributor

Description

Some CTG maps have no cap zones for one team, so as a placeholder that team should just search the map for the enemy, and try to recover the ghost if the enemy collects the ghost.

Toolchain

  • Windows MSVC VS2022

@sunzenshen
sunzenshen requested a review from a team August 17, 2026 01:15
@sunzenshen sunzenshen added the Bots Related to bot players label Aug 17, 2026

if (!m_ctgCheckTimer.HasStarted() || m_ctgCheckTimer.IsElapsed())
{
m_ctgCheckTimer.Start(mp_chattime.GetFloat());

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.

Is the idea to make sure this check runs at least once before freeze-time ends? perhaps the freeze time length convar would be a better choice here, mp_chattime only affects how long until the map is changed after the winner of the match is determined. Also we're on the server, could probably wrap this in a function and call from gamerules whenever the round status changes to live, again assuming you just care about this running once each round before freeze time ends.

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.

Then again DG added some functionality where caps can be disabled with map logic, but again can probably recompute again whenever that logic runs instead of on a timer

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.

Bots in their current state seem to react to caps being toggled mid game fine on master so I think it'll be OK.
I agree a different variable to chattime would probably be more suitable here

@sunzenshen sunzenshen Aug 18, 2026

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.

Decided that it wasn't that big of a performance drop if bots constantly check the cap zones only during freezetime, especially if we skip the seek and destroy logic during freezetime. Rationale is that complicating the class with yet another timer/event is more mental overhead than benefit in performance.

Some example test criteria:

  • nb_debug behavior to check current bot state machine
  • checked that seek and destroy still works on a TDM map like bullet'
  • checked that bots can still be collected as followers during freezetime as that behavior dispatches through CNEOBotScenarioMonitor
  • checked that JGR mode behavior still activates
  • checked that CTG mode behavior still activates

Also checked that forcing TDM still works:
sv_neo_gamemode_enforcement 3; sv_neo_gamemode_single 0; neo_vote_game_mode 0; mp_restartgame 1;

On isolation specifically:

  • Checked that spawning in the house one can command a bot to be a follower to verify that CNEOBotScenarioMonitor is not blocked
  • Checked that outside spawn bots do try to pick up the ghost if they somehow survive all the way up the hill
  • Checked that house spawn bots use the basic seek and destroy behavior

@sunzenshen
sunzenshen force-pushed the bot-ctg-seek-and-destroy-if-no-cap-zones branch from f0532fc to 79c718e Compare August 18, 2026 06:46
@sunzenshen
sunzenshen force-pushed the bot-ctg-seek-and-destroy-if-no-cap-zones branch from 79c718e to 28cd86c Compare August 21, 2026 06:49
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