-
Notifications
You must be signed in to change notification settings - Fork 20
Add commands for adjusting bots' class #1478
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
Conversation
* Add `bot_class` cvar for adjusting which class bots should spawn as the next time. This var name and behaviour mimics the `bot_class` cvar of OGNT, with the exception of starting with value of -1 (don't change, instead use random) instead of 0 (always spawn recon bots). * Add `bot_changeclass` command for switching all bots' classes right now instead of at next spawn (if allowed by gamerules/other cvars).
sunzenshen
left a comment
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.
Make sure the randomized spawns are respected when either the ConCommand is used, or the ConVar is returned to the -1 (random team) value.
|
@sunzenshen Revisiting your earlier review comments at #1478 (comment):
I decided to rework this a little. Now, we should recover the random class distribution once the I also stumbled upon this comment: neo/src/game/shared/neo/neo_enums.h Line 23 in 0927549
so sadly, no more MechWarrior... the bounds are now checked using that value, so it caps to the VIP class as the maximum supported. But it would be neat to have a "everyone spawns as Juggernaut" as a supported feature. Maybe some day. |
Because we have to we able to adjust bot spawn class controlled by cvars, I'm removing the responsibility from CNEOBotManager to choose the bot class (used to fire only once at bot creation), and instead check it separately for each new spawn of that bot. This has the (positive?) side-effect that bots will reconsider which class they should be playing, taking the class-specific ratio cvars into consideration.
|
Also it should be noted that as explained in 08f175e, this does technically change the bots random class selection in that they will re-choose their classes after every respawn, instead of only choosing the class once when they were created. But I imagine this is not a problem, or could even be a good thing. |
sunzenshen
left a comment
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.
LGTM
Also played around the the console commands and was able to change bots back to heterogeneous class compositions (-1). Also checked that I couldn't set the bots all to JGR (4). Probably for the best since that class is heavily dependent on the custom game mode.


Description
Add the following (mainly) debug commands:
Add
bot_classcvar for adjusting which class bots should spawn as the next time. This var name and behaviour mimics thebot_classcvar of OGNT, with the exception of default value-1(don't force class but instead use a random one), instead of0(always spawn recon bots).Add
bot_changeclasscommand for switching all bots' classes right now instead of at next spawn (if allowed by gamerules/other cvars, it's left for theRequestSetClasslogic to decide).Reasoning for adding:
bot_classis parity, andbot_changeclassis "SDK parity" prior to nextbots, although I can't remember if it was ever working for the NT classes. Also handy for people who want to test class-specific things with the bots but don't have the development tools set up to edit code.Toolchain
Linked Issues