Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/game/server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1457,10 +1457,18 @@ target_sources_grouped(
neo/bot/behavior/neo_bot_ctg_escort.h
neo/bot/behavior/neo_bot_ctg_lone_wolf.cpp
neo/bot/behavior/neo_bot_ctg_lone_wolf.h
neo/bot/behavior/neo_bot_ctg_lone_wolf_ambush.cpp
neo/bot/behavior/neo_bot_ctg_lone_wolf_ambush.h
neo/bot/behavior/neo_bot_ctg_lone_wolf_seek.cpp
neo/bot/behavior/neo_bot_ctg_lone_wolf_seek.h
neo/bot/behavior/neo_bot_ctg_seek.cpp
neo/bot/behavior/neo_bot_ctg_seek.h
neo/bot/behavior/neo_bot_dead.cpp
neo/bot/behavior/neo_bot_dead.h
neo/bot/behavior/neo_bot_detpack_deploy.cpp
neo/bot/behavior/neo_bot_detpack_deploy.h
neo/bot/behavior/neo_bot_detpack_trigger.cpp
neo/bot/behavior/neo_bot_detpack_trigger.h
neo/bot/behavior/neo_bot_grenade_dispatch.cpp
neo/bot/behavior/neo_bot_grenade_dispatch.h
neo/bot/behavior/neo_bot_grenade_throw.cpp
Expand Down
27 changes: 27 additions & 0 deletions src/game/server/neo/bot/behavior/neo_bot_ctg_capture.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#include "cbase.h"
#include "bot/behavior/neo_bot_ctg_capture.h"
#include "bot/behavior/neo_bot_ctg_lone_wolf_seek.h"
#include "bot/behavior/neo_bot_seek_weapon.h"
#include "bot/neo_bot_path_compute.h"
#include "neo_detpack.h"
#include "weapon_ghost.h"


Expand Down Expand Up @@ -67,6 +69,31 @@ ActionResult<CNEOBot> CNEOBotCtgCapture::Update( CNEOBot *me, float interval )
m_captureAttemptTimer.Start( 3.0f );
}

// Check if there is a detpack that risks exploding if I pick up the ghost
// NEO Jank: It may be more proper to check for line of sight,
// but triggering an entity search at the last moment may involve fewer overall calculations
// with the lampshade explanation as the bot being able to notice the detpack along the path
// even if we didn't check constantly along the same path
CBaseEntity *pEnts[256];
int numEnts = UTIL_EntitiesInSphere( pEnts, 256, me->GetAbsOrigin(), NEO_DETPACK_DAMAGE_RADIUS, 0 );
bool bDetpackNear = false;
for ( int i = 0; i < numEnts; ++i )
{
if ( pEnts[i] && FClassnameIs( pEnts[i], "neo_deployed_detpack" ) )
{
bDetpackNear = true;
break;
}
}

if ( bDetpackNear )
{
// NEO JANK: Putting the bot into seek mode will have it search the map for enemies for the rest of the round
// but for now this could be fine as it may indicate an entrenched enemy
// or a friendly that is setting up an ambush, where either scenario indicates ghost capture is too dangerous
return ChangeTo( new CNEOBotCtgLoneWolfSeek(), "Found detpack: skipping ghost capture to search for enemies" );
}

CBaseCombatWeapon *pPrimary = me->Weapon_GetSlot( 0 );
if ( pPrimary )
{
Expand Down
20 changes: 19 additions & 1 deletion src/game/server/neo/bot/behavior/neo_bot_ctg_carrier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "bot/behavior/neo_bot_ctg_carrier.h"
#include "bot/behavior/neo_bot_ctg_lone_wolf.h"
#include "bot/neo_bot_path_compute.h"
#include "nav_mesh.h"
#include "neo_gamerules.h"
#include "neo_ghost_cap_point.h"
#include "debugoverlay_shared.h"
Expand Down Expand Up @@ -368,9 +369,26 @@ ActionResult< CNEOBot > CNEOBotCtgCarrier::Update( CNEOBot *me, float interval )
m_teammates.RemoveAll();
CollectPlayers( me, &m_teammates );

// Check if bot should transition into lone wolf behavior
if ( m_teammates.Count() == 0 )
{
return SuspendFor( new CNEOBotCtgLoneWolf, "I'm the last one!" );
const CKnownEntity *threat = me->GetVisionInterface()->GetPrimaryKnownThreat( true );
if ( threat && threat->GetEntity() && threat->GetEntity()->IsAlive() )
{
CNavArea *destArea = TheNavMesh->GetNearestNavArea( m_closestCapturePoint );
CNavArea *myArea = me->GetLastKnownArea();

if ( !destArea || !myArea || !destArea->IsPotentiallyVisible( myArea ) )
{
return SuspendFor( new CNEOBotCtgLoneWolf, "Last one standing and blocked from capturing!" );
}
}

// Lone wolf will drop the ghost and go into enemy seeking behavior
if ( m_closestCapturePoint == CNEO_Player::VECTOR_INVALID_WAYPOINT )
{
return SuspendFor( new CNEOBotCtgLoneWolf, "Looking for enemy since there is no capture point" );
}
}

UpdateFollowPath( me, m_teammates );
Expand Down
Loading
Loading