Skip to content
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

Spawn ids are still used in bot processes #57

Open
NicEastvillage opened this issue Nov 3, 2024 · 4 comments
Open

Spawn ids are still used in bot processes #57

NicEastvillage opened this issue Nov 3, 2024 · 4 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@NicEastvillage
Copy link
Contributor

The start-up protocol was reworked in #49 and #48 to use agent_id instead of the multi-purpose spawn_id. The agent_id allows us to bind processes to bots/scripts without relying on core to start the bot/script process with a RLBOT_SPAWN_ID env var. We decided to keep spawn_id as a concept due to their usefulness internally. However, spawn_ids are still used by bot processes in the current implementation (Bots know their spawn_id since it is passed to them in the ControllableInfoTeam message). Externally spawn_ids are used for:

  • Bots find their in-game name (e.g. "Nexto (2)") by comparing their spawn id to bots in the match settings.
  • The SetLoadout message uses spawn_id.

Both of these can be replaced with better alternatives:

  • The bots are passed their in-game name in ControllableInfo instead.
  • The SetLoadout message use game packet index instead.

With these changes, ControllableInfo do not need to include spawn_id anymore. Additionally, spawn_id also appears in the PlayerConfiguration and ScriptConfiguration, but with the above changes I don't think that is necessary anymore either. Let me know if I am wrong on that.

@NicEastvillage NicEastvillage added enhancement New feature or request question Further information is requested labels Nov 3, 2024
@VirxEC
Copy link
Collaborator

VirxEC commented Nov 4, 2024

spawn_id still has applications for bot devs, with it being a unique identifier for bots. I don't think it should be removed from GamePacket even if those other changes go through.

@NicEastvillage
Copy link
Contributor Author

In which cases are the packet index not a unique identifier?

@VirxEC
Copy link
Collaborator

VirxEC commented Nov 6, 2024

It's not unique between matches (might be helpful for custom match managers that control custom game modes) & between scripts and bots. This gave me significant headache in core when I tried to remove spawn ids completely.

@VirxEC
Copy link
Collaborator

VirxEC commented Nov 6, 2024

Sure, we can change SetLoadout to take the the index (can be converted to spawn id internally by core) and add the process's name to ControllableInfo - not sure how hard that latter one will be to implement, might be tricky or trivial I forgot when that info in congregated - but I'm against removing it from GamePacket

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants