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

Issues with connection counting #82

Open
NicEastvillage opened this issue Mar 8, 2025 · 7 comments
Open

Issues with connection counting #82

NicEastvillage opened this issue Mar 8, 2025 · 7 comments
Labels
bug Something isn't working

Comments

@NicEastvillage
Copy link
Contributor

NicEastvillage commented Mar 8, 2025

1) It is possible to make the match start even though not all connections are ready. Steps:

  • Start a match with 2 bots (that both need to be started manually),
  • Connect the first bot
  • Disconnect the first bot (Core still believes it is ready)
  • Connect the second bot. Core then spawns the cars and the match starts.

2) It is also possible that the match does not start even though all connections are ready. Steps:

  • Start a match with 1 bot which has close_between_matches=False.
  • Let the bot connect
  • ...
  • Match does not start as connections where close_between_matches=False are not counted (assumed to be a match runner client).
@NicEastvillage NicEastvillage added the bug Something isn't working label Mar 8, 2025
@VirxEC
Copy link
Collaborator

VirxEC commented Mar 8, 2025

Case 2 could be labeled as intentional behavior because we say that bots and scripts must close between matches.

@NicEastvillage
Copy link
Contributor Author

Not quite. It needs to be counted as we should not start the match without it. Only on subsequent matches we don't need to count it (assuming it is a player in the match, but it might not be).

To me, it seems easiest to simply count up whenever a connection we need is ready, and count down if it disconnects. The id reservation system is pretty close to what we need. Maybe we can integrate it here. Connections with close_between_matches=False just need to reattempt to reserve an id when a new match starts, and then we get the expected behaviour.

@VirxEC
Copy link
Collaborator

VirxEC commented Mar 9, 2025

I just don't like the idea of a bot that stays up between matches. Booting/shutting down is super fast in v5 anyways

@NicEastvillage
Copy link
Contributor Author

I agree. Maybe we should rename the setting to something like orchestrator or observer to indicate that it is intended for match orchestrators. And we could additionally disallow such clients to participate in matches, which solves case 2. However, that may also limit the possibilities of what you can do with the framework.

@VirxEC
Copy link
Collaborator

VirxEC commented Mar 9, 2025

The current system already prevents unintended connections from participating in the match (at least by sending player inputs)

And some "observers" at least would want to close between matches

@NicEastvillage
Copy link
Contributor Author

NicEastvillage commented Mar 9, 2025

The current system already prevents unintended connections from participating in the match

Yes. So the question is whether we want a connection with close_between_matches=False to fall in that category. Currently, they can reserve indexes if they have an agent id and they can send inputs - except that the match will not start because they cannot be counted as a ready connection. So they are somewhere in between.

E.g. we could disallow having a non-empty agent id and close_between_matches=False at the same time to fix that.

@VirxEC
Copy link
Collaborator

VirxEC commented Mar 9, 2025

we could disallow having a non-empty agent id and close_between_matches=False at the same time to fix that.

I like this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: In Progress
Development

No branches or pull requests

2 participants