It's the first new build of 2022, and it's time to finally teach those bots how to play CUE. Let Kyle, the mastermind who took our bots to boot camp, explain;
We've rewritten the opponent AI from the ground up with 2.5.5. The previous version of the AI was building on a foundation put in place when CUE was a very different, and in many ways simpler game. As a result, bots would perform reasonably well under certain conditions but often struggled when it came to effectively factoring in different rulesets and newer, more complex ability types. The old AI would somewhat regularly make moves that to any competent player seemed...well, totally boneheaded.
As a result, we went back to square one when considering how the AI should operate. The sheer number of possible card combinations is immense, and the rules can change from game to game, which means the AI logic has to be very good at analysing game state and prioritising accordingly. It was important to us that the AI would perform just as capably in a game with 100 starting energy and just one turn, as it would in a standard 5 round, 7 energy/turn game, so we got to work on coming up with a plan for an AI that could do just that.
As a starting point, we focused on writing some logic that could evaluate total power for every possible combination of cards playable on a given turn, which was quite a lot of work but on its own was relatively straightforward. This was an area that still needed a number of improvements from the old AI, as the previous iteration didn't effectively handle certain ability conditions, such as factoring in position for abilities that depend on being played in a certain slot. Certain abilities are also not guaranteed, being dependent on conditions that won't play out until later. As such, we need to make educated guesses about whether these abilities are likely to trigger or not and factor that into an estimated power value. As well as estimating whether abilities are going to trigger or not, in many cases, we also need to estimate how many targets they're going to hit. Some things we can be sure about, but if we're playing an ability that targets opponent cards under 50 power, we can only make an educated guess on how many cards we're likely to hit.
One thing worth noting here that was very important to us in developing the AI is that it should never have access to information that a human player doesn't. So it doesn't know what's in your deck, or in your hand, and it doesn't know what it's going to draw itself next turn. It can make educated guesses just like a good player would, but it has no fundamental edge in terms of the information it can access.
Writing something that can calculate all the possible combinations that can be played on a turn and what they will score is a great start, but for an AI to be truly intelligent that logic needs to be extended to factor in the effect that playing a particular hand will have on future turns as well. Sure, 'Cheese Rolling' played on turn 1 will give an extra 200 power. 'That's great, surely nothing can beat that?' the naïve AI thinks to itself. But once it starts factoring in the -80 power on turns 2 and 3, maybe that card suddenly starts to look less appealing. This means that the AI needs to factor in what turn it is, who's currently winning and various other factors, and use those to influence its decisions. As a very basic example, a card that gives +4 power/turn for the rest of the game will always give the same power for the turn that it's played (ignoring arena bonuses). However, it should be considered a much more powerful card when played on turn 1 of a game compared to turn 10.
The round-based nature of the game only adds further complications. Having essentially a clean break on scoring every few turns makes assessing each turn much trickier. It introduces a bunch of new questions for the AI like whether it's worth playing its best cards when it looks it's likely going to lose the round anyway. Or whether it should focus on future rounds at all when losing the next round will mean losing the game.
As you might have gathered by now, the process of choosing which cards to play on a given turn becomes very complex when factoring in all of these considerations. Thankfully, we believe the new AI is up to the task! There'll undoubtedly be further tweaks to come in the coming weeks and months, but this update gives us a great foundation to build on in order to achieve our goal of creating fun, challenging bots to play against.
One final thing that is worth mentioning however is that while the AI can be incredibly sophisticated, it still amounts to very little if the deck it's using is poorly constructed. As such, we've got some exciting plans for the near future when it comes to bot decks, to arm them with the sorts of decks that you'd expect to see from human players at your level.
BUILD NOTESNew, improved AI.Replaced the 'Complete All' objective with another regular objectiveTweaked card fronts so the tags around the collection icon for limited etc don't have a tiny gap between them and the frameThe 'GO' button for the share deck objective now takes you to the decks tab in the collection instead of a separate decks scene which wouldn't work sometimes