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

Do not repeat songs when randomizing #851

Merged
merged 2 commits into from
Jul 14, 2024

Conversation

DeinAlptraum
Copy link
Contributor

@DeinAlptraum DeinAlptraum commented May 21, 2024

Instead of picking a random song whenever R is pressed, this generates a random permutation of all songs, goes to the next one in that order every time R is pressed, and finally generates a new permutation once all songs have come up once.
While in a search, this creates a random queue based on the filtered subset of songs. This queue is reset whenever the search filter is changed.

Depending on what your expectations are, I would say this resolves #186

I have only implemented this for the regular randomization (the "in one category" case) since I have no idea what the category feature does or how I can access it...

Copy link
Collaborator

@bohning bohning left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@dgruss
Copy link

dgruss commented Jun 18, 2024

I've merged this into my local compile and had a weird bug: after randomizing a small number of times (< 30, with way more songs in the game) the random function always selected exactly the same song.

@DeinAlptraum
Copy link
Contributor Author

@dgruss thanks for testing and reporting this! That is indeed very strange, nothing comparable happens to me.
Can you tell me

  • what OS you're on
  • exactly how many songs are in that song folder
  • if it's always the same number that repeats, or if it is different every time the bug occurs

@dgruss
Copy link

dgruss commented Jun 18, 2024

windows 10, 20000+ songs, folders are deactivated, so it is one long list. i haven't tried it again but will as soon as i get to it

@DeinAlptraum DeinAlptraum marked this pull request as draft June 22, 2024 01:31
@DeinAlptraum DeinAlptraum marked this pull request as ready for review June 23, 2024 17:50
@DeinAlptraum
Copy link
Contributor Author

I believe I fixed this: before, this only randomized the entire song list, and when you pressed R while in a search, it would still try to pick the next index from the entire song list. I changed this to now maintain separate random orders for search and full song list. Whenever you're in a search, a random queue for that specific search is used, and reset whenever the search filter changes. Otherwise the full song list's queue is used, which is never reset until the game is restarted or you went through the entire library.

@dgruss since the symptoms of the bug that I experienced were a bit different from what you described, I would appreciate if you could test this change once more!

@dgruss
Copy link

dgruss commented Jun 25, 2024

the change looks good. can't reproduce the bug anymore

@barbeque-squared
Copy link
Member

Works fine in Roulette. Has a weird issue in Chessboard when using search (if there's 1 result, R will always select the last overall song. if there's 2, it will select either the first search result or the last overall song) but that was also the case before this PR, and there's more issues in Chessboard anyway.

Also +1 for not bothering with the categories.

@barbeque-squared barbeque-squared merged commit f6d812c into UltraStar-Deluxe:master Jul 14, 2024
4 checks passed
@DeinAlptraum DeinAlptraum deleted the random-list branch July 14, 2024 13:29
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.

[Feature Request] randomness not random enough
4 participants