On Tile Randomness

DaveR4470
DaveR4470 Posts: 931 Critical Contributor
edited September 2015 in MPQ General Discussion
Note: this is not going to be a "the AI cheatz!!!!" or "the AI knows/generates ridiculous cascades for itself and CHEATZ!!!" thread. I don't believe either of those things.

Now, having said that....

I've just passed a year in MPQ (yay Devil Dinosaur!), and have played thousands of individual games over that time. And in that time I've noticed, with 99.999% certainty (a), two things:

(1) I have never had an initial board that lacked a match.
(2) I have never had an initial board that had an immediate match which triggered before the player's turn.

Statistically, this is almost impossible.... IF the initial tile seeding is random.

Also, I've observed (without any empirical evidence, mind you, so grain of salt and all) that the characters you pick do seem to influence the color distribution on the board you initially see.

Ergo, I've concluded that while a tile drop during play is random (in that the program generates a random tile for each vacancy with slight underweighting to team-up tiles, as the devs have said)... the initial board you see is not randomly generated.

Specifically, I think the program (a) weights the active colors of the player's and opponent's teams higher in the initial matrix generation, and (b) throws out any boards with immediate or no matches.

I've never seen the devs comment on how the software populates the initial board -- just assurances that tile drops are random. But I think this is relevant, because a "seeded" board plus non-random selection after the initial state (= you're not randomly choosing which tiles to match, and neither is the AI) would (I think) statistically increase the odds of a cascade even if the tile drops are randomly generated.

And that would mean that both the dev-side "trust us, the drops are random!" position and the player-side "but the AI always seems to cascade on me!" observational complaints could both be true, and it would also end world hunger, bring peace to the Middle East, and make Quicksilver a useful character, etc. etc. etc.

tl;dr: fess up, guys - the initial state isn't randomized.

(a) .001% doubt attributable to "I'm old and there are wolves after me and brain no workie like it used to."

Comments

  • Malcrof
    Malcrof Posts: 5,971 Chairperson of the Boards
    DaveR4470 wrote:
    (1) I have never had an initial board that lacked a match.
    (2) I have never had an initial board that had an immediate match which triggered before the player's turn.

    The initial setup is most likely random, but has stop triggers in for no-match and auto matches.. to ensure it doesn't start out with an unfair advantage for anyone.

    I have seen boards start with multiple match 5+ possibilities... i have also seen board with so many team up tiles.. it is hard to find anything else.

    There is an algorithm in place somewhere .. what we need to do, is start screenshotting opening boards.. i am sure we can figure it out!
  • The obvious solution is that they randomly seed the initial board, then run it through the normal "end of turn" code before showing it to you. That would finish all available cascades and also reset the board if there are no matches. I've seen other match3 games that actually do the "cascading 'till it stops" step in plain view such that you start your game, see a bunch of cascades that do nothing to anyone, then are allowed to start playing.

    That doesn't answer anything about color % weighting, but it is the most likely candidate, imo, for no initial auto-matches and no available matches.
  • DaveR4470
    DaveR4470 Posts: 931 Critical Contributor
    Sundance -- if it wasn't for the color issue, I'd assume exactly that - mainly because it's by far the easiest option to program. (call [applicable subroutine]. BAM! I'm done, boss, can I go home early??? icon_e_smile.gif )

    But technically... if it does that, it's not a random board. Because it means there's a discrete and definable subset of the total set of potential boards that are impossible to obtain. That's sort of angels-dancing-on-the-head-of-a-pin territory, true....
  • It occurred to me that they must also scrub out initial crit tiles if they use the "random->process cascades" approach. More (not) importantly, I do wonder about the distribution of initial boards.

    Obviously we're not going to start with insta-matches or no available matches, so the set of initial boards are not evenly distributed across all possible boards, but they might still be evenly distributed across the set of all reasonable boards.

    If we define something like a "stable" board as one with no current matches but at least one potential match, then one could create the space of all possible "stable" boards and choose evenly among them. My question is whether or not a "random->process cascades" approach will evenly choose amongst all stable boards or not.

    As the game is played, there will be more matches at the top than at the bottom because the bottom matches will have been taken and top matches don't churn the bottom. But does that apply to just a single cascade evaluation after random generation? Are there more matches available near the top of initial boards than near the bottom? _Should_ there be more at the top if they evaluate the first cascade chain behind the scenes? Hmmm...
  • simonsez
    simonsez Posts: 4,663 Chairperson of the Boards
    DaveR4470 wrote:
    Specifically, I think the program (a) weights the active colors of the player's and opponent's teams higher in the initial matrix generation
    Anyone who's used PX/GSBW regularly against lv395 opponents feels like the average number of purples on the start board is somewhere around 3, so I'm gonna say you're right they're weighting it, but you've got the method backwards.
  • Malcrof
    Malcrof Posts: 5,971 Chairperson of the Boards
    We really do need a subforum for Statistics and Theory.
  • Considering the AI still doesn't know how to prioritize a match-5 over a match-4...

    I'd be very surprised if every character had a secret color prioritization that modified the probability of certain colors showing up at the start of the board.
  • DaveR4470 wrote:
    Note: this is not going to be a "the AI cheatz!!!!" or "the AI knows/generates ridiculous cascades for itself and CHEATZ!!!" thread. I don't believe either of those things.

    I've actually come to believe that the AI knows what the next 20 tiles are going to be.

    It always, ALWAYS makes matches that result in extra cascades so much so that there is NO WAY it could be this lucky.

    If all logical conclusions have been eliminated, you must accept the illogical.

    Which is: The AI knows what the next 5 or 10 or 20 tiles are.
  • We really do need a subforum for Statistics and Theory.
    Not really sure about the sub-board, but I may as well geek out a bit more while I'm here...

    People often confuse or mis-use "random" when they mean "white", or uniformly distributed. The initial colors could be skewed towards (or against) the available powers, and still be random in a technical sense (ignoring PRN nonsense). For example, let's say they target 2x more red than purple. The probability density function across colors would just be something other than a flat line in that case, but the process could still be random.

    Having said that, I don't believe they color the colors' pdf, so to speak. icon_razz.gif I thought so in the beginning as well, but after grinding a lot with the same team in rapid succession (lightning round seeds, mostly), I find that there is a broad mix of initial boards with colors I use, the enemy uses, or nobody uses. Also a wide variety of boards with lots of cascades or almost no moves at all.

    Of course I enjoy and then forget about the boards that help me out, while forever remembering that time I got completely screwed when I was at 1698 in Simulator, never to get that high again!
  • Eddiemon
    Eddiemon Posts: 1,470 Chairperson of the Boards
    DaveR4470 wrote:
    Statistically, this is almost impossible.... IF the initial tile seeding is random.

    Tiles are never 'random'. It's computer generated so it's always pseudo-random based on some algorithm.
    Also, I've observed (without any empirical evidence, mind you, so grain of salt and all) that the characters you pick do seem to influence the color distribution on the board you initially see.

    Ergo, I've concluded that while a tile drop during play is random (in that the program generates a random tile for each vacancy with slight underweighting to team-up tiles, as the devs have said)... the initial board you see is not randomly generated.

    No it doesn't follow. Even if your argument that character X increases purple and decreases green were true, you can just adjust the values in the random generation algorithm. Which still makes the board pseudo-random.
    Specifically, I think the program (a) weights the active colors of the player's and opponent's teams higher in the initial matrix generation, and (b) throws out any boards with immediate or no matches.

    You don't need to throw out any initial match boards. Just don't create any. If you have generated two blue tiles in a row simply change the distribution for the next tile so it can't be blue. Similarly if there is a green tile above and below or left and right, then change the distribution so that green isn't an option.

    It still makes the board pseudo-random, like before, just a different algorithm.

    Generate the board in a spiral from the centre. This means that if there is an opening match 3 it will be well distributed around the board. If while generating tiles there is an opportunity to create a match 3 move and no match 3 move yet exists, make the next tile the correct colour for an initial match 3.
    I've never seen the devs comment on how the software populates the initial board -- just assurances that tile drops are random. But I think this is relevant, because a "seeded" board plus non-random selection after the initial state (= you're not randomly choosing which tiles to match, and neither is the AI) would (I think) statistically increase the odds of a cascade even if the tile drops are randomly generated.

    Every tile is "seeded". This is computer generated random, not natural random.

    And I have no idea how you made the jump to cascades being more likely based on board generation. I also don't understand how you're not choosing the tiles to match, that leap completely lost me.
    And that would mean that both the dev-side "trust us, the drops are random!" position and the player-side "but the AI always seems to cascade on me!" observational complaints could both be true, and it would also end world hunger, bring peace to the Middle East, and make Quicksilver a useful character, etc. etc. etc.

    But they are both true. I win most of the matches I play. The exception is matches with cascades, and that seems unfair so I remember them more. Plus this is the internet and hyperbole is a favourite argument strategy. Hence the computer "always" cascades.

    And the drops are horribly random. They should use a better random algorithm so it can't drop the same tile 3 times in a row. You would still get cascades but nowhere near as many with 20+AP in them for either side.
    tl;dr: fess up, guys - the initial state isn't randomized.

    Well it all depends on how you define randomised. But it definitely isn't deterministic.
  • Tenaciousdecaf
    Tenaciousdecaf Posts: 71 Match Maker
    throvolos wrote:
    DaveR4470 wrote:
    Note: this is not going to be a "the AI cheatz!!!!" or "the AI knows/generates ridiculous cascades for itself and CHEATZ!!!" thread. I don't believe either of those things.

    I've actually come to believe that the AI knows what the next 20 tiles are going to be.

    It always, ALWAYS makes matches that result in extra cascades so much so that there is NO WAY it could be this lucky.

    If all logical conclusions have been eliminated, you must accept the illogical.

    Which is: The AI knows what the next 5 or 10 or 20 tiles are.

    I've read a couple of these threads and have started paying attention to my cascades vs. the AI's. I can positively state that I generate the same quantity and quality of cascades over the course of a week. Something interesting that I've noticed during this is that my cascades almost always happen vs. Trivial nodes and AI cascades frequently happen during "normal" nodes. Weird.
  • XandorXerxes
    XandorXerxes Posts: 340 Mover and Shaker
    throvolos wrote:
    DaveR4470 wrote:
    Note: this is not going to be a "the AI cheatz!!!!" or "the AI knows/generates ridiculous cascades for itself and CHEATZ!!!" thread. I don't believe either of those things.

    I've actually come to believe that the AI knows what the next 20 tiles are going to be.

    It always, ALWAYS makes matches that result in extra cascades so much so that there is NO WAY it could be this lucky.

    If all logical conclusions have been eliminated, you must accept the illogical.

    Which is: The AI knows what the next 5 or 10 or 20 tiles are.

    I've read a couple of these threads and have started paying attention to my cascades vs. the AI's. I can positively state that I generate the same quantity and quality of cascades over the course of a week. Something interesting that I've noticed during this is that my cascades almost always happen vs. Trivial nodes and AI cascades frequently happen during "normal" nodes. Weird.

    I've noticed that the AI tends to have more "small" cascades than I do, but that the AI tends to have the same number of truly massive cascades (20-30+ AP) that I do.

    My problem is that these happen at all. The odds of the cascades that do happen are so statistically low that I'm not convinced the tile generation is being properly randomized - and that's only based on new tiles that fall in, not their interaction with current tiles on the board.
  • So basically what you are saying is
    "The ai is programmed in such a way that enables cheating of the ai characters based on their color array"
  • Omega Red
    Omega Red Posts: 366 Mover and Shaker
    When prof x was released and I played with him I used to run into an unusually high number of starting boards with a match five available. Then after a couple of months that seemed to cool down a bit. These last few weeks the tendency to start with a match five has increased again when I use him.

    I remember a particular node from the psylocke pve. It was a repeatable with essentials so I got to play it a lot and the starting board always was flooded with green, yellow and team up tiles, the colours not covered by the essential team. There is no way things like that are mere coincidence.

    In pvp the distribution always seems to be fair and equal. You get a bad board or **** cascades against you and the next game you get a good board and cascades going your way. In pve on the other hand, they tend to be always against the player and seem to have been designed that way.
  • Omega Red
    Omega Red Posts: 366 Mover and Shaker
    The simulator node with Prof X, Jean and Cyclops had an unusually high rate of five matches. I'm not talking about the ones you can avoid by matching something else, but the rare ones that fall through a cascade. No matter how conservative my move was, the resulting cascade tiles would create a five match. Even if I only matched for three at the top row the three resultant cascade tiles would be of the same colour and match for five the adjacent tiles. I played this node like eight or nine times and at least six or seven had five matches like this either for me or the AI which doesn't matter anyway, both hurt you hard. No other node had these many cascades resulting in five matches. Quite a coincidence!

    This is exactly the kind of thing that makes a player think there's a cheat in this game. It is one thing to create a five match or give ap to the AI because you were careless. It is another when you make the safest, most controlled, conservative move and the AI still seems to force its way into you.