RLBot / core

RLBotServer implementation in C#, with a smaller closed-source portion.
https://rlbot.org/
MIT License
5 stars 3 forks source link

Spawn ids are still used in bot processes #57

Open NicEastvillage opened 2 weeks ago

NicEastvillage commented 2 weeks ago

The start-up protocol was reworked in https://github.com/RLBot/core/issues/49 and https://github.com/RLBot/core/pull/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:

Both of these can be replaced with better alternatives:

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.

VirxEC commented 2 weeks ago

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 commented 2 weeks ago

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

VirxEC commented 2 weeks ago

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 commented 2 weeks ago

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