Question about the AI

I’m actually slightly jealous. That said, it sounds like defense wins would be even worse on Console as an unpredictable clown is driving your team, versus the predictable (more “optimal”) clown of the PC version.

4 Likes

Same strategy applies. Build your team to be as independent of the ai as possible. Attack all troops go a long way here. Goblins too only for the long runs of extra turns. Mana transformers may sometimes pick the wrong gem, but usually are safe. Maw, especially with skulls.

Basically anything that minimizes any choice the computer has to make or that just has the power behind it. Safest defense team to build.

2 Likes

Ok, we found two minor things in the console AI which made it slightly different from the PC side.

Neither was the “smoking gun” we’ve been hoping for, but there’s hope that fixing them will improve the perception of the AI.

Here were the issues, which will be pushed out with the next minor update.

1 - Troops that were full of mana (ready to cast their spell) were getting TOP priority, instead of ZERO priority. This only applied to situations in which the AI had determined that no 5/4/skull matches were available. In general the AI likes to collect mana that fills a troop, if possible. When a troop is full the AI ignores those mana colors, which makes sense. But on console a “full” troop would get its mana colors prioritized over other colors. Which would be fine if that color(s) are used by later troops, but would be sub-optimal in most situations.

2 - Dead troops were not being excluded from the “what mana colors does my team need?” check. Again, this doesn’t directly explain why the AI would even select colored gems over skulls. But it does explain why the AI would choose to match a color that none of its troops can use. If the AI team had a yellow/red troop that died, it would still think that yellow/red mana would be useful to its team.

I suspect this #2 thing is nudging the “AI gives up” behavior, since when more AI troops are dead you’d run into this bug more frequently.

Again, this doesn’t satisfactorily explain why the AI would pass on skull matches. But it’s possible that the “skip skull matches” is something deeper in the code and is actually present on the PC/mobile side, BUT it never comes up because these two other issues mask it. So fixing these small errors on the console side might remove the “skipping skull” behavior.

2 Likes

This may be related, it may not be.

Sometimes when there are skulls or a 4 match, if the computer doesn’t take them, most often it will make a move to prevent the player from taking them as well. This occurs at anytime and not simply at the beginning or toward the end. This behavior is what makes the console matches a little more interesting since it may grab colors it needs and prevents the player from getting the extra turn or damage as well. Like if I don’t want it, no one else will have it too.

2 Likes

I’ve noticed these “smart” moves before and always assumed the AI was actually “playing against” me and my needs. Sad to hear it was accidental.

1 Like

I, for one, feel relieved I’m not crazy and that my belief the AI “wasn’t right” is finally vaildated.

@Mr.Strange The AI trying to fill dead Troops would probably explain most, if not all, the “giving up” behavior. The Mana priority thing would definitely mess with other logic checks. I can see these two changed “fixing” these inconsistencies we have between the two AIs.

@Mr.Strange

I don’t know how its related but even when not playing against an opponent, like in Treasure Hunt the AI can not “see” and identify (with suggestions turned on) all the 4 and 5 matches available on the board. Just another data point you.

It doesn’t quite explain the skipping-skulls behavior, though. Prioritizing colors incorrectly, sure, but either there’s another bug in there, or (like @Mr.Strange indicated) the latent, incorrect behavior was somehow exacerbated by these other issues.

What confuses me a little is that the core engine would differ between platforms at all. Typically, you’d see a ported game require a rewrite of I/O and other system services (most obviously in the case of Gems of War, controller input) but the core engine should be universal and shared. Evidently not?

While those two issues should not really be present I hope fixing them does not make the AI robotic. Id like to keep it the way it is personally.

1 Like

All I know about programming and code is that it’s INCREDIBLY delicate. You get small things cascading into large problems and unrelated code somehow affecting each other.

Even a single addition or omission in a line of code can “ruin” an otherwise finely-tuned AI.

1 Like

I bet you’d find quite a few people who have played both would lime to see the console version stay close to how it is. The quirks and unpredictable actions keep it more interesting.

3 Likes

This just happened. Highlights how the AI will “abandon” a near-dead Troop.

I don’t see how the Mana priority flip or dead Troops (there are none) issues are present, but you never know.

EDIT: It appears the AI had “fill Brown” as top priority

1 Like

Oh, I’m not saying it isn’t (or rather, it has the potential to be delicate). Much like physical architecture, you can have a solid base or a flimsy one, and a lot of what gives a code base “legs” is the ability to make changes without introducing regressions. Any project of sufficient size would have unit tests in place to catch this sort of thing.

For instance: A developer may assert: “Given a board layout of X (some fixed random seed), and troops with Y mana and Z conditions, the AI should be doing action Q.” Your engine, written with proper dependency injection, would be isolated to the point where you could put it under test and see that, indeed, those inputs produce the expected output. Thereafter, this unit test is run over the code before any change is committed to the CVS, and if it fails the change is rejected (or if the logic was intended to change, the test is updated).

Written properly, the Console team would inherit these tests along with the production code, and these discrepancies wouldn’t make their way into the end product.

Reality being what it is, time pressure often prevents adequate unit test development, but the more you have, the firmer your foundation becomes.

Neither of the two minor bugs we fixed this morning appear to be at work in this case.

1 - No enemy troops are full (or have ANY mana!)
2 - No enemy troops are dead.

It is true that YOU have two “full” brown-mana-using troops… maybe try to pay attention to whether or not these bad behaviors happen when your troops are full on mana?

1 Like

Interesting point. I will keep an eye out.

Which difficulty level was this?

PvP, so no difficulty

Here’s another weird AI choice that just happened. AI’s dead Troop is Bone Dragon.

1 Like

One Troop Rock Worm team didn’t even try to win.

It had two turns. First, it skipped Skulls to match Blues. Second, it skipped Browns to match Reds.

1 Like

@Mr.Strange
I always assumed there was a random factor in the move priority list because you want the ai to make mistakes. The ai perfectly following a set of move rules is borring.