GeekGold Bonus for All Supporters at year's end: 1000!
9,153 Supporters
$15 min for supporter badge & GeekGold bonus
18 Days Left

Support:

Recommend
1 
 Thumb up
 Hide
25 Posts

BoardGameGeek» Forums » Board Game Design » Board Game Design

Subject: Best enemy algorithms? rss

Your Tags: Add tags
Popular Tags: [View All]
Adam Stapley
United States
Lyman
Wyoming
flag msg tools
badge
Avatar
mbmbmbmbmb
Hi everyone! Does anyone know any good games to check out that have cool algorithms for enemies? This could be their way of tracking health remaining, way they defend things, way they move, how they attack, or all of the above!

I have looked at and liked:
Mage Knight-- Enemies are either dead or not, they have ability to attack unless sniped off, no movement
WoW the board game-- Similar to Mage Knight, but can take place over several rounds.
Gears of War-- controlled movement and attack by AI cards, wounded or healthy.
Myth-- set algorithm that is constant, target priority assigned on card.
Castle Panic-- Really like the rotating way to keep track of health



I like, in Mage Knight, the idea that as a player I can ALWAYS do exactly what I want, there is no randomness, but I like the randomness of enemies that Gears of War has. Has anyone ever seen a system like that? No luck in the player's side (I want to do what I want to do) but some unpredictability in the AI side (I can't know what the bad guys will do before they do it!) Even if it is dice rolling to see how much damage or something of the like.

Thanks!
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Holger Doessing
Denmark
Odense
flag msg tools
Avatar
mbmbmbmbmb
You should take 20 min to print out Maquis and see how the police put the squeeze on the resistance fighters.
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Jeremy Lennert
United States
California
flag msg tools
designer
Avatar
mbmbmbmbmb
AtStapley wrote:
I like, in Mage Knight, the idea that as a player I can ALWAYS do exactly what I want, there is no randomness

Are we thinking about the same Mage Knight? The deck-building game where you draw a random hand of cards, and could potentially end up with all your move cards when you were hoping to attack or vice-versa?



I've found that enemy algorithms in board games generally work best when you start with a simple enemy behavior and sculpt the game around it, rather than starting with the gameplay and then trying to invent an algorithm that will play the enemies intelligently.

I've seen some board game designers create a game system as if there were going to be humans on both sides, and then try to write an AI for it, and it usually works poorly.
2 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Michael D. Kelley
United States
Silver Spring
Maryland
flag msg tools
designer
Avatar
mbmbmbmbmb
I like many of the ones you mention.

Another good one is Assault on Doomrock. Simple enemy health tracking, and fun AI cards.

And I've heard great things about Kingdom Death: Monster. But haven't played it myself.
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Adam Stapley
United States
Lyman
Wyoming
flag msg tools
badge
Avatar
mbmbmbmbmb
Antistone wrote:
AtStapley wrote:
I like, in Mage Knight, the idea that as a player I can ALWAYS do exactly what I want, there is no randomness

Are we thinking about the same Mage Knight? The deck-building game where you draw a random hand of cards, and could potentially end up with all your move cards when you were hoping to attack or vice-versa?



I've found that enemy algorithms in board games generally work best when you start with a simple enemy behavior and sculpt the game around it, rather than starting with the gameplay and then trying to invent an algorithm that will play the enemies intelligently.

I've seen some board game designers create a game system as if there were going to be humans on both sides, and then try to write an AI for it, and it usually works poorly.


For Mage Knight I meant going into battle there is no randomness on my end I know exactly how much defend and attack I have available before entering combat, even if I don't know what the bad guy will bring.

As for the algorithm idea-- I agree, it's way too big of a thing to throw in last-- Thus far I have developed my combat system and my theme, but have not yet linked the two completely. I think that movement is by the most concerning part of developing an algorithm for enemies. The more I looked, the more I realized that the majority of games that I enjoy playing co=operatively don't have a lot of movement, certainly not a lot from enemies at once. It takes away too much time from the players doing their thing.
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Adam Stapley
United States
Lyman
Wyoming
flag msg tools
badge
Avatar
mbmbmbmbmb
holgerd wrote:
You should take 20 min to print out Maquis and see how the police put the squeeze on the resistance fighters.


It seems like an idea that I could work with for, kind of a flow chart that is consistent "If this place, this place, and this place aren't taken, then do this, this or this"

Kind of reminds me of dead of winter too, placing the zombies around the circle until they've all been placed.
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Michael Dillenbeck
United States
Deerfield
Wisconsin
flag msg tools
Avatar
mbmbmbmbmb
For me the best enemy algorithm by far has to be Pandemic's infection deck. Your enemies are diseases that spread, and these are revealed by a deck of city cards. When an epidemic happens you have an intensify step which shuffles the discard deck and puts it back on top of the game so players know what cities will re-infect but not in what order. In other words they create known "hot spot" in the world that are fairly unique to that play.

However, that would be too predictable. Before you intensify, you infect. Infect is drawing a card from the bottom of the deck and putting it at maximum disease capacity. This card is then on the discard pile and shuffled in when intensifying. It basically represents a newly discovered hot spot that the players couldn't predict, thus providing some surprise to the players. By being at maximum capacity, it also ensures every "Infect Cities" step following an epidemic puts the players in jeopardy of an outbreak (thus increasing the tension of the game).

------------------------------------------------------

Other games that come to mind are the COIN series and Navajo Wars (which I didn't buy and regret but hear great things about) which use highly procedural AIs. These are usually involve the player learning complex procedures and utilize tables (and sometimes die rolls) to determine the choice of orders to execute.

Historia also has civbot AIs to play against. Here the player sets a difficulty level and uses a number of random card draws (3/4/5) from a deck of 6 cards to determine the order of actions executed.

------------------------------------------------------

For combat algorithms in player-vs-player, I find 7 Ages intriguing. It uses deterministic combat with a bluffing element. When two armies clash, the players take all their counters into a reserve for battle. Next, each player secretly assigns troops to the attack wave, with there being a 1:1 ratio of front-line and support units. Tactical leaders can also be assigned. These assignments are done after drawing a multipurpose card from the deck and checking your bonus on that round of combat. When set, reveal the units and the cards. Sum up the front line values, the support values, and the card for your total attack and highest value wins and lowest value loses all the committed units. If tied, both are eliminated unless a tactician was committed (which prevents unit loss during ties and allows for 2 cards to be drawn for card bonus value). The winning side's troops go to expended, then you go to another round. Once a side goes through all their troops they put them back into their reserve but take a disorganization token - and this means the opponents units now get to add their highest unit(s) a second time into their combat value. Basically, the battle is going on long enough that morale and unit cohesion is suffering. A player can only retreat once they have a disorganized token (ie, their troops must fight at least once before considering retreat).

Overall, I find it interesting because it introduces an element of out-thinking your human opponent. Alas, I mostly solo wargame so this doesn't work so well and I have to use alternate (dice based) systems for combat. Thus this one gets a bit dusty on the shelves.

Also, though I have never played Kemet, I love the idea of hiding a smaller modifying card underneath the larger card that you play for battle.

Finally, Mansions of Madness has a really neat setup for its 1-vs-the-rest gameplay. Monster miniatures have bases with holes that show horror/evade values from the tokens inserted in the base plus plastic clips on the side to stick in chipboard wound markers (two clips on large base monsters). Each monster chit has the potential to have unique hp, attack value, and and special attack - and when the evil player chooses a monster they cannot look at the base until selected, so they don't know what they are getting. Additionally, only the players roll dice in the game. There are 3 decks for the 3 categories of monsters; the top of the card is for player attacks by keyword, and the bottom is for monster attacks by keyword. You draw the card and read the text to the player plus consequences for success and failure; the player chooses to spend a skill point or not to add luck to the die roll; and then the player rolls the die for the outcome. Since there is a large deck of cards, the results are varied - sometimes a success harms the attacker and sometimes a failure harms the target. Its a wonderfully narrative system with a set of surprising and diverse results.

-------------------------------------------------------

If I thought for a while I could come up with others; but these are the systems I'm enjoying currently, have a history of usage and are considered solid mechanics, or I just find enriching to the game play and "immersive". In the least it is a start (after all, I didn't mention chit pull activation from hex-and-counter games or the idea of a side's leaders rolling to maintain momentum but the enemy having the option to try to seize momentum like in Blood and Roses... or even the fog of war of block wargames, where you see where troops are by cubes but not what they are).
3 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Ron A
United States
California
flag msg tools
badge
Avatar
mbmbmbmbmb

D-Day at Omaha Beach-- you can do whatever you want (subject to game rules), and there is no way to know exactly what the AI is doing next turn.

The game is widely hailed as one of the best solo war games of all time.
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Beau Bocephus Blasterfire
United States
Berrien Springs
Michigan
flag msg tools
badge
Avatar
mbmbmbmbmb
Dungeon Twister 2: Prison perhaps? I don't know personally, but from what I remember reading about the game, it looked like it had an AI that was quite involved.
1 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Adam Stapley
United States
Lyman
Wyoming
flag msg tools
badge
Avatar
mbmbmbmbmb
I like the idea of cards controlling, but hate the idea of card counters for that (which I am one of, I can't help myself). What about this idea:

A chart of actions, with three categories. The first player rolls 3 dice, and places the highest roll in the first box, second in the second box, and lowest in the third box. Then the dice tell the monsters what to do. This would be a kind of wonky distribution, but with some number crunching that's not a big deal for me.

Are there any games that anyone can think of that do something like this, and does this sound awful? I realize it wouldn't be the MOST intelligent system, but I think I can get it to be smart-ish.
1 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Confusing Manifestation
msg tools
Avatar
mbmbmbmbmb
Munchkin Quest creates the feeling of having monsters roam the dungeon by marking every exit from a tile with a colour. At the end of your turn, you roll a die with the various colours on it, and each monster follows the appropriately coloured doorways. There are a few variations to allow for monsters that stay still, or move faster or slower or in the opposite direction, so you don't wind up with everything bunched up in one place.
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Jeff Warrender
United States
Averill Park
New York
flag msg tools
designer
publisher
badge
Avatar
mbmbmbmbmb
Not exactly an "enemy algorithm" per se, but Pocket Civ has an event system whereby the event indicates what has to happen but the player gets to determine the specifics, e.g. the location, etc. This might be trickier to implement in a multiplayer game, but it has the advantage of avoiding a complex set of A.I. rules.

I've implemented a sort of "chit pull" system in a couple of games for enemy/events that seems to work pretty well. During the course of the turn, some tokens will get thrown into a cup, and at turn's end, you pull a specified number of tokens from the cup and resolve the ones that come out. So, maybe during your turn your action awakens the "red" dragon (red chip added to cup) and at turn's end, if you pull the red chip from the cup, the red dragon attacks the player closest to him.
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Thanee
Germany
flag msg tools
badge
Avatar
mbmbmbmbmb
Galaxy Defenders
Sword & Sorcery



The numbers in brackets are ranges (i.e. if an enemy is within range X), you go through the list from top to bottom and use the first one that is valid. The one with the + is the default one to fall back to, if nothing else applies.

Bye
Thanee
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Adam Stapley
United States
Lyman
Wyoming
flag msg tools
badge
Avatar
mbmbmbmbmb
What's everyone's opinion on "move to closest X"? Does it get tedious figuring out which one is closer?
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Abraham Quicksilver
United Kingdom
Cheltenham
Gloucester
flag msg tools
publisher
Avatar
mbmbmbmbmb
AtStapley wrote:
What's everyone's opinion on "move to closest X"? Does it get tedious figuring out which one is closer?


Depends on the overall game state - this system works well for Galaxy Defenders
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Greg
United Kingdom
flag msg tools
designer
Avatar
mbmbmbmbmb
I did some things in Wizard's Academy that worked pretty well. Moving from having cards that activated "all trolls" to cards that activated "everything in the library" had a huge positive impact.

At the start of the game most rooms are empty and so the cards often did nothing giving the players a chance to build initial resources, by the end of the game most rooms have multiple enemies and every card is doing something so the threat ramps up accordingly.

With respect to your question about "move towards the nearest" it depends on the size of the board and how distance is calculated. On a 4x4 square grid calculating Manhattan distance it's trivial. On a 50x50 hex grid counting the shortest distance modified for terrain costs it'd be a nightmare.

Generally my recommendation is to make things less intelligent than seems natural. It might be more realistic for an enemy to avoid dangerous obstacles, but it's harder to calculate and being able to lure dangerous enemies into places that are bad for them makes for a satisfying game experience.
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
S Hilliard
United States
Washington
flag msg tools
Avatar
mbmbmbmbmb
I'll ditto the earlier mention of Dungeon Twister 2: Prison. The prioritization of actions is different for each AI character (I forget how many there are, but I want to say 32). It's intricate, but a little bit unwieldy at times.
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Adam Stapley
United States
Lyman
Wyoming
flag msg tools
badge
Avatar
mbmbmbmbmb
Anyone know of any games that have the AI playing off of the character's actions? For example, maybe every time an attack action is taken by the players, a certain response is given to the pool of possible monster actions?
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
S Hilliard
United States
Washington
flag msg tools
Avatar
mbmbmbmbmb
AtStapley wrote:
Anyone know of any games that have the AI playing off of the character's actions? For example, maybe every time an attack action is taken by the players, a certain response is given to the pool of possible monster actions?


The solo player AI in Race for the Galaxy: The Gathering Storm works similarly, where you roll a die to see what actions the AI selects - one of symbols automatically mimics what you select.
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Chris Willett
United States
Minnesota
flag msg tools
mbmbmbmbmb
Surprised no one has mentioned Dungeons & Dragons: Castle Ravenloft Board Game or the other games in this family. Each monster comes with a character card that details movement behaviors as If-Then statements based on ranges or other details. Works relatively simply and is as close to a programmed AI as I have seen in a game.
1 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
John "Omega" Williams
United States
Kentwood
Michigan
flag msg tools
designer
Avatar
mbmbmbmbmb
Heroscape Automated Battles ruleset is pretty versatile and can be adapted to other games.

Monsterpocalypse has a set of solo rules for running a monster that does a fair job of prioritizing targets based on threat.

Ambush and NUTs also have fairly robust AIs.
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Jake Staines
United Kingdom
Grantham
Lincolnshire
flag msg tools
designer
badge
Avatar
mbmbmbmbmb
nukesniper wrote:
Surprised no one has mentioned Dungeons & Dragons: Castle Ravenloft Board Game or the other games in this family. Each monster comes with a character card that details movement behaviors as If-Then statements based on ranges or other details. Works relatively simply and is as close to a programmed AI as I have seen in a game.


Do any of them actually do anything interesting, though? All the ones I've seen just have text like "if the monster isn't within range it moves towards the nearest hero, and then attacks when in range". To be honest, it kind of put me off getting the game, it looked less interesting than it could have been.

By comparison the Sword and Sorcery card posted further up-thread looks pretty interesting.
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Cody Ferguson
Canada
flag msg tools
mbmb
In my life as a forever alone gamer , I've spent quite a bit of time working on solo rules for games.

I'm working on a solo WWII tactical game right now that uses sets of hierarchical lists that the AI player acts by.

On the AI's turn, the player goes down the list, and applies the first action that qualifies based on the outlined conditions.

It sounds clunky but so far in playtesting it's actually worked quite well. Rarely do you end up going through the entire list, because you apply the first action that has it's conditions met. Of course you spend more time on the opponent's turn than your own but I don't think there's a way around that unless you just want arbitrary actions.

It is predictable because you have a limited number of rules that govern the opponent's actions, but it does work for creating an opponent that reacts to the player.

One worth checking out would be the Robot rules for Federation Commander: Klingon Border. They're about 4 pages IIRC but work for creating a fun solo game.
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Charles Ward
Japan
Matsumoto
Nagano
flag msg tools
designer
publisher
Avatar
mbmbmbmbmb
GTD_Galatea wrote:
It is predictable because you have a limited number of rules that govern the opponent's actions, but it does work for creating an opponent that reacts to the player.

I guess if you combine that with a random element (dice roll) that provided an extra step to the IA flow chart.

I don't have a game to point too but I did come up with a simple swarm attack AI. I hope to implement this in an upcoming game. If it inspires you or bores you, either way, please let me know.

THE DRONE AI. Ready all drones if all the drones have been activated. At the beginning of each player’s turn, that player must activate 1 ready drone. Drones in the same location are activated as a group. There are two possible actions. Players must study the board and choose either:
:: Regroup - Choose the lone (single) drone nearest to a player and move it towards the nearest drone(s).
:: Attack - Only if no lone drones exist, choose the largest group of drones and move it to the nearest player, or attack. If the distance is equal, the player may choose what to do to their advantage. When drones enter a location with another character, the drones attacks. Drones have an attack strength of 1 per drone. Remove 1 drone for each attack strength point greater than the drone attack strength. For example, a player would need an attack strength of 3 to defeat 1 of the 2 drones they are attacking.

That's it. So single drones are weak, but as they gather in numbers their strength increases, and they all move as one group. Drones activate after each player's turn.
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Cody Ferguson
Canada
flag msg tools
mbmb
Yea, incorporating a die roll would work for some randomness.

These are the basic rules I worked out governing movement of AI AFVs operating under "Defense" movement (that is, defending an objective). I have two other sets for "Evade" and "Attack". These just govern movement, I have another list that's used for the AI to decide which target it shoots at.

1. If the target is not within threat range, and the tank is within control range of the objective:
a. If the target is not within the LOS, the tank must move as to put the target in the LOS.

b. With regard to ‘a’ above, the tank will not move out of control range of its objective, but may move to a better position while remaining in control range.

c. Whenever possible, the tank will turn so it’s facing the target.

2. If the target is within threat range, the tank must move to attempt to get to the target’s SIDE or REAR arc.
b. If “2” is not possible within a single turn, the tank will move so it can end it’s movement facing the target.

3. If the target leaves threat range the tank must move back into Control Range of its objective.

4. A tank will prefer hexes that will allow it partial concealment to its target over hexes that do not. This rule may be eliminated.

5. When transiting between objectives:
a. Tanks will prefer moving on roads if doing so will allow them to enter Control Range of their next objective in less turns than moving cross-country.

b. Tanks will continue moving toward their objective unless the target enters short range, at which point the tank will pursue the target.

6. Unless not doing so would violate any of the rules above, a tank will prefer to NOT enter marsh hexes.

7. Unless not doing so would violate any of the rules above, a tank will prefer to NOT enter scattered woods hexes.

8. A tank can move in reverse to satisfy any of the above rules.

9. A tank WILL cross hedges to satisfy the rules above.



They seem to work well enough.
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Front Page | Welcome | Contact | Privacy Policy | Terms of Service | Advertise | Support BGG | Feeds RSS
Geekdo, BoardGameGeek, the Geekdo logo, and the BoardGameGeek logo are trademarks of BoardGameGeek, LLC.