Skip to content

Conversation

@Rainyan
Copy link
Collaborator

@Rainyan Rainyan commented Nov 16, 2025

Description

Add the following (mainly) debug commands:

  • 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 default value -1 (don't force class but instead use a random one), 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, it's left for the RequestSetClass logic to decide).

Reasoning for adding: bot_class is parity, and bot_changeclass is "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

  • Windows MSVC VS2022

Linked Issues

* 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).
@Rainyan Rainyan requested a review from a team November 16, 2025 13:14
sunzenshen
sunzenshen previously approved these changes Nov 16, 2025
Copy link
Contributor

@sunzenshen sunzenshen left a comment

Choose a reason for hiding this comment

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

Some optional nits but LGTM:

Image Image

@sunzenshen sunzenshen requested a review from a team November 16, 2025 21:36
Make sure the randomized spawns are respected when either the ConCommand
is used, or the ConVar is returned to the -1 (random team) value.
@Rainyan
Copy link
Collaborator Author

Rainyan commented Nov 17, 2025

@sunzenshen Revisiting your earlier review comments at #1478 (comment):

That said, I tried to change bot_class and bot_changeclass back to -1 and it doesn't restore the heterogeneous class compositions for the teams. Not sure if that's an edge case we want to solve for what are debugging commands.

I decided to rework this a little. Now, we should recover the random class distribution once the bot_class is returned to -1, and neither should the onetime command version bot_changeclass disrupt the class distribution for future rounds.

I also stumbled upon this comment:

NEO_CLASS__LOADOUTABLE_COUNT = NEO_CLASS_VIP + 1, // Cannot spawn as Juggernaut

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.

@Rainyan Rainyan requested a review from sunzenshen November 17, 2025 21:02
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.
@Rainyan
Copy link
Collaborator Author

Rainyan commented Nov 17, 2025

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.

Copy link
Contributor

@sunzenshen sunzenshen left a 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.

@sunzenshen sunzenshen requested a review from a team November 18, 2025 05:32
@Rainyan Rainyan merged commit 6351094 into NeotokyoRebuild:master Nov 21, 2025
7 checks passed
@Rainyan Rainyan deleted the bot-class-cvar branch November 21, 2025 18:23
@DESTROYGIRL DESTROYGIRL added the Bots Related to bot players label Dec 9, 2025
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.

4 participants