From 72ae446dd243675120435e008fcc8f2752a7ca66 Mon Sep 17 00:00:00 2001 From: Alan Shen Date: Sat, 26 Sep 2026 19:06:00 -0600 Subject: [PATCH] NAV_MESH_AVOID annotation penalizes bot path costs --- src/game/server/neo/bot/neo_bot_path_cost.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/game/server/neo/bot/neo_bot_path_cost.cpp b/src/game/server/neo/bot/neo_bot_path_cost.cpp index f909e85492..daab086208 100644 --- a/src/game/server/neo/bot/neo_bot_path_cost.cpp +++ b/src/game/server/neo/bot/neo_bot_path_cost.cpp @@ -9,6 +9,9 @@ ConVar neo_bot_path_around_friendly_cooldown("neo_bot_path_around_friendly_cooldown", "2.0", FCVAR_CHEAT, "How often to check for friendly path dispersion", true, 0, true, 60); +ConVar neo_bot_path_penalty_avoid_multiplier("neo_bot_path_penalty_avoid_multiplier", "20.0", FCVAR_CHEAT, + "Penalty multiplier for navmesh avoid areas in pathfinding", true, 1.0f, false, 0.0f); + ConVar neo_bot_path_penalty_jump_multiplier("neo_bot_path_penalty_jump_multiplier", "100000.0", FCVAR_CHEAT, "Maximum penalty multiplier for jump height changes in pathfinding", true, 0.01f, false, 0.0f); @@ -225,6 +228,11 @@ float CNEOBotPathCost::operator()(CNavArea* baseArea, CNavArea* fromArea, const } } } + + if (area->HasAttributes(NAV_MESH_AVOID) || (ladder && fromArea->HasAttributes(NAV_MESH_AVOID))) + { + cost *= neo_bot_path_penalty_avoid_multiplier.GetFloat(); + } // ------------------------------------------------------------------------------------------------ if (area->HasAttributes(NAV_MESH_FUNC_COST))