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

Jean/party mode pull request #336

Closed
wants to merge 11 commits into from
Closed

Conversation

achimmihca
Copy link
Collaborator

What does this PR do?

Implement party modes.

Current approach:

Party Mode has two options: "Teams" and "Free for All".

Currently "Teams" isn't working, although the UI has been started.
"Free for All" will work to automatically create rounds to match and make all added users play.
Eventually it would be nice to have a tournament mode for the "Free for All" mode, so that winning players are matched against each others, until there is only one winner.

"Free for All" will only work if there are exactly two microphones enabled - support for more players/microphones needs to be added.

The flow works as follow:
- Participants can be added, either using existing Player Profiles, or entering new guest names through text fields
- Based on the number of participants, the number of rounds will be calculated
- Song selection can be manual, one random song, or a subset of random songs so that users have a bit more choices
    - in team mode, we should let users from each team to choose the song in turns
    - there is an infinite joker button that will reselect (a) new song(s), eventually the number of joker per player/teams should be modifiable (including an "infinite" value)
- For each round, users can define:
    - the winning condition (still work in progress, only the highest score will properly work)
    - a game modifier that will alter the gameplay based on a condition
- A "Versus" screen shows the randomly matched players, as well as the winning condition and modifiers for the round, if any
- Once the song ends, the "Versus" screen is shown again for the next round

Additional Notes

@jean-moreno this is a draft PR for your branch such that I can review and give feedback.
I created a new branch for the PR. Thus, you can continue development on your original branch and when ready, merge it to this branch.

jean-moreno and others added 11 commits October 27, 2022 16:00
Audio being mandatory, it makes more sense to output an error since the song won't work at all.
The custom control shows the selected flag, or "Mixed Values" or "None" if relevant, and selection happens in a custom dialog showing all possible options as toggles.
Party Mode has two options: "Teams" and "Free for All".

Currently "Teams" isn't working, although the UI has been started.
"Free for All" will work to automatically create rounds to match and make all added users play.
Eventually it would be nice to have a tournament mode for the "Free for All" mode, so that winning players are matched against each others, until there is only one winner.

"Free for All" will only work if there are exactly two microphones enabled - support for more players/microphones needs to be added.

The flow works as follow:
- Participants can be added, either using existing Player Profiles, or entering new guest names through text fields
- Based on the number of participants, the number of rounds will be calculated
- Song selection can be manual, one random song, or a subset of random songs so that users have a bit more choices
    - in team mode, we should let users from each team to choose the song in turns
    - there is an infinite joker button that will reselect (a) new song(s), eventually the number of joker per player/teams should be modifiable (including an "infinite" value)
- For each round, users can define:
    - the winning condition (still work in progress, only the highest score will properly work)
    - a game modifier that will alter the gameplay based on a condition
- A "Versus" screen shows the randomly matched players, as well as the winning condition and modifiers for the round, if any
- Once the song ends, the "Versus" screen is shown again for the next round
@achimmihca
Copy link
Collaborator Author

A GIF to show current state.

party-modes-wip-demo

public enum EPartySongSelection
{
RandomSong, // a random song is picked
RandomSubset, // a random subset of songs is picked, and players choose which one to sing
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Nice idea. Playlists could be reused as user created subsets.
    • Players should be able to define which subsets qualify for the random selection

{
public enum ETriggerType
{
Infinite,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Better call it Always ?
    • "When does it trigger" => Always

Infinite,
AfterTime,
UntilTime,
TimeRange,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • "When does it trigger" => InTimeRange ?
    • Or just TimeRange, I am not sure, whatever

{
RandomSong, // a random song is picked
RandomSubset, // a random subset of songs is picked, and players choose which one to sing
PlayersChoose // players choose the song
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • The other values use a noun at the end. Thus, I'd suggest PlayerChoice or just Manual.


// TODO use this to filter the randomly selected songs
[Flags]
public enum EPartySongFiltering
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • It should be possible to select one or more values for each EPartySongFiltering
    • How to combine multiple values?
      • Probably any value of selected category, but every selected category at least one.
    • For example, two artists and one genre selected => all songs of the genre that are performed by one of the artists?
  • The question is, how can users select sets of songs?
    • Maybe this needs a different data structure, e.g. a list of song-lists. And each song-list is filled by a song search.
    • Example: User searches for green day, then has a button to add all found songs as song-list. User searches for 1990<=Year&&Year<=1999, then again adds all found songs as song-list.

@@ -84,6 +87,9 @@ public static SongSelectSceneControl Instance
[Inject(UxmlName = R.UxmlNames.songIndexButton)]
private Button songIndexButton;

[Inject(UxmlName = R.UxmlNames.buttonJoker)]
private Button buttonJoker;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • It is a button, should be called jokerButton. In general, most defining stuff at the end of the name.

@@ -93,6 +94,19 @@ private SongMeta SelectedSongMeta

private void Start()
{
Selection.Subscribe(selection =>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • What are you trying to achieve? I think the coroutine is not needed
    • For example, UniRx has methods to do stuff when the value has been stable some time ( search .Throttle( )

if (sceneData.IsPartyMode)
{
// TODO intermediary scene that sums up all the rounds after last round
SceneNavigator.Instance.LoadScene(PartyModeManager.CurrentRoundData.isLastRound ? EScene.MainScene : EScene.PartyModeVersus);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • The proper target scene should be selected directly from SingScene instead of redirecting here.

@@ -274,8 +295,230 @@ private void Start()
{
timeBarControl?.UpdateTimeValueLabel(songAudioPlayer.PositionInSongInMillis, songAudioPlayer.DurationOfSongInMillis);
}));

// Modifiers apply callbacks
foreach (SingModifier modifier in sceneData.SingModifiers)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • There is naturally quite a lot new logic in this class. I'd suggest to create a dedicated PartyModeControl for it. SingSceneControl can then delegate to this.

// Disable warning about fields that are never assigned, their values are injected.
#pragma warning disable CS0649

// Scene that shows before a round in Party Mode
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • I think this is a good idea. Players can prepare, change mics, etc. in this scene.
  • However, maybe this could be combined with the round results?
    • After each round, the results are shown AND next players can prepare. I don't think we need a dedicated scene for this.

@achimmihca
Copy link
Collaborator Author

achimmihca commented Nov 14, 2022

Thanks for your work!

I still have some conceptual doubts for the party modes.

Team vs free-for-all

  • I my opinion "Free for all" is a special case of "Teams", namly every player is his/her own team.
    • Thus, I suggest to always show configuration for teams. A simple "Free for all" button could move each player to his/her own team.

Eventually it would be nice to have a tournament mode for the "Free for All" mode, so that winning players are matched against each others, until there is only one winner.

A knock-out system is a neat idea.
However, you could do the same with teams (until there is only one winning team). Again, I think "free for all" should be treated as a special case of "teams".

PlayerProfiles vs. guest user names

  • IMO there should not be guest user names. If needed, users can define generic PlayerProfiles named guest1, guest2, or player1, player2 etc.
    • PlayerProfiles also define difficulty, avatar, mic assignment.
    • Introducing some guest data structure (even if it is only a string) messes with existing abstractions and user experience ("where can I adjust guest difficulty?", "Where can I change your picture?", etc.).
    • IMO, having a single solution to add players simplifies things for devs and users.

Round count vs. player count

Based on the number of participants, the number of rounds will be calculated

This should be separated. 5 people may want to play 3 rounds.

Song selection from subset of songs

See my comment above:

Versus scene vs. round result scene

  • I think these can be combined in a single scene: show current results after each round and tell users to prepare for next round.

Translations

  • I would not bother with translations until the concepts and UI have been finalized

@achimmihca
Copy link
Collaborator Author

achimmihca commented Nov 14, 2022

"Multiple values" => We should implement some chips component to select multiple values. It should be visible, which values have been selected.

2022-11-14 17_09_04-UltraStar Play - PartyModeSettingsScene - Android - Unity 2021 3 4f1 Personal _D

@achimmihca
Copy link
Collaborator Author

The party settings UI need some description text field, for example to explain win conditions.

@achimmihca
Copy link
Collaborator Author

achimmihca commented Jan 16, 2023

I took inspiration from this PR, but implemeted a new UI for party mode configuration.

party-mode-config

I want to include these party modes in the upcoming Steam release.
For now, I did the implementation in a private repository.

Thus, I consider this PR obsolete and will not merge it.

@basisbit
Copy link
Member

basisbit commented Jan 17, 2023

Thus, I consider this PR obsolete and will not merge it.

I suggest trying to find a way of allowing contributions get merged while you have your fork with features that you keep private for now.

@achimmihca
Copy link
Collaborator Author

I will close this as obsolete after #433.

@jean-moreno feel free to create a new ticket if you have further feature requests.

@achimmihca achimmihca closed this Jun 28, 2024
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.

3 participants