Home » Behind Battle Slots » Inside Battle Slots: 8monkey Labs Engineer Andres Reinot

Inside Battle Slots: 8monkey Labs Engineer Andres Reinot

Battle Slots

April 5, 2011

Intelligent Battle Slots
Effective gambling strategies for the modern monster.

My name is Andres Reinot and I form the other 50% of the 8monkey Labs engineering team. Last week, Mr. Jeff Russell gave a synopsis of what it means to develop games. Having not read it (I am very busy), I will assume it was a thorough look at software engineering today: standards and practices (probably several semesters-worth of college credit, knowing Jeff). Now, with you all caught up to speed on the basics, I am going to dive right into one of the more interesting aspects of Battle Slots: the part I worked on.

The Battle Slots Artificial Intelligence (AI) was a fun and new aspect of game-making for me. It was my first real crack at writing AI and I was lucky enough to have time to try different things and learn as I went along.

First, some Battle Slots basics: in the battle portion of Battle Slots, two warriors face each other and dish out hurt by means of spells and attacks (collectively referred to as Combat Techniques). Spells need Mana to cast and attacks need Attack Points to invoke. Spinning the slot machine generates Mana and Attack points much as a real slot machine would pay out casino tokens.

My goal was to write a single AI routine that would work for all monsters in the game, regardless of what techniques were assigned to it. Since the monsters were constantly being changed, their techniques balanced and tweaked by the designer, it was important for the AI system to be flexible. And because the game called for hundreds of unique monsters and close to 600 monster techniques, the AI needed to be general-purpose, one size fits all.

Jeff and I talked about writing “The Perfect AI”, one that would compute the cost-effectiveness of every technique, predict slot machine payout improvements of spells that modify slot machine odds, and basically pick the all-around Optimal-with-a-capital-O course of action. But it was quickly decided this would be difficult to write and boring to fight against as a player. Of those nearly 600 monster techniques, many would be deemed “less than optimal” and would never get cast by the AI. We wanted the monsters to use all their given techniques for the sake of variety and the creative flare the designer was trying to add to the world of Battle Slots. If the Werewolf King has a Howl at Moon technique, why shouldn’t he use it?

The approach I finally settled on was to pick a technique randomly from the monster’s arsenal and force variety as much as possible. Because picking a truly random technique led to some overtly-obvious random behavior (healing when not necessary, not attacking when damage buffs are active etc.), the techniques were first very broadly categorized and random ones were pulled from the appropriate category.

The AI that ended up shipping in Battle Slots works as follows:
1. Categorize the monster’s techniques into 3 broad categories of: Heal, Buff, and Attack.
2. Choose a category based on the current state of the monster and its enemy
3. From the category, pick a random technique to cast, preferably something new and interesting.

Healing techniques are ones that give the monster more health points, Attack techniques ones that take health points away from the opponent, and Buff techniques are any that provide a bonus on damage dealt, damage resisted, or slot machine payouts, odds, etc. Anything that will give the monster an upper hand against its foe for the next few turns was considered a Buff.

Part of me wants to continue writing a smarter Battle Slots AI and part of me wants to develop The Perfect AI. However, in game development, simple-and-effective almost always trumps lofty engineering goals. Maybe for Battle Slots 2…

Posted By: EmmaEFX

One Response to Inside Battle Slots: 8monkey Labs Engineer Andres Reinot

  1. John BNo Gravatar says:

    Random AI for a slot machine-based game seems appropriate, if nothing else. Actual human opponents are pretty random too, and I think that the AI seemed pretty engaging and interesting. This reminds me of this learning AI for paper, rock, scissors, which uses observed patterns to crush you:
    http://www.nytimes.com/interactive/science/rock-paper-scissors.html?hp

    As a human player, it is in your best interest to use your meat-mind to divine the optimal-est solution. Something you could do is have the AI calculate the Optimal solution for the player and then do things that would frustrate those choices, if possible.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>