Skip to Content

AI mechanics

4 replies [Last post]
questccg
questccg's picture
Offline
Joined: 04/16/2011

Hello All,

I was wondering if anyone wanted to share some AI Mechanics. I'm not suggesting a mechanic for simulating a game of Magic: The Gathering game - nevertheless for a card game.

I'm really not sure what to post, because I don't know if AI is generally tied to the game's existing mechanics. I would tend to say yes - but perhaps someone may want to share some more general ideas...

Update: just on a side-note, I have been searching for more on AI in board games. Some games add a "Robot" player which is another form of AI. I will look at those games to better understand how they implemented their AI to help give me an idea.

Games like "Race for the Galaxy: The Gathering Storm" will be one that I am for certain going to take a serious look at. "Power Grid: The Robots" and "7 Wonders" are other examples.

https://www.youtube.com/watch?v=Ngj50RT8I3o

Soulfinger
Soulfinger's picture
Offline
Joined: 01/06/2015
Kingdom Death: Monster looks

Kingdom Death: Monster looks to have a good AI system for monsters, at least judging by preview materials.

The Professor
The Professor's picture
Offline
Joined: 10/25/2014
Overly complex

Kris,

An interesting AI is something we're looking to pursue in our game, as well. Now, maybe the Drive Thru Review's monotone voice or some other aspect of the video got to me, but the AI in "Race for the Galaxy" You Tube doesn't impress me, as it's overly complex for what it's attempting to do. There are a few games that hit our Gaming Table which have clever AIs or AI-like abilities which come across as much more elegant, including Marco Pranza's Civbots in "Historia." Soulfinger mentions KD:M, and while the videos do impart information about the AI, I'm still waiting for my boxed edition...so, we'll have to see.

Cheers,
Joe

jrc5639
Offline
Joined: 11/19/2013
AI Article

I wrote this little article on AI, maybe worth a read. They are might give you a little perspective on AI.

For an AI to be good it must do the following things:

-appear to react to the player(s)
-Act logically, but not 100% predictably
-Give the players a challenge

The two most common AI structures in board games are seeded random and condition/priority because they required little complex math and are easy to follow by hand.

The condition/priority is the easier of the two to understand. The idea is basically that of a flow chart. The game asks the player questions about the game guiding them until the player receives the action the AI is to take.
------------------------------------------------------------------------------------------------
This may require tracking extra details that a human is aware of that is not necessary tracked already in the game. For Example in Risk the game does not track which players attack which, however if one player keeps attacking the AI, that might be a factor in their decision. Or even factors like what turn in the game it is.

The first step to making a table like that is to notice how you make choices in a game. In a sense you are to come up with an ordered list of priorities.

The first things to worry about is victory/defeat concerns, time-limited concerns, time-limited opportunities general play.

Start with a first concern and ask yourself how should the AI react to this. Do not be afraid to make a sub-priority list and break it into further reactions.

The two most important things to remember about this type a AI is the flow chart must have some unpredictability even rolling dice for actions at time (but not too much).

The AI also needs to react to its enemies, if a player offers the AI a trade agreement it should not simple reject it but instead offer a counter offer.
---------------------------------------------------------------------------------------------------------------------------------
The other form of AI I've commonly seen in board games I call seeded random. While the condition/priority was good at having reactions to players. The seeded random generally plays more of a grand strategy and generally is easier to run.

Seeded random is most commonly utilized with cards. A card is flipped and used for a particular action. However, if it were just that simple the game would have no reactivity. Sometimes a new card is flipped every turn and other times the current card is continuously used until it meets a condition telling players to draw a new card.

The reactivity of this seeded random comes in the form of what most board gamers would describe deck building. The idea is players generally continue using the same types of strategies so it 'learns' how to counter that strategy.

For example the game is rock paper scissors. The player throws scissors and the AI picked paper. Since the paper lost the paper card would be removed from the deck and replaced with the superior rock selection. Of course in rock paper scissors the player will pick up on this and quickly switch strategies, so the system works best when it is either hard to switch strategies or if the player does not know its happing. The AI can even be allowed to adapted over multiple games.

The first step to designing this kind of AI is too pick all the pick all the realistic paths to winning. If your game only has one realistic path to winning you either have a balance issue that should be corrected first or it is not good for your particular game.

Then determine the actions commonly associated with a particular strategy and make action cards in sets.

Then determine how players would counter each strategy. These can be in the form of specific actions or in the form of a count strategy.

Then for each action determine a conditions when you could not want the AI to do that action. As sometimes when an action is drawn you might want to draw a replacement as ever action is not appropriate all the time.

Finally add rules for exchange card add cards or removing cards from the deck based on the strategies and counter strategies you came up with earlier.

This type of AI is difficult to design and only useful in game that favor many play styles but if it works if is really cool.
------------------------------------------------------------------------------------------------------------------------------------------
Unlike humans, if your AI is not good enough it is okay to have them cheat a little. Usually, it is better to make changes to the AI instead of having them cheat, but if the AI is getting too convoluted or you just can't think of improvements make it cheat only a little.

On a minor note I have not done much with board AI design, but I have worked instead with computer AI and these are based off of that.

These AI can of course be combined and an endless version of variants can be thought of.

pelle
pelle's picture
Offline
Joined: 08/11/2008
ai

Quote:

-appear to react to the player(s)
-Act logically, but not 100% predictably
-Give the players a challenge

I like that list. I have an old favorite that is similar, by Jon Southard (in Grenadier #33):

  • Responsiveness (react to player moves in reasonable ways)
  • Coordination (multiple AI-controlled units should synchronize their actions)
  • Consistency (enemy units not doing weird things like teleporting or showing up in places unless there is a good thematic reason for that)
  • Unpredictability (obviously)

Now I actually miss "Give the players a challenge" from that list. It is an obvious thing, but good to remember. I think the other three things on this list pretty much are equivalent to the first two in
jrc5639's list, just worded in a different way (and Jon also goes on for a few pages explaining in detail what he means, including examples from several games).

It is worth noting what is not on either list, for instance "follow the same rules as the player" or "be able to play the same scenario a human player can". In fact I can think of few solitaire games (board or computer really) that works very well with the AI trying to play by the exact same rules as the human player in a balanced scenario. There is a reason researchers struggled for decades to make a good chess AI and are still struggling with go. Most board and card games we play are much more complex and also have randomness and hidden information to complicate things further. It is a much better strategy imo to build the opposition/AI as part of the game rules rather than trying to make rules (or computer code) for simulating what a human opponent would do. The exception is perhaps Rock, Paper, Scissors, because to play that game optimally the AI only needs to roll dice to pick an option. :)

That does not mean I suggest cheating. The AI should do things that are Consistent and makes sense in the given theme, and provide a good level of challenge.

Star Realms seems to do this well (they say; I have not had the chance to play it solo yet): As a deck-builder it is pretty much a multi-player solitaire game anyway (although less so than eg Dominion), and the official solo variant is just a random opponent slowly growing in strength forcing the player to build a deck faster and better. There is no attempt to have the AI build its own deck or really play the game at all like a human would, but it seems to work. There are some fan-made solo variants on bgg that also looks quite good and works in similar ways.

Many solitaire wargames works by having enemy units that are just static and at most move because of random events now and then (so you can not be 100 % sure they will just sit there and wait; suddenly they can launch a counter-attack). Another good trick is to not have any enemy units at all on the board and just randomly draw units to place in front of player's advancing units (as long as you make sure the placement is Consistent and not cause enemies to appear in unrealistic locations).

tl;dr: Asymmetric with AI as part of rules is better than trying to simulate a human opponent playing a symmetric game.

Syndicate content


forum | by Dr. Radut