Tank Tales #4: Building a Solitaire Bot for a Fast Action Card Game

1 person likes this
Chad Jensen's Welcome to Centerville is Shipping Now!

As recently announced, Tank Duel: Enemy in the Crosshairs has a full Solitaire play system included. I have been working closely with Designer Mike Bertucelli to develop this system, and I’m excited to share a little bit more information about the design and how the Solitaire “Bot” works.

I had Solitaire play on the brain when I read Vesa “Vez” Arponen’s article about developing the Hitler’s Reich Solitaire system. I couldn’t get the idea out of my head – especially the design choice to abolish the player hand for the “Bot” – and it started to seep into my dreams. One night, I lay down to sleep and sure enough, as soon as my brain got a moment’s downtime, I had an idea that I thought could work. I got my laptop, fired up the Vassal module we’re using for the playtest, and started experimenting. Within 2 hours I had the first version of the Tank Duel Solitaire Rules sitting on my screen.

Of course, it’s been through quite a few iterations since then, all of them benefiting greatly from Mike Bertucelli’s solitaire development pedigree. At a high level, the design challenges in making a “Bot” work for Tank Duel are the same as those for Hitler’s Reich, which is why it served as such an inspiration. I’ll quote Vez here as his explanation of the challenges is better than mine:

First, how to have the [“Bot”] opponent perform intelligent action selections from the array of options available during most rounds of play? The second challenge was how to preserve in solitaire play an absolutely central aspect of the live player base game: that the [cards in the] hands of the players are hidden and unknown to the opponent?

From the same problem, different solutions. Hitler’s Reich makes the entire faction deck available as the “Bot” hand, something Tank Duel cannot do, since players play from a shared deck of Battle Cards. Instead, the “Bot” in Tank Duel plays cards off the top of the deck, and uses the information on the cards (Battle Number, Target Number, Card Type, and Card Text) to decide how to proceed.

In game action from a game vs. two “Bot” tanks. I lost. I was playing open handed, and both “Bots” have been dealt Initiative Cards. This was from an older ruleset where they were dealt 2 Initiative Cards, now their base number is 3 cards.

For example, the very first thing a player does in a round of Tank Duel is to decide on a card to play for Initiative. The “Bot” has no hand, so it chooses an Initiative Card by revealing the top 3 cards of the Battle Deck, and using the highest or lowest revealed card depending on whether it is in a good position to Move, Fire, Conceal, etc. This has the same effect of following a flowchart and rolling some dice, but it is quicker to resolve and stays within the system already established for the game, where you flip Battle Cards to resolve game effects. So far this has proven to be an excellent way to have the “Bot” keep a measure of intelligence in its actions, while still keeping the player unaware of the exact decisions the “Bot” will make.

This pattern of revealing Battle Cards from the deck and using them to determine the course of action is used throughout the course of the game and is the central engine for the “Bot” tanks. This has allowed us to keep a lot of the mechanisms the same between player and non-player rules. The game length remains about the same, as do the number of rounds of play in a typical 4-tank game. Player turns are unchanged from a player vs. player game, with only one place where players have to check what the “Bot” tanks will do (Tactics Cards). All in all, the experience of playing with the non-player rules is incredibly similar to playing against a player.

A typical Battle Card. The Target Number is in crosshairs, and is used with the Fire and Move Levels to determine success or failure for “Bot” actions.

The problem of how to simulate the limitations of a hand of cards was also challenging. Often in Tank Duel, players can’t do the optimal thing because they lack the needed cards. Usually this is the result of poor planning, but sometimes it’s a challenge that they need to figure out how to mitigate. How to simulate this for the “Bot”? If you’ve read our previous Tank Tales entries, you know that each tank has a Move Level and Fire Level which limits the range of Move and Fire cards that can be used by a player. The “Bot” uses these levels to determine the success or failure of its selected action, as well as determining the number of cards it chooses to play.

As an example, consider a “Bot” tank that decides to fire on an enemy. To resolve any action, the “Bot” would reveal 3 cards from the top of the Battle Deck, keeping them in order (possibly more or less cards depending on whether it has a Green or Veteran crew, whether the Commander is dead, or at what range from the front it is operating). By comparing the Fire Level of the “Bot” tank with the Target Number on the card, we can determine whether the “Bot” fires successfully. If the Fire Level is equal to or lower than the Target Number, the “Bot” succeeds in Firing, which is treated the same as actually playing a Fire Card. Then we compare the second Battle Card’s Target Number to half of the “Bot” tank’s Fire Level (rounded up). This determines if the “Bot” gets to play 2 Fire Cards.

This is only a high level overview of how the “Bot” works; it will also check the revealed cards for CIs and decide when to spend them, use Leadership and Fire Card modifiers, maneuver on the battlefield, capture objective and try to dislodge players who hold key terrain, play Command Cards and Tactics Cards, and all the other things a player would do.

Finally a note on the actual “Bot” procedure: Those who know me know my fondness for the COIN series, especially for the non-player rules that are included with each game. When I first started exploring Solitaire rules for Tank Duel, I quickly realized that the heavy weight, flow chart oriented non-player rules, while well suited to a deep and lengthy game like Liberty or Death, were not a good match for a Fast Action Card Game with hidden information. So one goal of the Tank Duel Solitaire System is to get the “Bot” turns to be something automatic for the player, where they rarely have to consult the flowcharts and can resolve a non-player turn in less than a minute. I hope that will help you play the game more and have more fun when you do it, which is the ultimate goal as a Developer. I sincerely hope you enjoy it.


Chris Janiec's Wild Blue Yonder is Shipping Now!

Please note: I reserve the right to delete comments that are offensive or off-topic.

We'd love to hear from you! Please take a minute to share your comments.

5 thoughts on “Tank Tales #4: Building a Solitaire Bot for a Fast Action Card Game

  1. No flowchart and a straightforward bot that leverages the game’s existing mechanics is good. Sounds like it will let us play the game versus “running” a bot.

  2. Congratulations, this article just scored Tank Duel a P500 from me. 🙂 Love to hear the design philosophy behind solitaire systems, as I find too many of them just hide “play both sides as best you can” behind flowcharts and inconsequential actions. Looking forward to this!