I analyzed shuffling in a million games of MtG Arena (2020)
old.reddit.com
old.reddit.com
Game developers are not incentivized to induce losses. Losses lead to poor session length and retention. Moreover, a desire for fast queue times discourages deck analysis by 'the algorithm'. Why restrict your matchmaking pool so you can pull the strings?
The only queue manip mechanism I know of is in the player's favor. If you're on a losing streak you can be queued with others on losing streaks as a way to break at least one of your steaks and prevent you from logging off.
Of course, no evidence for this at all, but it seems like a plausible reason to me why they might do something like what's described.
Now, your opening hand can give you no more than a hint of which world you're in, but it's the best you can get, short of library manipulation, including reshuffling and land-thinning effects (which are not available to all decks). What's more, Screw World and Glut World are bad, and there's two of them, whereas Balanced World is good but there's only one of it. So you're more likely to be in the Screw or Glut World, than the Balanced World, in any game you play.
So if you get a 2-land opening hand, you can expect to be in a Screw World, and if not, then you can expect to be in a Glut World (with the glut of land lurking just beyond the first 7 cards). If you see a 5-land opening hand, the same but for a Glut World.
And if you get a balanced opening hand, well, you may not be in a balanced world but, at least, if you've built your deck right, you can play your game for a few turns, and that should really be enough.
Note that all that happens in the physical game, as well as the online games. The only difference is that in the online games the shuffling is done automatically, but whether this means it's a shuffle more or less likely to bring up Balanced World draws, that's up for research.
The solution is to always try to play degenerate decks: decks that need only very little land (Good, old, Senor Stompy being the exemplar- I'm talking about the 18-land Ice Age archetype) or decks that need a lot of land, like decks with big, splashy, expensive spells that need to be stuffed with 25-26 land (in 60-card formats that is). That way, you're artificially tipping the scales towards either a Glut World or a Screw World, but you've actually built your deck around it. And now you have two good worlds to look forward to (because the Balanced World is not going to hurt you if, again, you've designed your deck right) so luck's on your side.
You gotta make your own luck. The rest is self-deception. And people who play games of chance always have their little superstitions.
MTGArena aggressively manipulates what kind of deck you will play against (which disables the ability to make a counter META deck, since after picking a few counter mechanisms you're very rarely going to be put against the archetype you foil even if you hunt half the field), manipulates who goes first (some Streamers stand at recording over a thousand games and have gone first under 30% of the time, current formats are extremely powered up so the first turn advantage is the deciding factor of who wins often), and manipulates opening hands (something the devs have blogged about).
While harder to prove MTGArena also buries/floats cards. Some cards have patterns of existing in your opening hand or only after your 17th-22th draw, others occur in your opening hand more than 50% of the time, some truly toxic cards like Agent of Treachery are likely to have 3 of 4 of your copies in the last 20 cards. (Agent of Treachery is the easiest to see since such decks also have to tools to cycle through their deck and stall out the game to see their whole deck).
The shuffler also has a habit of giving duplicates of cards or making someone draw a duplicate of a card more often than "expected".
> MTGArena aggressively manipulates what kind of deck you will play against
> manipulates who goes first
> MTGArena also buries/floats cards.
> The shuffler also has a habit of giving duplicates of cards or making someone draw a duplicate of a card more often than "expected".
These are all falsehoods spread by people who are looking for something to blame after losing games. Seeing patterns that are not there.
You're posting conspiracy theories as if they're facts. There is no evidence to support these claims. Why would the developers spend money implementing such features just to make their players angry and dissatisfied? They can barely hold the game together as it is.
> and manipulates opening hands
This part is true, but only in a limited way in best-of-1.
Match making is generally designed to provide fair matches; this will naturally result in even really good players losing matches as their ELO rating converges on where it's supposed to be. It's like how in many games you'll see players complaining about a "forced 50% winrate" when really, that's just what happens when you're at roughly where you're supposed to be. You can't win forever.
> MTGArena aggressively manipulates what kind of deck you will play against
Only in Historic brawl is there desk strength based matchmacking
> manipulates who goes first (some Streamers stand at recording over a thousand Never confirmed.
> While harder to prove MTGArena also buries/floats cards. Some cards have patterns of existing in your opening hand or only after your 17th-22th draw
Not confirmed, and an easy thing to get confirmation-bias on.
>The shuffler also has a habit of giving duplicates of cards or making someone draw a duplicate of a card more often than "expected".
Not confirmed and doesn't make sense? It's not like the shuffler is shuffling the deck as you play, that would break far too much.
EDIT: To be clear, the only actual shuffle "rigging" Magic Arena does (that the devs have talked about extensively due to Arena being Bo1 and Magic traditionally being Bo3) is your initial hand is generated twice and the shuffler chooses what it thinks is the better opening hand to present to you. After that it's all random.
I believe the only thing it does is shuffle your deck twice and try to give you the better starting hand of the two.
That said people do sometimes unintentionally write something like this (terrible and also buggy) algo
for idx in size(deck):
new_spot = int(random() * size(deck))
swap(deck[idx], deck[new_spot])
...which won't give an even distribution of all possible outcomes. If shuffling, look up a real algo (like Fisher-Yates for instance) and implement that. Or better yet, use a library implementation. -- To shuffle an array a of n elements (indices 0..n-1):
for i from 0 to n−2 do
j ← random integer such that i ≤ j < n
exchange a[i] and a[j]Nerd sidenote: Because generating random numbers tends to be expensive, I had an idea once where you generate the full permutation with only a single random sample. Basically you could use something which fully enumerates a space like Gray codes[1] (you want one with a closed form solution which can arbitrarily you the nth code) then you generate one random number, multiply by the number of combinations, look up that code and decode that into the sequence of cards. I never actually got around to implementing it, but I suspect if your code lookup was fast it would be much faster than Fisher-Yates.
The use case was if you wanted to make a Monte Carlo algorithm to evaluate strategies in a card game for instance.
Might not work - as I say I never actually got around to implementing it.
[1] https://en.wikipedia.org/wiki/Factorial_number_system [2] https://en.wikipedia.org/wiki/Lehmer_code
Also, you’ll have to make sure you pick each permutation is picked with equal probability. random() % factorial(52) likely won’t work because your RNG won’t return integers in a range k × 52! for some k > 1 (https://stackoverflow.com/questions/10984974/why-do-people-s...)
You can think of it as rolling one random number up to n!, then use x%n to pick the first element and then x/n to pick the next (n-1) elements (so the next step is then to pick the second element with (x/n)%(n-1) and use (x/n)/(n-1) for the remaining (n-2) elements).
Though as a sibling comment points out, since you need a random number up to n!, even 64 bits of randomness only get you so far (I think up to 20, but didn't check my math).
for i in [0..n-1] swap(a[i], a[rand in [i..n-1])
where rand in [I..n-1] coud be implemented as i + (rand() % (n-i))
essentially start with your finger at 0, pick a card from the unpicked set which is everything on and after your finger, swap that card with your finger, move your finger up one card
Fisher-Yates is pretty obvious but weirdly subtle in some ways. For someone not paying attention, it would be easy to get wrong, as the grandparent response points out.
If using a library implementation, you do still need to validate that it's using a proper algorithm. And that it doesn't change to something else during an update. Which probably requires you to understand the algorithm, and looking at wikipedia, it's a handful of lines of code to do it right and know that it doesn't change because it's your code. Maybe not worth the time to inspect and reinspect from a library.
That hasn't stopped the rumors.
So it's quite possible that the online Magic game manipulates the deck. Keeps players engaged more so they make more money. Pretty standard these days; Candy Crush famously does this too. Looks random, but very much isn't.
The game mitigates this with a mulligan rule, where you can get another hand with one less card if you want. That way, you can get rid of a bad hand, but it costs a card each time. Commonly, magic players overvalue the card, and don't mulligan hands that they should, but it is also possible (and common) to just lose games to luck even if you do everything right - top MTG pros only have ~65-70% win rates against random people.
MTG arena apparently also does an internal free mulligan for you (to make the game more fun) - it draws 2 hands initially and gives you the one with the better mix of cards.
Is there a name for this approach/any info on why it doesn't work?
Base case: n=1. Obvious.
Inductive step: n>1. The nth element swaps to itself w/ prob 1/n, and to any other element w/ prob 1/n. By induction the other elements have been uniformly shuffled. Any of those elements is swapped to the nth place w/ prob 1/n.
This proves that
for i in range(min_key,max_key):
swap(arr, i, choice(i, max_key))
works as a shuffle, by growing a random sub-array.*The first algorithm was
for i in range(min_key,max_key):
swap(arr, i, choice(min_key, max_key))
which has different biases.* I am not actually sure that this actually works.
Step 1. Swap a, c -> [c,b,a]
Step 2. Swap b, c -> [b,c,a]
Step 3. Swap a, a -> [b,c,a]
What is the probability that we do exactly these steps? At each step, we have 3 choices, so (1/3) * (1/3) * (1/3) = 1/27. What is the probability that we end up with [b,c,a] ? You might think 1/27 as well, but that is not quite true – it is possible, that we choose different steps, but end up with the same result. For example, we can do [a,b,c]->[b,a,c]->[b,c,a]->[b,c,a]. But the probability will always be a multiple of 1/27 – it is just 1/27 times the number of possible paths that leads to [b,c,a].Now, what should the probability be? There are exactly 6 ways to shuffle [a,b,c] (this is the number of permutations, 3! = 3 * 2 * 1 = 6). So we want to get [b,c,a] with a probability of 1/6. But 1/6 is not a multiple of 1/27 ! (You can see that by looking at the equation 1/6 = x/27, which is the same as x = 27 / 6 = 4.5 .)
The same argument works for any length n > 2, as n*n is not divisible by n-1, but n! is.
There's probably a bunch of other examples of this kind, (easy out of place, tricky in place) but non come to mind atm.
Suppose we're talking about a regular deck of cards, and someone says "the shuffler gives the first player too many hearts". That requires a different test to debunk/support it than the hypothesis "the shuffler gives the third player too many aces".
In other words, any claim that the shuffle is not random needs to include a testable assertion about the direction of bias it has, and allows you to make predictions about the next card with better than random accuracy.
That and some spicy uncontrolled multiple-hypothesis testing.
Seems like a pretty unreliable analysis as a result.
The more interesting comparisons that have been done are between what the shuffler is like for players that actually pay money to play the game and the entirely free to play crowd.