How does duels of the planeswalkers work




















So instead we do a super-fast first pass. This takes into account a few basic things such as evasion, trample, and first or double strike, but nothing more sophisticated. It very rapidly tries every combination of attack formations and every combination of block formations for each of these attack formations.

For the propeller-heads out there, it pre-packs first-strike and normal power of both creatures into the 4 bytes of a bit word and the toughnesses of both into another, subtracts the first from the second for each permutation, and inspects the results. It then scores the formations according to a simple calculation based on damage dealt including player death and creatures destroyed. These results are sorted, and we then have a list of possible attack or block formations in order of probable preference.

If the AI is attacking, for each attack permutation, it performs this super-fast block calculation for every blocking possibility, sorts these, then assumes that the opponent will pick the best possible block formation and uses this final score to score the original block formation. We can then start the full tree look ahead which sees such things as regeneration, triggered abilities, etc. So, how does the AI actually perform the basic noncombat look-ahead, and the full tree look-aheads?

Here we come back to the instance-based nature of the Magic engine. The game actually contains multiple engines, one for each AI process. These are complete copies of the game in every way bar graphics, sound, etc. They can therefore process events by trying something and instantly skipping forward to see what happens, all without affecting the game that the player can see. We then need two more pieces to the jigsaw: the AI "worlds" need to be able to synchronise with the player's perspective of the world, and they need to be able to rapidly undo time in order to wander up and down the branches of the futures tree.

These two problems end up converging, in the sort of software synergy that happens once in a blue moon. Things normally get more complicated the more you think about them in this business, not less! The need to be able to undo actions required us to incorporate the idea of an "undo buffer" into Duels.

This is a data buffer into which you pipe a sequence of bespoke commands such that there is sufficient information to interpret the buffer in a reverse direction and completely reverse time.

This means that we can fully revert the state of the game to any point in the past in such a way that it is genuinely identical to the state that it was actually in at that point, and can thus re-commence execution from there. Of course, the software engineering hurdles involved in achieving this in such a reliable manner are considerable, and thus beyond the scope of this article.

Needless to say, this system is critical to the AI's ability to experiment with multiple possible futures. However, the free bonus feature that came with the implementation of this system was the ability to synchronise the AI brains with the real world. If we have a system that can define all the actions of the game in a buffer, we can therefore transmit that buffer between versions of the world and thus replicate the state.

How this works is that when something happens in the "real" world—a card or ability is played, something resolves on the stack, a step changes, etc. Through various cunning multi-threaded semaphores and witchcraft, the other AI threads are informed of this. They then stop whatever it is that they were doing as whatever it was, it's no longer relevant now that the state of the world has changed. They then collect the data from the global undo buffer from the point that they last knew about, rewind their world to the same point, then apply this data to their own world as a sequence of actions in order to bring themselves to the same state that the main world is in.

This data is extremely small and efficient—it only consists of minimal things such as a certain card being played. The ramifications of this are not piped. Instead these effects are implied because they will occur for themselves in each of the parallel worlds that are used to calculate the AI. So how does the AI come up with strategies and cunning combos? It doesn't. What it does is employ a "peep-hole" approach to AI, in that all it ever considers is what it can do and what other players might do right now.

Each time it considers such moves, it no longer has any concept of previous actions, nor any notions of subsequent ones. However, it has a Giant Growth in its hand and an untapped Forest.

For each of these, it then tries all blocking options that its opponent might perform. In the blocking priority window it then tries doing nothing, and playing Giant Growth. So this great result ripples back through, because the best possible result for the player in question which includes the opponent when it's their action—"best" being from their perspective is the one which most influences the scores of what came before it in the tree.

The logic is that if it was better to do this when looking ahead, it's still going to be better to do this when it comes to actually making that decision in the future. Or, if it's not, because something else has changed, e. In fact all that happened was a simple sequence of logic simple in concept, not in implementation! So what problems emerge from this system? Well firstly, we just don't have the horsepower to look that far ahead. Crucially, this means that the AI doesn't understand the concept of holding back blockers to protect against your attack next turn, so sometimes it can be quite dumb in this respect.

Become a supporter of Eurogamer and you can view the site completely ad-free, as well as gaining exclusive access to articles, podcasts and conversations that will bring you closer to the team, the stories, and the games we all love. Read the Eurogamer. Sometimes we include links to online retail stores.

If you click on one and make a purchase we may receive a small commission. Read our policy. Jump to comments He lives in Bath, and is Terran for life. Review Arcane Act 1 review - Riot's glossy animated Netflix series opens with a striking, if familiar, bang. Premium only Ask Eurogamer: News. Feature Black Twitch UK and the importance of visibility. Far Cry boss quits Ubisoft after 10 years, reportedly leaves live-service Far Cry project. Pikmin Bloom downloaded 2m times in two weeks. Premium only Off-topic: Getting off the familiar fantasy merry-go-round, and loving it.

Premium only The Eurogamer Podcast: how racing games defined one of our finest. Supporters only Letter from the Editor: Feast and famine. The 10 most popular stories of the day, delivered at 5pm UK time. Never miss a thing. Will you support Eurogamer? Support us. Review Arcane Act 1 review - Riot's glossy animated Netflix series opens with a striking, if familiar, bang Magic show. Pikmin Bloom downloaded 2m times in two weeks Growth potential. Premium only Off-topic: Getting off the familiar fantasy merry-go-round, and loving it A Deadly Education.

Supporters only Letter from the Editor: Feast and famine The only thing worse than not enough games is too many of them. Or is it? Comments 49 Comments for this article are now closed. Thanks for taking part! Hide low-scoring comments Yes No. Order Newest Oldest Best Worst. It's not just that there are countless possibilities for deck concepts and compositions, it's that when I build a deck, it's mine. And in that moment, Magic goes from being "a fun game" to being " my game. From there, the next challenge was tackling the core-gameplay loop.

Any time you have highly open-ended systems in your games, it's valuable to put intelligent constraints on other aspects of play. For Magic —Duels of the Planeswalkers , this meant making the most out of the existing campaign systems that we had available to us from previous iterations. We knew we wanted to award cards and boosters for winning games, but we also knew that part of the fun of the game is creating special challenge scenarios that are as much a puzzle as they are a game of Magic.

These are great, but, like puzzles, once you've solved them, they lose a lot of their replay appeal. That's why we've introduced Exploration battles. You can explore on any of the five planes in Magic —Duels of the Planeswalkers , and you'll get a random battle chosen from several options for that plane. All of these are designed to be challenging and replayable, and winning these battles will earn you booster packs of cards from that plane.

Once you get going, you've got almost a " Magic RPG" feel to the gameplay—build a deck, win a battle, get a booster, improve your deck, and challenge a tougher foe. Deck building can be intimidating. From the beginning, we knew it wasn't enough to just take the training wheels off and throw people into a deck-building interface, we needed to provide as much or as little guidance as the player needed. Our starting point was the deck-building interface that allowed players to build sealed decks in Magic — Duels of the Planeswalkers.

From there, we enhanced the filtering options to account for the much larger collections that players would have access to, and developed a deck-building AI that would take into account things like mana curve, creature count, and even cross-card synergies.

From there, a player has a lot of options. The easiest way to go about constructing a deck is just to ask the AI to take a stab at building a deck according to a two-color archetype.

Each of the color pairs in Magic —Duels of the Planeswalkers has a strong mechanical identity—not to say that's the only way to build it, but, for example, the green-blue deck has a concentration of creatures and spells that can exploit enters-the-battlefield effects with ways to return your own creatures to your hand.



0コメント

  • 1000 / 1000