Breakdown of AI's gem matching logic?

yunnnn
yunnnn Posts: 168 Tile Toppler
edited October 2016 in MtGPQ Tips & Guides
I've noticed that the AI follows some very predictable patterns in the way that it moves. Is there already a thread that attempts to figure it out (for fun and victory)?

Updating this list below based on the comments:

1. Will try to get its main mana if possible, otherwise sabotage your main mana.
2. Doesn't look for cascades; it is very direct in its matching. See rule above. Cascades that happen are just coincidental. I certainly don't think it is optimized to get the most mana.
3. Prioritizes 4-lines, sometimes even over 5-shapes. It does not hit the obvious 5-shape maybe 30% of the time. There has to be some logic to this. My guess is that it prioritizes lines, so 5-lines will be hit almost 100% of the time, whereas 5-Ts only get hit if it satisfies one of the other rules. The reason for this is probably that checking for a 5-line is easier to write in the code than checking for a 5-T.
4. Prioritizes 4-lines even over 3-matches that will give it more mana. I often let the opponent get 4-lines of the wrong color as long as it doesn't look like there will be cascades. Playing against AI Koth, the AI often wrecks itself doing this.
5. There does seem to be some clear preference logic going on when weighing between 2 different 3-matches of the same color. Sometimes I notice that it prefers top left, then going right, then down. It does this even if the bottom right match causes an immediate cascade. I would presume that the ordering is likely due to the way it parses the 2d array of orb nodes.
6. If you have a support in play, the AI will sometimes prioritize destroying your supports, even over 4-lines. I believe this is conditional. It could be that it prioritizes supports that only have 1 toughness.
7. If you have traps in play, the AI seems to prioritize hitting the traps (and screw themselves over). Perhaps the AI considers traps and supports to be the same type of object.


Understanding these patterns provides a noticeable advantage when going up against the opponent. Is there anything else I missed (or is incorrect)?

Comments

  • Reaganstorme
    Reaganstorme Posts: 334 Mover and Shaker
    I've noticed that the AI will often chose the suggested match if I don't take it. For example, several availabe manapw.png rune match-3 on the field one blinks to suggest that I match it, but i take another. Next turn the AI will make the match that was suggested, even if another will cause a secondary match or cascade.
  • It prioritises matches that would hit the opponent's supports even over 4 matches, though only conditionally.

    I think it will take a match of its colour that also hits a support gem over a 4 match that isn't it's colour and doesn't hit a support, as this just happened to me.
  • Morphis
    Morphis Posts: 975
    I've noticed 4 matches are above their own color in priority.
    Those two should be swapped.
    Against Koth it's a big relief seeing him waste a delicious red match for a poor 4 match icon_e_wink.gif
  • Rogan_Josh
    Rogan_Josh Posts: 140 Tile Toppler
    yunnnn wrote:
    I've noticed that the AI follows some very predictable patterns in the way that it moves. Is there already a thread that attempts to figure it out (for fun and victory)? ...

    I'd certainly agree with all this. The gem matching AI seems very similar to MPQs. There was an article posted by one of the devs last year about how the AI actually goes about it's decision in that game which matches a lot of people observations about this one.
  • Foznertep
    Foznertep Posts: 121 Tile Toppler
    Actually, I found the AI to make 5 matches frequently, other than in MPQ where it actively avoids 5s in favour of 4s if possible.
  • Rogan_Josh
    Rogan_Josh Posts: 140 Tile Toppler
    Foznertep wrote:
    Actually, I found the AI to make 5 matches frequently, other than in MPQ where it actively avoids 5s in favour of 4s if possible.

    Thanks true. the MPQ AI can't see L shaped 5-matches but the MTGPQ AI can. (technically the MPQ AI can't see any 5 matches, even in a line. It just sees 2 4-matches very close together).
  • Morphis
    Morphis Posts: 975
    Also I don't know specifically how high on priority(but definitely not bottom) there is "pop opponent activate gems".
    It does not even check if it's beneficial or not.
    Will just try to deny your activation gems.
  • Foznertep
    Foznertep Posts: 121 Tile Toppler
    It also tries to match away supports most of the time.