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

fix(player_select): Fix Online game able to start without all playes ready #1040

Merged
merged 8 commits into from
Nov 5, 2024

Conversation

MaxCWhitehead
Copy link
Collaborator

@MaxCWhitehead MaxCWhitehead commented Nov 2, 2024

Fixes #1036 and couple other things along the way

Not entirely sure what caused this - but I think I introduced it when updating for new matchmaker interface in bones.

We would allow online matches to continue if >1 players are ready and no unconfirmed players. The issue is that in online remote players who had not made a selection were in Empty state, and not tracked as unconfirmed. Now for any local + required players, I initialize them to new PlayerSlot type SelectingLocalControlSource. Empty may be used for online slots that are unused (the last 2 slots in a 2 player game) in online, or for lan, optional slots that may be joined by additional players/AI, but are not required. And remote required players are set to SelectingPlayer with default fish + no hat - as next message expected from them is change in player, and they don't need to select control source, we know they are remote.

This seems to have fixed the match starting without all players ready, as all required players are initialized to something other than Empty.

Other fixes / changes

Remembering Hats:

I noticed that if you select a hat and then deselect it going back to fish select - the other online players would still see this hat, but local player resets to None. If player selected hat, went back to fish select, then readied up with no hat, the remote players would see hat, but not the local player. This could cause desync. Now When you go back to fish select, your hat is remembered.

Always display default fish:

We were no longer displaying default fish in online when player had not yet selected a control source/fish. Now regardless of if have actually selected a fish, the default fish + no hat is shown (If the slot is a required player that we are sure will select one eventually / must ready up). In local for unjoined slots, no default fish is shown until joined or AI is set.

Show when remote players ready

In online when a remote player is ready, this is now displayed.

@nelson137 feel free to review (if you want) as I know you were just in here. Player select sure is complicated lol, but feeling good about the changes I think we're making it more manageable 😅

@nelson137
Copy link
Contributor

Nothing to add here, I didn't test it but these look like solid changes!

@MaxCWhitehead MaxCWhitehead added this pull request to the merge queue Nov 5, 2024
Merged via the queue into fishfolk:main with commit 276af5a Nov 5, 2024
8 checks passed
@MaxCWhitehead MaxCWhitehead deleted the fix-player-select branch November 5, 2024 01:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Online lobby goes to map select once local player is ready, before all players are ready
2 participants