-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Interleaved decks #4492
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
base: main
Are you sure you want to change the base?
Interleaved decks #4492
Conversation
|
Please let me know if there are any problems testing-wise with my PR, it tests fine on my end but the github builder does not seem to agree. I read the log but couldn't make any sense of it. $ ./ninja check
Finished `release` profile [optimized] target(s) in 0.25s
n2: no work to do
Build succeeded in 0.07s.
$
|
|
Hi! I'm not a dev so I'm not sure I understand this correctly (clear examples for all cases would help), but it doesn't seem to do the random picking desired by the links in that topic.
Part of the request was to preserve the order of the cards within each subdeck, so this wouldn't work. It's still a nice option to have, just under a different name. |
|
@ZornHadNoChoice Yes, you are absolutely right, it does not exactly implement your suggested algorithm. This PR will make it so that if the deck is like this: Then if there is a limit of 8 cards, they will be drawn like this: I could implement your algorithm directly, however, hear me out... There are down-sides to drawing random decks. It's difficult to explain. It is sort of the problem with the long piece in Tetris. I think it might be a mistake to make it completely random. It is random in (original) Tetris, and that is not perceived very well by people. (People do not think it is random, when in fact it is.) And maybe it is not even good game design to have it random. Which is why many modern Tetris have a variety of algorithms. Another example of shuffled lists that are not random are music playlists that are being shuffled with user expectations taken into consideration. (Not the same artist back-to-back, don't repeat sequences, i.e. avoiding behaviors that will appear in uniformally randomized lists, etc.) So imagine if I made a new sort option that took deck id into consideration, I could theoretically make it shuffle with intra-deck card order preserved. That way it could be the best of two worlds. Or maybe I could just shuffle all the first cards ( |
|
In your example, it sounds like 2 cards would be pulled from That said, I'll leave it for folks smarter than me to weigh in. |
No. All decks have two cards drawn from them in total. One deck at a time. There is an equal amount of cards from Child_1 and Child_2. That's by design. If 8 cards are drawn: |
|
You're treating cards in Edit: see #4352 (comment). |
I've implemented a new gather order that has been been requested in the forums:
Interleaved Decks: Gathers cards by taking one card at a time from each deck in order. This allows new cards to be distributedevenly across decks. Cards from each subdeck are gathered in ascending position. If the number of decks are not equal to the
daily limit of the selected deck, the last round of cards will be drawn from a random sample of decks.
To make the gather order more predictable, I'm not going to randomize the deck order, instead it is round robin. You can always use the sort order to accomplish random order, so I think this is more useful like this.
I knew about #4352 when I wrote this.
This algorithm is O(n) over time for
n: gathered cards.