-
Notifications
You must be signed in to change notification settings - Fork 22
Bots can attack toward an optional coordinate #2000
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -103,7 +103,7 @@ class CSearchForCoverFromGrenade : public ISearchSurroundingAreasFunctor | |
| const CNavArea *grenadeArea = TheNavMesh->GetNavArea( m_grenade->GetAbsOrigin() ); | ||
| if ( grenadeArea ) | ||
| { | ||
| if ( area->IsPotentiallyVisible( grenadeArea ) ) | ||
| if ( grenadeArea->IsPotentiallyVisible( area ) ) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For this PR I took some time to review whether the directionality of observation made since for every call for IsPotentiallyVisible and IsCompletelyVisible. |
||
| { | ||
| // area is exposed to grenade line of sight | ||
| return true; | ||
|
|
@@ -212,14 +212,14 @@ ActionResult< CNEOBot > CNEOBotRetreatFromGrenade::Update( CNEOBot *me, float in | |
| bool bIsExposed = false; | ||
| if ( grenadeArea && me->GetLastKnownArea() ) | ||
| { | ||
| if ( me->GetLastKnownArea()->IsPotentiallyVisible( grenadeArea ) ) | ||
| if ( grenadeArea->IsPotentiallyVisible( me->GetLastKnownArea() ) ) | ||
| { | ||
| bIsExposed = true; | ||
| } | ||
| } | ||
|
|
||
| // track projectile and relation to escape destination every update | ||
| if ( !m_coverArea || ( grenadeArea && m_coverArea->IsPotentiallyVisible( grenadeArea ) ) ) | ||
| if ( !m_coverArea || ( grenadeArea && grenadeArea->IsPotentiallyVisible( m_coverArea ) ) ) | ||
| { | ||
| m_coverArea = FindCoverArea( me ); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -192,38 +192,38 @@ ConVar sv_neo_bot_cloak_detection_bonus_assault_motion_vision("sv_neo_bot_cloak_ | |
| "Bot cloak detection bonus for assault class detecting movement with motion vision", true, 0, true, 100); | ||
|
|
||
| // Support has difficulty seeing cloak in thermal vision | ||
| ConVar sv_neo_bot_cloak_detection_bonus_non_support("sv_neo_bot_cloak_detection_bonus_non_support", "1", FCVAR_NONE, | ||
| ConVar sv_neo_bot_cloak_detection_bonus_non_support("sv_neo_bot_cloak_detection_bonus_non_support", "5", FCVAR_NONE, | ||
| "Bot cloak detection bonus for non-support classes", true, 0, true, 100); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The more aggressive bot attacking behavior showed some quirks of having the bots not detect cloaked enemies, especially if the two teams rush each other's positions (at the original values, the two teams either stared at each other at point blank range, or swapped positions). I decided to slightly bump the detection changes, though perhaps we might want to boost them even more. |
||
|
|
||
| // 0.7 dot product is about a 45 degree half hangle for a 90 degree cone | ||
| ConVar sv_neo_bot_cloak_detection_aim_bonus_dot_threshold("sv_neo_bot_cloak_detection_aim_bonus_dot_threshold", "0.3", FCVAR_NONE, | ||
| "Bot cloak detection bonus minimum dot product threshold for aim bonus", true, 0.01, true, 0.7); | ||
|
|
||
| ConVar sv_neo_bot_cloak_detection_bonus_observer_stationary("sv_neo_bot_cloak_detection_bonus_observer_stationary", "2", FCVAR_NONE, | ||
| ConVar sv_neo_bot_cloak_detection_bonus_observer_stationary("sv_neo_bot_cloak_detection_bonus_observer_stationary", "10", FCVAR_NONE, | ||
| "Bot cloak detection bonus for observer being stationary", true, 0, true, 100); | ||
|
|
||
| ConVar sv_neo_bot_cloak_detection_bonus_observer_walking("sv_neo_bot_cloak_detection_bonus_observer_walking", "1", FCVAR_NONE, | ||
| ConVar sv_neo_bot_cloak_detection_bonus_observer_walking("sv_neo_bot_cloak_detection_bonus_observer_walking", "5", FCVAR_NONE, | ||
| "Bot cloak detection bonus for observer walking", true, 0, true, 100); | ||
|
|
||
| ConVar sv_neo_bot_cloak_detection_bonus_target_running("sv_neo_bot_cloak_detection_bonus_target_running", "2", FCVAR_NONE, | ||
| ConVar sv_neo_bot_cloak_detection_bonus_target_running("sv_neo_bot_cloak_detection_bonus_target_running", "10", FCVAR_NONE, | ||
| "Bot cloak detection bonus for target running", true, 0, true, 100); | ||
|
|
||
| ConVar sv_neo_bot_cloak_detection_bonus_target_moving("sv_neo_bot_cloak_detection_bonus_target_moving", "1", FCVAR_NONE, | ||
| ConVar sv_neo_bot_cloak_detection_bonus_target_moving("sv_neo_bot_cloak_detection_bonus_target_moving", "5", FCVAR_NONE, | ||
| "Bot cloak detection bonus for target moving", true, 0, true, 100); | ||
|
|
||
| ConVar sv_neo_bot_cloak_detection_bonus_target_standing("sv_neo_bot_cloak_detection_bonus_target_standing", "1", FCVAR_NONE, | ||
| ConVar sv_neo_bot_cloak_detection_bonus_target_standing("sv_neo_bot_cloak_detection_bonus_target_standing", "5", FCVAR_NONE, | ||
| "Bot cloak detection bonus for target standing", true, 0, true, 100); | ||
|
|
||
| ConVar sv_neo_bot_cloak_detection_bonus_scope_range("sv_neo_bot_cloak_detection_bonus_scope_range", "1", FCVAR_NONE, | ||
| ConVar sv_neo_bot_cloak_detection_bonus_scope_range("sv_neo_bot_cloak_detection_bonus_scope_range", "10", FCVAR_NONE, | ||
| "Bot cloak detection bonus for being in scope range", true, 0, true, 100); | ||
|
|
||
| ConVar sv_neo_bot_cloak_detection_bonus_shotgun_range("sv_neo_bot_cloak_detection_bonus_shotgun_range", "5", FCVAR_NONE, | ||
| ConVar sv_neo_bot_cloak_detection_bonus_shotgun_range("sv_neo_bot_cloak_detection_bonus_shotgun_range", "60", FCVAR_NONE, | ||
| "Bot cloak detection bonus for being in shotgun range", true, 0, true, 100); | ||
|
|
||
| ConVar sv_neo_bot_cloak_detection_bonus_melee_range("sv_neo_bot_cloak_detection_bonus_melee_range", "50", FCVAR_NONE, | ||
| ConVar sv_neo_bot_cloak_detection_bonus_melee_range("sv_neo_bot_cloak_detection_bonus_melee_range", "80", FCVAR_NONE, | ||
| "Bot cloak detection bonus for being in melee range", true, 0, true, 100); | ||
|
|
||
| ConVar sv_neo_bot_cloak_detection_bonus_per_injury("sv_neo_bot_cloak_detection_bonus_per_injury", "1", FCVAR_NONE, | ||
| ConVar sv_neo_bot_cloak_detection_bonus_per_injury("sv_neo_bot_cloak_detection_bonus_per_injury", "5", FCVAR_NONE, | ||
| "Bot cloak detection bonus per injury event", true, 0, true, 100); | ||
|
|
||
| // TODO: Lighting information is not yet baked into NavAreas, so we would need to implement that for bots to detect based on lighting | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By adding an optional vector position parameter to CNEOBotAttack, we can direct bots to search for cover in the direction of the vector position. For example, in this case we are directing the bots to attack the enemy while advancing between cover spots that are directionally closer to their commanding player's ping waypoint.
One known design tradeoff is that bots will not immediate change their direction of movement if the player places another ping when the bots are in the Attack behavior. My thinking is that this is okay, as bots should terminate the attack behavior earlier when they both have the optional goal waypoint while not seeing the enemy when moving between cover. I think it's fine not to interrupt the bots in the middle of their current plan, as it's more important that they don't change their minds indecisively and get destroyed when executing a cover plan.