Skip to content

Bots swap for more powerful weapons#1800

Open
sunzenshen wants to merge 3 commits intoNeotokyoRebuild:masterfrom
sunzenshen:bot-scavenge-better-weps
Open

Bots swap for more powerful weapons#1800
sunzenshen wants to merge 3 commits intoNeotokyoRebuild:masterfrom
sunzenshen:bot-scavenge-better-weps

Conversation

@sunzenshen
Copy link
Contributor

Description

Based on a bot's weapon selection preferences, bots will scavenge weapons if they are not available to the bot's current rank.

Toolchain

  • Windows MSVC VS2022

@sunzenshen
Copy link
Contributor Author

Demo clip:

bot-scavenge-better-weapons-oilstain.mp4

@sunzenshen sunzenshen added the Bots Related to bot players label Mar 8, 2026
@sunzenshen sunzenshen marked this pull request as draft March 8, 2026 20:05
@sunzenshen sunzenshen force-pushed the bot-scavenge-better-weps branch from 54b1a25 to d49e3f0 Compare March 8, 2026 23:05
@sunzenshen sunzenshen marked this pull request as ready for review March 8, 2026 23:06
@sunzenshen
Copy link
Contributor Author

sunzenshen commented Mar 8, 2026

Currently the bots won't scavenge weapons that they could not select themselves at LT rank, but I figure that's a PR for another time. Also this PR tends to cause Recon bots to use the Supa most of the time, so I'm not sure if we want to tweak the related bot preferences.

Also I thought about merging the class preferences into one big bit mask, but what that did was cause EVERYONE to use Supas, because Supa at Recon LT choice is a common bot profile. I personally don't like the bot performance using the Supa, but maybe that's a deficiency with the bot tactics and not with the weapon choice.

@sunzenshen sunzenshen requested a review from a team March 8, 2026 23:08
@sunzenshen sunzenshen force-pushed the bot-scavenge-better-weps branch from d49e3f0 to 8dd035e Compare March 13, 2026 03:32
Copy link
Contributor

@AdamTadeusz AdamTadeusz left a comment

Choose a reason for hiding this comment

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

looks good, in two places can replace a string comparison between a weapon name and "weapon_ghost" with GetNeoWepBits() & NEO_WEP_GHOST if the pointers are cast to cneobasecombatweapons, which at this point should be a safe assumption

}

const NEO_WEP_BITS_UNDERLYING_TYPE wepBits = pNeoWep->GetNeoWepBits();
return ( wepBits & ( NEO_WEP_BALC | NEO_WEP_SMAC ) ) != 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

technically the smac can be dropped in nt;re, and we have third person animations for most weapons (and use some other animations instead for weapons that the vip doesnt have animations for)

continue;
}

CBaseCombatWeapon *pWeapon = pEntity->MyCombatWeaponPointer();
Copy link
Contributor

Choose a reason for hiding this comment

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

I think its a safe assumption at this point that all weapons derive from CNEOBaseCombatWeapon, this way you can check wep bits for a weapon of type ghost instead of doing a string comparison further down

AdamTadeusz
AdamTadeusz previously approved these changes Mar 18, 2026
@AdamTadeusz AdamTadeusz requested a review from a team March 18, 2026 16:15
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