Bot path reservation dispersal improvements - #2132
sunzenshen wants to merge 1 commit into
Conversation
- 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
left a comment
There was a problem hiding this comment.
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() ); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
Ironically, logging pointed out that these values often ended up being identical between bots. (The serial number was part of a larger ID value.)
Description
Primarily addresses a myriad of issues with the team-specific lookup and penalization of congested routes:
Toolchain
Linked Issues