I understand the AI will always match a 5-line or a 4 if there are ones available.
But besides that, how do they decide what to match? I would think they would always want to match their strongest color, right? But it seems whenever I play with C4rol, they hardly ever match their strongest color. But in my mind, C4rol’s green would be amazing against AI because they SHOULD be matching their color anytime there’s a possible match that isn’t a different colored 4/5 line match.
The AI typically likes to match the colors you need the most
Me: “Okay I have 3 yellow AP for IM40.. oh there’s a match 3”
AI: ::matches yellow… Cascade into several 5matches::
Me: ::Throws phone and goes to Taco Bell::
I’ve thought for a while that even if the AI doesn’t work specifically to mess with the player, it would make sense for it to “choose” a power that it wants to cast, and always give that match color preference until it fires the power, then pick a new power/color, repeat.
The algorithm is weighted towards matching colours that will charge up an ability, but a match four will take precedence, even if the colour is useless for the AI team. If there are two matches that will charge abilities, it will pick one at random.
Also, I don’t think it is smart enough to notice that an ability is passive and doesn’t actually need any AP. You can see this when e.g. Luke Cage decides to match away his protect tile when there are other matches available.
Is there an in-line match-5 available? Take it. Otherwise…
Is there a match-4 available? Take it. Otherwise…
Have I used my Team-Up ability yet? If not, pick randomly between my “strong” colors and TU matches… aka colors that any of my characters deal more match damage in or any TU match, passive powers or not. Otherwise…
Make a match-3 using one of my “strong” colors - colors that match up with the colors the character has higher match damage in (for Juggernaut as an example, make either a green, red, or black match or for Wasp, make a yellow, blue, or black match). If I have used my Team-Up ability, TU matches are now lower priority than “strong” matches. Otherwise…
Pick any available match-3s available. If I have used my Team-Up ability, include TU matches.
Of course, it always feels like the AI is acting outside these boundaries, but this is consistent action for it. Hopefully this is clear enough to follow.
Then why does it always prioritize the in-line match-5s over a match-4 when both are available? I believe my statement is still correct.
Edit: I could be mistaken of course, and I’ll gladly admit when I’m wrong, but I have had numerous situations where both a match-4 and an in-line match-5 are available, and I have never seen the AI take the match-4.
According to the article linked above, which is the best information we have, the AI only looks for match-4s. Sometimes it gets match-5s, but only because they are also match-4s.
If the AI was programmed to look for match-5s, I would expect it to find T- and L- matches, as well; there’s no reason to specifically exclude those if you’re coding it to look for match-5s specifically, whereas it makes perfect sense if you’re only programming it to look for match-4s.
Fair’s fair. I’m not admitting defeat on this point until I see the AI bypass a match-5 in-line in favor of a match-4 when both exist, however. The article is almost 2 years old at this point; while I’ve always held it to be authoritative, to think that they haven’t updated the code to prefer a match-5 in-line over a match-4 in that time is possible, but it seems unlikely to me.
I fully understand that the AI doesn’t “see” the T and L shapes since it only checks a single axis, but to update it to check from 1 tile behind to 2 tiles behind the swap for the total number of tiles matched in one line isn’t much of a code change in nearly 2 years’ time based on the code as described.
FWIW, this is my understanding of it too. I feel like the AI might also work in some sort of defense aspect, where it matches my strongest colors sometimes even if their strongest matches are available.
Don’t know about you guys, but I feel like I’m getting good at guessing what matches it will make. Especially when the Hulk or baby groot is playing for me.
Number of matched tiles in a straight line, up to 4
Does the match charge an ability on the computer’s team?
That’s it. That’s all the logic. The first rule takes precedence over the second […] Sometimes the match-4 also results in a match‑5, but the computer doesn’t “see” the match-5.
I have never seen the AI take a match-4 when there is a match-5 available to it.
I remember reading somewhere (it might have been that article, I’m not reading it again to look for this info) that the AI looks for the match that gives it the most AP, searching by rows and columns (thus ignoring T- and L-shaped matches), possibly ignoring the gain from the row clearing of a match-4. Therefore, since 5 in a row gives the most AP, it will choose that first, then a match-4, and lastly a match-3.
We could probably suss this out… I’d always thought it was totally deterministic and used the same search pattern it does to resolve countdown tiles… we just need someone less lazy than I am to post a board, AP totals and the move made (along with any powers in order of use)… and we need a lot of them, probably something better addressed in a different forum altogether.
One possibility that is consistent with the blog post is that a match-5 is detected as two separate match-4s, considering each end of the line. This would double the chance of picking it over other match-4s on the board.