-
Notifications
You must be signed in to change notification settings - Fork 6
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
Comments
|
In which cases are the packet index not a unique identifier? |
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. |
Sure, we can change |
I think I finally found a satisfying explanation for why spawn ids are useful for users (e.g. rlgym_compat). They can be used to pair PlayerInfos in the GamePacket with a PlayerConfiguration in the MatchConfiguration. This is relevant because RLBot is not guaranteed to preserve the ordering. For example, human players are always pushed to the end, such that if they leave the match, there won't be holes in the GamePacket players. This is understandably a feature we can't remove. Whether spawn ids are the best way to do it is another question. For example, the PlayerInfo could simply contain a EDIT: Added this to the issue description. |
One thing of note if we switch to indices - However if we switch to indices, the bot will try to assume control over the wrong bot. This would then fallback on core to reject these player inputs for the wrong bot, which it will do, but the bot process itself won't have any way of knowing that something went wrong. |
If core passes a bot the wrong spawn id (or index), then it is a bug in core that needs to be fixed. Maybe it can happen if two different bots/scripts have the same agent id, but we should be able to detect that too in core and abort. |
perhaps that should be a new issue? we've agreed that spawn ids are staying |
I have not agreed to them staying yet. I will take a deeper look when I find time. |
Spawn ids are used in |
Unless the dict keys are used somewhere else too I don't see why this could not be changed to use index. |
The start-up protocol was reworked in #49 and #48 to use
agent_id
instead of the multi-purposespawn_id
. Theagent_id
allows us to bind processes to bots/scripts without relying on core to start the bot/script process with aRLBOT_SPAWN_ID
env var. We decided to keepspawn_id
as a concept due to their usefulness internally. However,spawn_id
s are still used by bot processes in the current implementation (Bots know theirspawn_id
since it is passed to them in theControllableInfoTeam
message). Externallyspawn_ids
are used for:SetLoadout
message usesspawn_id
.Both of these can be replaced with better alternatives:
ControllableInfo
instead. (🟨 TODO)SetLoadout
message use game packet index instead. (✅ implemented)With these changes,
ControllableInfo
do not need to includespawn_id
anymore. Additionally,spawn_id
also appears in thePlayerConfiguration
andScriptConfiguration
, but with the above changes I don't think that is necessary anymore either. Let me know if I am wrong on that.EDIT:
Spawn ids have one last use-case for users (from what I can tell). That is to pair PlayerInfos in the GamePacket with PlayerConfigurations in the MatchConfiguration. This is relevant because RLBot is not guaranteed to preserve the ordering. For example, human players are always pushed to the end, such that if they leave the match there won't be holes in the GamePacket players.
This is a feature we can't remove. Whether spawn ids are the best way to do it is another question. For example, the PlayerInfo could simply contain a
configuration_index
that is its index in the MatchConfiguration.The text was updated successfully, but these errors were encountered: