Skip to content

Bot path reservation dispersal improvements - #2132

Open
sunzenshen wants to merge 1 commit into
NeotokyoRebuild:masterfrom
sunzenshen:bot-ctg-path-reservation-fix-pr
Open

sunzenshen wants to merge 1 commit into
NeotokyoRebuild:masterfrom
sunzenshen:bot-ctg-path-reservation-fix-pr

Conversation

@sunzenshen

Copy link
Copy Markdown
Contributor

Description

Primarily addresses a myriad of issues with the team-specific lookup and penalization of congested routes:

  • fixed bots using the same serial prefix as a reservation index (the reservation system was treating all teammates as the same individual)
  • clear reservations on death
  • penalize excessively long detours

Toolchain

  • Windows MSVC VS2022

Linked Issues

- fixed bots using the same serial prefix as a reservation index (the reservation system was treating all teammates as the same individual)
- clear reservations on death
- penalize excessively long detours
@sunzenshen
sunzenshen requested a review from a team September 13, 2026 03:31
@sunzenshen sunzenshen added the Bots Related to bot players label Sep 13, 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.

This PR fixes the bookkeeping behind the teammate dispersal path reservations and changes how the penalty scales with the number of teammates on a route.

float avoidPenalty = neo_bot_path_reservation_enable.GetBool()
? CNEOBotPathReservations()->GetAreaAvoidPenalty( area->GetID() )
: 0.0f;
float avoidPenalty = CNEOBotPathReservations()->GetAreaAvoidPenalty( area->GetID() );

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.

Would have been zero anyway if the system was disabled.

"Base penalty for calculating inverse traversal penalty for scoped weapons", true, 1.0f, false, 0.0f);

ConVar neo_bot_path_visibility_exposure_enable("neo_bot_path_visibility_exposure_enable", "1", FCVAR_NONE,
"Enable visibility-exposure pathing penalties", true, 0, true, 1);

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.

Separate team-based path penalties from equipment based penalties.

if (nFriendly > 0)
{
// Discourage team clustering: (n^2 * penalty)
cost += nFriendly * nFriendly * neo_bot_path_reservation_penalty.GetFloat();

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.

Instead of using a huge flat penalty, power scale (n^2) based on number of friendlies on the path.

// Intended for use by ghost carrier team, to emulate a team that knows where enemies are likely to ambush
// Compensates for bots' lack of meta knowledge by making them prefer routes not reserved by enemies
// Adheres to cheat against bots but not against humans philosophy by not considering human players' positions
cost += CNEOBotPathReservations()->GetPredictedFriendlyPathCount(area->GetID(), GetEnemyTeam(m_me->GetTeamNumber())) * neo_bot_path_reservation_penalty.GetFloat() * 2;

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.

Consolidated with team-based penalties above.

// Less function for EHANDLE in m_BotReservedAreas
inline static bool EHandleLessFunc(const EHANDLE &lhs, const EHANDLE &rhs)
{
return lhs.GetSerialNumber() < rhs.GetSerialNumber();

@sunzenshen sunzenshen Sep 13, 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.

Ironically, logging pointed out that these values often ended up being identical between bots. (The serial number was part of a larger ID value.)

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.

1 participant