Bots apply nav pathing penalties based on weapon limits#1805
Bots apply nav pathing penalties based on weapon limits#1805sunzenshen wants to merge 5 commits into
Conversation
| "How often to check for friendly path dispersion", false, 0, false, 60); | ||
|
|
||
| ConVar neo_bot_path_penalty_jump_multiplier("neo_bot_path_penalty_jump_multiplier", "100.0", FCVAR_CHEAT, | ||
| ConVar neo_bot_path_penalty_jump_multiplier("neo_bot_path_penalty_jump_multiplier", "1000.0", FCVAR_CHEAT, |
There was a problem hiding this comment.
Now that NavArea pathing costs are slightly elevated, need to bump up the penalty for jump paths to match the relatively increased baseline penalty costs.
| "Path selection penalty added to a nav area each time a bot dies moving through that area.", true, 0, false, 0); | ||
|
|
||
| ConVar neo_bot_path_reservation_onstuck_penalty("neo_bot_path_reservation_onstuck_penalty", "10000", FCVAR_NONE, | ||
| ConVar neo_bot_path_reservation_onstuck_penalty("neo_bot_path_reservation_onstuck_penalty", "1000", FCVAR_NONE, |
There was a problem hiding this comment.
When working on ladder climbing, I noticed that the previous penalty cost was so heavy that bots would fail to climb a challenging ladder a couple times and then never touch that ladder again for the rest of the match. So I figured toning down this penalty was warranted.
0b2be5c to
f6b8450
Compare
f6b8450 to
9d80dd3
Compare
9d80dd3 to
3e11e84
Compare
3e11e84 to
dcc9d1d
Compare
dcc9d1d to
25114e3
Compare
- 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
25114e3 to
eca69c6
Compare
|
@sunzenshen What was the console command to display those orange paths as shown in the screenshots above? |
|
There was a problem hiding this comment.
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;
| { | ||
| CNEOBotPathCompute( me, m_path, pGhostCarrier->GetAbsOrigin(), DEFAULT_ROUTE ); | ||
| // FASTEST_ROUTE: don't waste chase time looking for cover | ||
| CNEOBotPathCompute( me, m_path, pGhostCarrier->GetAbsOrigin(), FASTEST_ROUTE ); |
There was a problem hiding this comment.
With DEFAULT_ROUTE on this PR, bots don't chase ghost carriers fast enough as they sneak behind cover which wastes pursuit time. I decided that it's better to risk bunching up while taking the FASTEST_ROUTE, and then let the dispatch to the Attack behavior above to use DEFAULT_ROUTE when actually attacking enemies. So pursuers beeline as fast as possible to the ghoster until they contact the enemy, and then split up along different paths at that point.
| ConVar neo_bot_path_penalty_jump_multiplier("neo_bot_path_penalty_jump_multiplier", "100.0", FCVAR_CHEAT, | ||
| "Maximum penalty multiplier for jump height changes in pathfinding", false, 0.01f, false, 1000.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); |
There was a problem hiding this comment.
Further increasing the jump penalty as I increased the path reservation penalty below.
| { | ||
| // Weapons that don't have max first shot accuracy | ||
| const float exposurePenalty = neo_bot_path_penalty_exposure_pistol.GetFloat(); | ||
| cost += visibleAreaCount * exposurePenalty; |
There was a problem hiding this comment.
Changing the penalty addition to cost enhanced the effect of bots bunching up together behind cover, so I tweaked the other penalties to encourage bots to spread out if they are in the same room.
| ConVar neo_bot_path_reservation_penalty("neo_bot_path_reservation_penalty", "100", FCVAR_NONE, | ||
| "Pathing cost penalty for a reserved area.", true, 0, true, 1000000); | ||
| ConVar neo_bot_path_reservation_penalty("neo_bot_path_reservation_penalty", "10000", FCVAR_NONE, | ||
| "Pathing cost penalty for a reserved area.", true, 0, false, 0); |
There was a problem hiding this comment.
Encourage bots to spread out in a room if they are traversing the same room as other bot teammates. Otherwise bots bunch up together to take the same covered path.
Rainyan
left a comment
There was a problem hiding this comment.
LGTM, cool to see the bots taking more nuanced routes!










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