Skip to content

Conversation

@sunzenshen
Copy link
Contributor

Description

Encapsulates bot behaviors related to the JGR game mode such that modifications to the behavior of Juggernaut mode bots can be isolated away from general seek and destroy behavior.

Toolchain

  • Windows MSVC VS2022

@sunzenshen sunzenshen requested review from a team and DESTROYGIRL December 29, 2025 05:50
@sunzenshen
Copy link
Contributor Author

Demo footage: https://streamable.com/fb68kk

@sunzenshen sunzenshen added the Bots Related to bot players label Dec 29, 2025
@sunzenshen sunzenshen force-pushed the bot-jgr-role-dispatch branch from c448c01 to 380bf98 Compare December 29, 2025 20:29
@Rainyan Rainyan requested review from Rainyan and removed request for a team December 29, 2025 20:50
@DESTROYGIRL DESTROYGIRL added the JGR Related to the Juggernaut gamemode. label Dec 31, 2025
@DESTROYGIRL
Copy link
Contributor

Got an assert here after a round had ended. Probably not a fault of changes in this PR but ???
Could be that m_bJuggernautItemExists is not set correctly after a round ends

	server.dll!assert_cast<CNEO_Juggernaut *,CBaseEntity>(CBaseEntity * pSource) Line 576	C++
 	server.dll!CNEORules::JuggernautItemExists() Line 4354	C++
 	server.dll!CNEOBotJgrSeek::RecomputeSeekPath(CNEOBot * me) Line 87	C++
 	server.dll!CNEOBotSeekAndDestroy::OnResume(CNEOBot * me, Action<CNEOBot> * interruptingAction) Line 201	C++
 	server.dll!Action<CNEOBot>::InvokeOnResume(CNEOBot * me, Behavior<CNEOBot> * behavior, Action<CNEOBot> * interruptingAction) Line 1529	C++
 	server.dll!Action<CNEOBot>::ApplyResult(CNEOBot * me, Behavior<CNEOBot> * behavior, ActionResult<CNEOBot> result) Line 1697	C++
 	server.dll!Action<CNEOBot>::InvokeUpdate(CNEOBot * me, Behavior<CNEOBot> * behavior, float interval) Line 1379	C++
 	server.dll!Action<CNEOBot>::InvokeUpdate(CNEOBot * me, Behavior<CNEOBot> * behavior, float interval) Line 1379	C++
 	server.dll!Action<CNEOBot>::InvokeUpdate(CNEOBot * me, Behavior<CNEOBot> * behavior, float interval) Line 1379	C++
 	server.dll!Behavior<CNEOBot>::Update(CNEOBot * me, float interval) Line 258	C++
 	server.dll!CNEOBotIntention::Update() Line 2664	C++
 	server.dll!INextBot::Update() Line 133	C++
 	server.dll!NextBotPlayer<CNEO_Player>::Update() Line 976	C++
 	server.dll!CNEOBot::Update() Line 837	C++
 	server.dll!NextBotPlayer<CNEO_Player>::PhysicsSimulate() Line 743	C++
 	server.dll!CNEOBot::PhysicsSimulate() Line 693	C++
 	server.dll!Physics_SimulateEntity(CBaseEntity * pEntity) Line 2019	C++
 	server.dll!Physics_RunThinkFunctions(bool simulating) Line 2075	C++
 	server.dll!CServerGameDLL::GameFrame(bool simulating) Line 1281	C++

@Rainyan
Copy link
Collaborator

Rainyan commented Dec 31, 2025

Got an assert here after a round had ended. Probably not a fault of changes in this PR but ??? Could be that m_bJuggernautItemExists is not set correctly after a round ends

	server.dll!assert_cast<CNEO_Juggernaut *,CBaseEntity>(CBaseEntity * pSource) Line 576	C++
 	server.dll!CNEORules::JuggernautItemExists() Line 4354	C++
 	server.dll!CNEOBotJgrSeek::RecomputeSeekPath(CNEOBot * me) Line 87	C++
 	server.dll!CNEOBotSeekAndDestroy::OnResume(CNEOBot * me, Action<CNEOBot> * interruptingAction) Line 201	C++
 	server.dll!Action<CNEOBot>::InvokeOnResume(CNEOBot * me, Behavior<CNEOBot> * behavior, Action<CNEOBot> * interruptingAction) Line 1529	C++
 	server.dll!Action<CNEOBot>::ApplyResult(CNEOBot * me, Behavior<CNEOBot> * behavior, ActionResult<CNEOBot> result) Line 1697	C++
 	server.dll!Action<CNEOBot>::InvokeUpdate(CNEOBot * me, Behavior<CNEOBot> * behavior, float interval) Line 1379	C++
 	server.dll!Action<CNEOBot>::InvokeUpdate(CNEOBot * me, Behavior<CNEOBot> * behavior, float interval) Line 1379	C++
 	server.dll!Action<CNEOBot>::InvokeUpdate(CNEOBot * me, Behavior<CNEOBot> * behavior, float interval) Line 1379	C++
 	server.dll!Behavior<CNEOBot>::Update(CNEOBot * me, float interval) Line 258	C++
 	server.dll!CNEOBotIntention::Update() Line 2664	C++
 	server.dll!INextBot::Update() Line 133	C++
 	server.dll!NextBotPlayer<CNEO_Player>::Update() Line 976	C++
 	server.dll!CNEOBot::Update() Line 837	C++
 	server.dll!NextBotPlayer<CNEO_Player>::PhysicsSimulate() Line 743	C++
 	server.dll!CNEOBot::PhysicsSimulate() Line 693	C++
 	server.dll!Physics_SimulateEntity(CBaseEntity * pEntity) Line 2019	C++
 	server.dll!Physics_RunThinkFunctions(bool simulating) Line 2075	C++
 	server.dll!CServerGameDLL::GameFrame(bool simulating) Line 1281	C++

assert_cast fails the assertion if both are true:

  • the input pointer value is not nullptr
  • dynamic_cast of the input pointer results in nullptr

i.e. the pointer does exist, but is not convertible to the desired type.

Because m_hJuggernaut is declared as CNetworkHandle( CBaseEntity, m_hJuggernaut );, it can accept a pointer to any class that derives from CBaseEntity. So I'd guess it was holding a CNEO_Player* at the time of the assertion failure rather than a CNEO_Juggernaut* (possibly from here?)

Whether m_hJuggernaut should be this way I suppose is more nuanced.

@DESTROYGIRL
Copy link
Contributor

assert_cast fails the assertion if both are true:

* the input pointer value is not `nullptr`

* `dynamic_cast` of the input pointer results in `nullptr`

i.e. the pointer does exist, but is not convertible to the desired type.

Because m_hJuggernaut is declared as CNetworkHandle( CBaseEntity, m_hJuggernaut );, it can accept a pointer to any class that derives from CBaseEntity. So I'd guess it was holding a CNEO_Player* at the time of the assertion failure rather than a CNEO_Juggernaut* (possibly from here?)

Whether m_hJuggernaut should be this way I suppose is more nuanced.

Yea, I put the assert_cast there to ensure that m_hJuggernaut is a CNEO_Juggernaut and not a player when m_bJuggernautItemExists is true. m_hJuggernaut switching between player & item is intentional

@sunzenshen
Copy link
Contributor Author

Do we want to consider revisiting that assert in this PR or as a separate issue? It might be easier to replicate the issue separately, using the bots to passively set up the test conditions.

@sunzenshen sunzenshen force-pushed the bot-jgr-role-dispatch branch from 380bf98 to 1701cd7 Compare January 1, 2026 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bots Related to bot players JGR Related to the Juggernaut gamemode.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants