8000 Add ability to change multiplayer queue modes by smoogipoo · Pull Request #15640 · ppy/osu · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add ability to change multiplayer queue modes #15640

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

Merged
merged 97 commits into from
Nov 22, 2021

Conversation

smoogipoo
Copy link
Contributor
@smoogipoo smoogipoo commented Nov 15, 2021

Preview: https://drive.google.com/file/d/1ZnrHxGMBNJu9vFtb1-A0fR2To2a0cdGY/view?usp=sharing

Three new modes arrive in multiplayer:

  • Host only: The traditional multiplayer experience you're familiar with. Only the host can change the current item.
  • All players: All players can enqueue items, which are played in the order they were added.
  • All players (round robin): All players can enqueue items, which are played in order of fairness - the player with the least of their own items played so far gets to go first. Colloquially referred to as "host-rotate".

Prereqs (osu and osu-server-spectator are inter-dependent):

I apologise for the large PR - it's an entirely breaking change so I have to go the full way through.

Multiplayer is restructured so that:

  • MultiplayerRoomSettings no longer contains the current map/ruleset/mods. These are now expected to be taken from the PlaylistItem. MultiplayerRoomSettings still provides the playlist item id.
  • Items are added to the playlist via the new server AddPlaylistItem() server method.

Both of the above are breaking changes.

The MultiplayerPlaylistItem class has been added in order to communicate playlist items with the server. I've left in a UserId property, which is to be used for the upcoming fair-play mode, though initial usages will be server-side only.

BeatmapSelectionControl no longer exists, as it's too complicated to make it work for all usages. Instead, the playlist has been inlined:

  • Into MultiplayerMatchSubScreen, containing the full playlist.
  • Into MultiplayerMatchSettingsOverlay, containing only a single item, and reproducing the previous BeatmapSelectionControl functionality. This means that the match has to be created with a single playlist item for the time being.

The playlist has been inverted in MultiplayerMatchSubScreen for the time being. It's easier to handle this way without working around scroll, as the playlist length expands out of view.

Still to be done:

  • The host should be able to enqueue items in host-only mode.
  • Item owners should be able to delete their own items in free-for-all and fair-rotate modes.
  • Item owners should be able to edit their own items in free-for-all and fair-rotate modes.
  • The host should be able to delete/change items in all modes.
  • Split the MultiplayerMatchSubScreen playlist into two sections, maybe something like Apple Music (history sorted newest-first, and up-next sorted oldest-first).
  • Add owner to playlist item panels.
  • Allow the host to change the order of items in the queue.
  • The displayed playlist should be ordered by the queueing mode.

As for testing - everything except fair-play mode is testable via visual tests (TestSceneMultiplayer) to get a feel for things.

@smoogipoo
Copy link
Contributor Author

Renames have been applied.

@peppy
Copy link
Member
peppy commented Nov 19, 2021

Tests no look good.

@bdach
Copy link
Collaborator
bdach commented Nov 21, 2021

I've skimmed this again (without testing) and I'm all good with the structure, so on that part I see no reason not to go forward. I may test later, but even if I find issues, I'm likely going to just open issues about it or fix myself post-merge because this diff is too large to hold up over bugs.

As for the test failures, I have a few commits that seem to fix them on this branch (first, second, third - reasonings for each change are in the extended commit message). They seem fairly innocuous but I'm not 100% about them, so I didn't push them in outright; can do so if they are considered acceptable.

@bdach
Copy link
Collaborator
bdach commented Nov 21, 2021

Actually, on comparing this pull and the server-side pull, I believe there may be a discrepancy between the test multiplayer client implementation and the real one as to how playlist items are treated when the queue mode changes, so that may need to be addressed before this can be merged as it is potentially a pretty fundamental change in UX.

@smoogipoo
Copy link
Contributor Author
smoogipoo commented Nov 22, 2021

Tests should be resolved now.


I believe there may be a discrepancy between the test multiplayer client implementation and the real one as to how playlist items are treated when the queue mode changes

Indeed, fixed via 6420971.

9c30fc9

In general, the reason this was done is to not rely on the schedule having run for the server-side playlist to be up-to-date. I believe your third change (f7829cc) may prove problematic if you add a Task.Delay() after the await in PlaylistItemAdded() - it's already on a different thread by that point so the false parameter does nothing.

In my changes, I've instead stored a "server-side" playlist. 10dc08a

4453479

I think it's better to compare via IDs in these cases, as I've done in 53dbbd6.

@peppy
Copy link
Member
peppy commented Nov 22, 2021

I've reviewed this about as much as I can given its size. Let's get this merged and push forward. I'll do a (nuget-only) release post-merge to get the server side up-to-date and deployed on the dev server.

@peppy peppy merged commit 4dd86f8 into ppy:master Nov 22, 2021
@peppy peppy changed the title Add ability to change multiplayer queue modes ? Nov 23, 2021
@peppy peppy changed the title ? Add ability to change multiplayer queue modes Nov 23, 2021
@smoogipoo smoogipoo deleted the multi-queueing-modes branch September 11, 2023 02:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants
0