Skip to Content
 

Single Player Game "AI"?

13 replies [Last post]
Odat
Offline
Joined: 12/31/1969

I've been kicking around an idea for a game for a while now, a sort of Zombies type game in which the world is revealed tile by tile and there is a limited amount of time to accomplish some objectives. During the game, enemy creatures would appear on the map and fight off the player.

Anyways, the general idea is that as a multi player game, some players would control the "Heroes", trying to perform the objectives, and some would play the "Monsters", trying to attack and stop the players.

I'd also like to have the game playable as a single player game. In that case, something has to control what it is the Monsters do on their turn. In the general case, they probably just move one step closer to the closest Hero, attacking when in range, maybe running away when their life is in Peril.

I'd like to add some more "Flesh" to the system, so that as a single player, you don't know exactly what it is the bad guys are going to do. I'm thinking some sort of system where there are some cards, and for each monster you draw one, and that tells you if it moves, or how it moves, etc. Or possibly for each type of monster, a card that describes the monster with some events on it, and a die roll chart that says how that monster reacts.

Any thoughts or comments on other ways to work this that might be interesting?

OutsideLime
Offline
Joined: 12/31/1969
Single Player Game "AI"?

A thought on the process...

Including a system for boardgame enemy "AI" with any depth means that you would have to develop a clever and involved method by which it is achieved, since it would have to merge well and make sense with the player-controlled mechanics of the game. I wouldn't waste that effort on making it merely a system which invokes itself during a single-player game. Have it control the enemies during multi-player games as well.

~Josh

Challengers
Offline
Joined: 12/31/1969
Single Player Game "AI"?

Hi Odat!

Interesting idea you have. In my opinion, the only way to have manually interesting artificial intelligence is to mimic it. With computers, you'd simply give your monsters a handful of rules and set them loose. Cardboard monsters need a bit more help:
1) in Dungeons and Dragons fashion, create monsters with different attributes
2) list each action available to all monsters
3) for each monster, assign a probability for invoking each action
4) for each monster, assign an abundance factor (lots of rats, one dragon)
5) if you have enough world-tiles, map the abundance factors to the number of monsters. This takes care of making them appear.
6) if you don't have enough tiles to satisfy #5 or, if you'd rather not do it that way, then you could use dice to determine appearance.
7) Make one or more look-up charts and some dice to add variability to encounters.

This is not a trivial undertaking, but once you get the basic outline, all you have to do is play-test to balance the probabilities, charts and attributes.

Here is a quick example, with three monsters and four actions:

There is a 50% chance of an encounter with a monster. (1-10 on a d20)
Rats show up 50% of the time (1-5 on a d20)
Zombies show up 40% of the time (6-9 on a d20)
Giants show up 10% of the time (10 on a d20)

The four actions are Attack, Chase, Flee and Stand Ground (A, C, F, S)

Each monster has the following probabilities for each action (use 1d10):
Rat - A = 40%, F = 30%, S = 20%, C = 10%
Zombie - C = 40%, A = 30%, S = 20%, F = 10%
Giant - A = 90%, C = 10%, S = 0%, C = 0%

charts could have modifiers and attack/defend values.

Mitch

Essence
Offline
Joined: 12/31/1969
Single Player Game "AI"?

In helping a friend develop an MMORPG, we used a four-variable system. A was self-preservation vs. agression
B was close vs. far away from the character
C was like vs. dislike of the character
D was the number of times in a row the creature had performed it's last action. (If it was 4 or more, we shunted it to it's next-preferred option.)

We put together a 4D chart of the actions "Close with character", "Maintain distance", "Run from character", "Talk to character", "Ignore character", "Attack character", "Heal/Buff character", "Rest", and "Other" which was creature-dependent and often had actions like stealing from the character or buffing the nearest creature hostile to the character. Depending on which cell the four variables pointed to, the creature performed it's action.

Of course, that's waay too much for a board game, but the theory stands.

In a simple dungeon-crawl game, you can assume that all of the bad guys have the same goal: kill the player. Then, you have to ask yourself "What changes to the environement or themselves will affect this creature's actions?"

If you only have one variable (creatures change priorities as their HP diminishes), you can go all HeroClix style, and have the monster's action displayed on the base of the monster figure. Each time the monster loses a hit point, you turn the figure, and a (potentially) different action appears.

In it's simplest form, you'd want the actions to be "Close and attack" and "Run". Everything would start in "Close and attack" mode. Animals and other creatures with a strong natural instinct for self-preservation would switch to "Run" after taking a single point of damage. Magical beasts and semi-intelligent highly territorial creatures would switch to "Run" at about the half-way point. Creatures with an active reason to hate the party wouldn't switch to "Run" until they only had 1 or 2 HP left. And, of course, undead and other mindless or dominated creatures wouldn't ever switch to "Run".

If you want more than those two actions, you can have them without increasing complexity. If you want more than one variable (say, self-preservation on one hand and "how much do I hate the party" on the other, you'd need a more complicated method of keeping track of which action a creature would perform.

Good luck!

TargetBoy
Offline
Joined: 08/13/2008
Paper Computer

I am working on a solo wargame system, and I have planned a simple paper-computer system for the bad guys. Unfortunately, this means that the opponents will be predictable, and the strategy will be in the setup. IE: where the enemies appear combined with their given tactics gives different options for fighting them.

My system will use a simple 'desires' system. Enemy units have two desires: 1) Attack and 2) stay in cover, with attacking being the most important. So, if they are too far away to attack, they move closer, staying in cover if possible. If they are in range to attack, they try to move into cover, but only if they can still attack. I have a flowchart for those who want a more closely defined system.

I plan a strong story element, that I hope will make up for the fairly braindead enemies.

I think the option in the first reply, with percentage chances of different actions, is reasonable. You could make cards for the monsters (which distributes the monster types) and have an action table on the card. That lets different monsters have completely different actions.

It would not work for my game, but it may for yours.

Odat
Offline
Joined: 12/31/1969
Single Player Game "AI"?

OutsideLime wrote:

I wouldn't waste that effort on making it merely a system which invokes itself during a single-player game. Have it control the enemies during multi-player games as well.
~Josh

Actually, I've been wrestling with myself about that very topic for a while now. I can see the merit in both a co-operative game, and also game where the bad guys are controlled by one player (ala Space Hulk). I'm thinking maybe it should be something like a co-operative game, with some optional rules that could be used during a two player game if one player wanted to be the bad guys, or something. Actually, as long as the "heros" and the "monsters" have the same sorts of stats, I could perhaps get away with simple rules on how to establish where monsters start from, and then the player playing that side would use the same combat rules as the hero side...

Challengers wrote:

2) list each action available to all monsters
3) for each monster, assign a probability for invoking each action

Essence wrote:

In it's simplest form, you'd want the actions to be "Close and attack" and "Run". Everything would start in "Close and attack" mode. Animals and other creatures with a strong natural instinct for self-preservation would switch to "Run" after taking a single point of damage. Magical beasts and semi-intelligent highly territorial creatures would switch to "Run" at about the half-way point. Creatures with an active reason to hate the party wouldn't switch to "Run" until they only had 1 or 2 HP left. And, of course, undead and other mindless or dominated creatures wouldn't ever switch to "Run".

TargetBoy wrote:

My system will use a simple 'desires' system. Enemy units have two desires: 1) Attack and 2) stay in cover, with attacking being the most important. So, if they are too far away to attack, they move closer, staying in cover if possible. If they are in range to attack, they try to move into cover, but only if they can still attack.

I plan a strong story element, that I hope will make up for the fairly braindead enemies.

These are all some great ideas. I also am worried that any method I might work up for the characters will seem a little too "flat".

My current thoughts on the matter are mostly combinations of what other people have suggested.

For example, there will be only a set number of enemy types, ranging from simple easy to kill things (numerous) to larger, harder to kill targets (more sparse).

I'm thinking that there should be a few actions, such as "Move closer, "Move to cover", "Move and attack", "Rush", "Flee", for example. Each monster type would have an associated "Intelligence" factor. And then a standard table or two could be used to cross reference between how much damage has been taken and intelligence to determine what action should be taken.

Thus, weaker enemies could be say low intelligence, and so they'd hardly ever flee, whereas smarter enemies would try to keep cover as much as possible. There could even possibly be two tables, one for melee and one for ranged combat, so that smarter enemies that have ranged attacks would be tricky to kill.

This also works well with the play system that I'm thinking of, in which each possible enemy has it's own card. That makes it possible to have, say, 10 possible archers, each with slightly different stats, so that not all archers behave the same way.

I'd also really like it if somehow the relative power of the player (based on numbers, or weapons, or some such) and the "terrain" in the room could somehow figure in somehow. I'm finding it hard to strike a balance between good combat factors and system complexity (clearly I played far too much AD&D as a kid).

For example, since the world is tile based (one tile per room), perhaps each tile could have a simple numeric rating on it that rated cover possibilities, and then there could be multiple combat tables, one per rating. So opposing forces would react differently in a room full of crates than they would in an empty gymnasium, for example.

I guess the real question there is, how much complexity is too much?

Challengers
Offline
Joined: 12/31/1969
Single Player Game "AI"?

Odat wrote:

I guess the real question there is, how much complexity is too much?

That's why I have a file cabinet full of incomplete game designs.
I used to think that being a programmer would give me some insight to designing a game. I have found that the reverse is true - it hinders me.
If the game is anything other than a serious simulation, complexity is unwarranted. Players shouldn't have to refer to charts to the point of distraction.

Mitch

Odat
Offline
Joined: 12/31/1969
Single Player Game "AI"?

Challengers wrote:

That's why I have a file cabinet full of incomplete game designs.
I used to think that being a programmer would give me some insight to designing a game. I have found that the reverse is true - it hinders me.
If the game is anything other than a serious simulation, complexity is unwarranted. Players shouldn't have to refer to charts to the point of distraction.

Mitch

A good point, and apparently the same trap that I'm falling into here myself. At one point I almost considered writing up a little AI app for a palm pilot that could drive the bad guys.. more than slight overkill for a simple board game.

There may be ways to hide the complexity a bit, though.

Lets say that there are only 3 different classes of monsters in a game (perhaps simplistic, but...). Each may take, say, 4 different actions. A 6 sided die would be rolled, possibly modified by some situation (e.g. a monster has only 1 hp left, so the die roll is -2). The result is looked up on a chart, to determine what action the monster takes.

This is perhaps a bit complex, but not overly so. I would consider this level of complexity "Tolerable".

But now we want to add in extra stuff, like "In the dark, monsters are less cautious, because they can see you but you can't see them", "Combat is in a room with many crates, so monsters try to advance while keeping cover", "This room is mostly empty, so monsters rush and attack in force to kill you before you can pick them off", just to name a few.

With three extra things, that's three more tables you need, per monster. So now we're at nine tables, and per situation you have to shuffle through all of them, find the important ones, and go. This is decided more complex.

But what if the tables could be presented in a way that was easier to use? An anolgy would be say a web page where you are presented with a drop list of all possible "Battle scenarios", and when you select one, the correct three tables pop up for you to refer to. Now there is just a little bit of added complexity per battle (picking the scenario), but otherwise, there are just the three tables, which is "Tolerable".

This is possible in the context of a boardgame. If you ever played (or saw) any of the old SSI series of D&D games, like Pool of Radiance, Curse of the Azure bonds, and so on, they all came with a translation wheel as copy protection. Basically, just two paper wheels, one overlapping the other. The bottom wheel had a matrix of letters on it, and the top one had three sets of 6 windows cut out in it. Around the periphery of both wheels was a series of 36 different runes.

At the beginning of the game, it would show you one rune from each wheel, and you had to line them up on the wheels. This would expose three 6 letter words in the windows.

In our board game scenario, this would allow for 12 different combat scenarios per "wheel". When combat starts, look for the little number written in a corner of the tile, spin the wheel to line that number up with the arrow, and the proper table for each of the three monsters appears.

This seems less complex to me than having 36 combined tables and having to find the right ones (or say, 12 sheets of tables, each with three tables on it). Seems like a pretty good balance as far as making the game more interesting combat-wise and a bunch of tables.

The idea is also fairly scalable. With less paths, there are more possible tables. My prototype uses only 6 windows per path to simulate a D6, but you could also go with more or less. Adding in extra wheels is also possible (e.g. one for indoors, one for outdoors).

I'm currently working on a prototype one to see how feasible the idea is in practice.

Challengers
Offline
Joined: 12/31/1969
Single Player Game "AI"?

Now, THAT's cool.

In a long-lost thread, I remember talking about abstracting some of the complexity of a game. (I didn't call it complexity, but anyhow...)

Perhaps there is an alternative to having a separate chart for every scenario. You could actually use the same chart for what amounts to essentially the same level of difficulty in an encounter. For example, Use chart #1 for warehouses, dense woods and flooded caves. Use chart #2 for open spaces. Use chart #3 for low-light. Of course, for game-play continuity, you don't lay it out there like that, but each scenario of a similar class would lead players to the same chart.

If possible, you could dispense with the charts altogether, placing relevant battle stats right in the windows!

Mitch

larienna
larienna's picture
Offline
Joined: 07/28/2008
Single Player Game "AI"?

The problem with AI is that they generally fit only for a video game.

If you want a game with an AI, make it an optional way of playing the game (ex: solo mode ).

Else, you will have to give the player more control on the ennemies which will make their behavior more subjective.

But there might be way to stimulate the player to play correctly both side. For example, playing monster correctly could increase the challenge rating and make the character earn more EXP.

I remember having seen some Star Wars book where you could fight with a light saber or dogfight in a starfighter (We still have them in our game club). You had a picture of what you see, and each action you take makes you jump to another page.(Like a book where the reader is the hero). It was simply horrible.

Hedge-o-Matic
Hedge-o-Matic's picture
Offline
Joined: 07/30/2008
Single Player Game "AI"?

I love automated game opponants. I think there's another thread in this section that refers to them in that way. Anyway, the practice of developing a viable, competent, and fun AI is good practice for any designer. Here are my thoughts:

!.) The Borrowed Brain: Remember, the AI is going to be using the processiong power of the player's own brain, so the actual method of detirmining what the opposition is doing has to be pretty simple. The player has their own actions to worry about, and may not be willing to lend very many processing cycles to an opponant.

2.) Emergent Competence: Like emergent complexity (my time-honored advice for nearly everything), I'd like to extend the idea of emergent competence. That is to say that the "AI" should be composed of simple decisions that add up to a good final choice. The player should be unable to easily keep track of all of these during their own turn, but should be able to sail through the decision process quickly when needed. And, to make this simpler, I'd suggest...

3.) Randomization: The system should be able to surprise the player, but generally follow a sound enough plan so that a player can plan ahead. Given that, randomizers must almost always implement a bell curve. Now, the results could be the inputs for a further level of decision making, but they will be somewhat predictable. And, as always, prediction is the name of the game as far as tactics go.

Example: Aliens Marine-eaters:
1.) Is the player within 6 spaces? Yes: +2 red dice. No: +1 blue die, Goto 2.
2.) Is the Player in sight? Yes: +2 green dice. No: +2 yellow dice
3.) Is the Alien enraged? Yes: +1 Red die
4.) Is the Marine wounded and within 10 spaces? +1 red and +1 green die.
5.) Roll all alien dice and apply actions.

As you can see, the system above could allow GOTO statements, or almost any other method to control the tendencies of the aliens. Consider that the dice are some form of custom affair, and will need some element of mathematics to get the bell curve. But just heaping on icons or something might do the trick as well. You all get it, probably.

Kreitler
Offline
Joined: 12/31/1969
Single Player Game "AI"?

Larienna wrote:
But there might be way to stimulate the player to play correctly both side. For example, playing monster correctly could increase the challenge rating and make the character earn more EXP.

You beat me to it, Larienna!

First off, let me say that most of the ideas in this thread are commendable. The "code-wheel" system to manage complexity is particularly ingenious.

However...

...I agree with Larienna that solid AI is generally fit more for computers. Even with the methods discussed in this thread, I doubt you could create opponents that felt natural. Any rules-based system that humans can manage at a board-game level of complexity will almost certainly produce very mechanical (and exploitable) opponents.

Which leads me to wonder if a slightly different approach wouldn't allow you to leverage the player's brain. Larienna's quote hints at the general idea: encourage the player to drive his opponents in a "correct" way. This allows you to greatly reduce the complexity of your AI because the human brain supplies it naturally.

Here's what I mean: AI algorithms consist of 2 basic parts:
1) What are my goals?
2) What are the rules I use to achieve those goals?

#2 generates the massive complexity of the problem, so throw it out. Have the game system supply only the goals for the creatures and let the player fulfill those goals -- as creatively has he or she wishes. To ensure that the player honors the goals, incur a score penalty each turn for failed goals and enforce a "red line" limit that forces the end of the game. In other words, if the player consistently plays stupid AIs, he loses.

Example:
Define Kobolds as follows:
Required range: 3-5 hexes.
Required end-of-turn state: under cover.
Preferred attack: light crossbow.

Every kobold must end its turn in a place that satisfies its requirements or the player loses 1 point per failed requirement. The player gains 1 point for every "preference" honored in a turn. These points are assessed in addition to standard points for kills, treasure, etc.

So now, whenever the player moves a kobold, he's going to try to maneuver it such that it's at range 3-5 from its target (which just happens to favor the light crossbow attack), position it behind cover, and fire at someone if possible.

You could have multiple "kobold" goal sets to reflect different morale states and/or settings (in cave, bright light, etc) if you so choose (as you discussed above). The key here is that the amount of information the player tracks for any given kobold in any given game state is small. Also, there's no fiddling with charts and tables to see how the kobolds move -- you just look at their end state and adjust your score accordingly.

This has the added benefit of reducing record keeping -- you only need to adjust scores for those creatures that fail to meet goals. In the "fully automated" scenario, you need to consult movement and attack rules every time you move every piece. Sure, you'll probably memorize those soon enough, but that's a steep barrier-to-entry for non-hardcore gamers.

The worst part of this system will be the tuning. Finding the right balance of requirements, preferences, and "mission failed" point totals would be a hefty task. However, I expect it pales in comparison to the balancing required by full AI sets.

Whatever you decide for your system, I wish you the best of luck.

K.

Infernal
Offline
Joined: 12/31/1969
Single Player Game "AI"?

Quote:
Example:
Define Kobolds as follows:
Required range: 3-5 hexes.
Required end-of-turn state: under cover.
Preferred attack: light crossbow.

Every kobold must end its turn in a place that satisfies its requirements or the player loses 1 point per failed requirement. The player gains 1 point for every "preference" honored in a turn. These points are assessed in addition to standard points for kills, treasure, etc.

This method also gives players more control over the game and also the difficulty level of the game. If a player feels that the game is too hard, they can reduce the difficulty by making the opponents (the AI) more stupid but at a cost of points. I am all for giving players more choices in a game (within reson :D), as I believe that adding interesting choices to a game can increase the fun that the game offers (a quote: "A game is a series of interesting choices").

larienna
larienna's picture
Offline
Joined: 07/28/2008
Single Player Game "AI"?

I came up with another idea to solve the AI problem. I will illustrate it with an example.

For example, in my space rally game, let say during the rally an event occur: "a space dragon appear". Normally, I would place a space dragon token on the board, then each turn I would need an AI to move the space dragon toward the player ship.

Now I have solve this solution from another angle. I declare that the dragon appears in an area of the map(and it does not move outside it). Each time a ship pass in this area he must make a die roll. If he is unlucky, he gets attacked by the dragon. All the other players who pass in this area this turn won't get targeted since the dragon only attack 1 ship per turn.

Another example in a recent ninja game I wanted to make. Moving the soldiers and determining if they see your ninja and start running after it ( think tenchu or metal gear solid ) would require an AI.

Instead of making a detailed map where you move from square to square, I made a map where each tile represent a part of the area. On each part you would have a token for each soldier present and the detection/pursue would be made by a simple dice roll. So there is no actually path finding or decision AI to make. The dice determine if you are detected, pursued or if you have successfully hidden yourself. Or course, soldiers could move from an area part to another, but they might try to set the alarm instead of running after you in the whole castle.

So the idea is to increase the abstraction level and remove the details so that it requires a less performant AI.

Syndicate content


forum | by Dr. Radut