Skip to content

Conversation

@sunzenshen
Copy link
Contributor

Description

  • When a commander of bots has no primary and looks at one of their subordinates, that subordinate will throw their weapon at the commander as as donation.
  • Can also be used to trade weapons if a commander throws their weapon at the subordinate, as the subordinate will collect the nearest weapon after throwing their weapon.

Toolchain

  • Windows MSVC VS2022

@sunzenshen sunzenshen requested a review from a team January 25, 2026 00:29
@sunzenshen
Copy link
Contributor Author

sunzenshen commented Jan 25, 2026

Testing ideas:

Remember to enable the bot command feature (this is an FCVAR_ARCHIVE ConVar, so you only need to do this once)

sv_neo_bot_cmdr_enable 1;

To trigger the core behavior, collect some followers using the +use button, then drop your primary, and then look at one of your followers to request their primary:

bot-cmd-trade-weapons.mp4

Prior to this PR, because the bot command behavior was transitioned from neo_bot_tactical_monitor, any other tactical monitor behaviors were actually suspended indefinitely in favor of the bot command behavior.

The fix this PR introduces was to move the bot command behavior transition to the Scenario Monitor, which has the following test implications:

  • By throwing your weapon farther from a bot you want to trade with, this will test the previously blocked weapon scavenging behavior.
  • Also blocked was the grenade avoidance behavior, so that can be tested by throwing a grenade at your subordinate bots:
bot-cmd-grenade-avoidance-sanity-check.mp4
  • Incidentally, this unblocks non-commanded paused enemies from dodging grenades, but I think this is acceptable for my use case of the uncommanded pause cheat ConVar, as I mostly intended sv_neo_bot_cmdr_debug_pause_uncommanded 1; to prevent the enemy team from interrupting testing of features like navmeshes/etc.
bot-cmd-grenade-avoidance-paused-enemies.mp4

{
if (me->m_hLeadingPlayer.Get() || me->m_hCommandingPlayer.Get())
{
return SuspendFor(new CNEOBotCommandFollow, "Following commander");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It turns out that launching into the bot commander following behavior was blocking other tactical monitor behaviors, so I moved this behavior launch point into neo_bot_scenario_monitor.

{
if (me->m_hLeadingPlayer.Get() || me->m_hCommandingPlayer.Get())
{
return SuspendFor(new CNEOBotCommandFollow, "Following commander");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved from neo_bot_tactical_monitor, to unblock other tactical monitor behaviors.

@sunzenshen sunzenshen added the Bots Related to bot players label Jan 25, 2026
@sunzenshen sunzenshen force-pushed the bot-cmd-trade-weapon branch from 234d52c to 1f608d0 Compare January 28, 2026 04:34
Vector vecCmdrFacing;
pCommander->EyeVectors(&vecCmdrFacing);

if (vecCmdrFacing.Dot(vecToBot) > 0.99f)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I struggle to aim at the right spot on a bot to get them to drop their weapon outside of the pre-round freeze, when a bot stands very close to me

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get what you mean, but when I tried adding some bot movement away from the player, the bot path is often erratic enough that the bot walks away from the player's cursor, even if the movement vector is theoretically in line of the 2 players. That's why I associated this trading feature with bot commanding, as you really need to be able to control a bot's standing position before you try to initiate a trade.

@AdamTadeusz
Copy link
Contributor

I also notice that when the bot is close to me, the bot will throw the weapon past me and then often run to pick up the very weapon they just dropped before I am able to do so

@AdamTadeusz
Copy link
Contributor

It looks like there is no consideration being made for whether the bot can drop their primary weapon (Think juggernaut)

Or whether the commander can pick up the bot's primary weapon (Think recon commander and PZ)

Still this doesn't really cause any issues.

AdamTadeusz
AdamTadeusz previously approved these changes Jan 30, 2026
@sunzenshen
Copy link
Contributor Author

It looks like there is no consideration being made for whether the bot can drop their primary weapon (Think juggernaut)

Or whether the commander can pick up the bot's primary weapon (Think recon commander and PZ)

Added some checks to make sure the bot and the commander can even trade (checking drop and checking pickup):

bot-cmd-trade-weapons-ignore_jgr_balc.mp4

@sunzenshen sunzenshen requested review from a team and AdamTadeusz January 31, 2026 05:53
AdamTadeusz
AdamTadeusz previously approved these changes Jan 31, 2026
@sunzenshen
Copy link
Contributor Author

Rebased on top of the fix all warnings PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bots Related to bot players

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants