Skip to Content
 

Enemy AI in Coop Game?

8 replies [Last post]
kodarr
Offline
Joined: 08/04/2008

A game I'm working on the enemies all have different movement patterns. The best way I could think of doing it was that the board will have different arrows for 2 of the enemies that follow those paths unless they see a player then they either attack or flee depending on creature. Some go after certain board spaces if they see them. As seeing I'm talking any direction up to a wall. Orthogonal only otherwise you'll be measuring things out too much.
I know this subject was touched briefly on the other site.
And the answer or making a list of what to accomplish in order so enemy for example would follow white arrows until he sees a player in that case attack player. if life drops below half flee from player to closest base. Or something like that.
Now this is good and all but I'm thinking there will be around 10-15 enemies on the board at once so any ideas how to tone it down to speed the game up but still accomplish the feel that each enemy acts differently and on thier own.
There are currently 6 different enemies all with different movement patterns.

Isamoor
Offline
Joined: 08/06/2008
Go with the arkham horror

Go with the arkham horror movement style? Then toss in an "Alert" card or two, in which every Enemy moves a step closer to the nearest player...

If you really want the feel of unique reacting guards... then maybe just go for a a-symmetrical game with one player controlling the guards.

Best of luck!

Taavet
Taavet's picture
Offline
Joined: 08/15/2008
Enemy AI in Coop Game

Right, you would either have to have player controlled movement making the guards 'smart' and reacting as a human

OR

as you were describing you would have to setup programmed triggers to simulate 'smart' movement.

Unfortunately, with a board game you have to have the players check each trigger manually and move accordingly so the more guards/enemies the more manual checking and moving for the players to make.

Only other thing I can think of would be making the triggers be only Toward or Away and have the player who is not currently active more the guards Toward or Away. That way it would flow smoother and minimise down time.

Good luck! AI is a real hard one to simulate well.

Gizensha
Offline
Joined: 07/26/2008
If there are only a handful

If there are only a handful (3-4 at most) of enemies in play at any one time, would a simple (and I mean simple, go too complex and they'll be far too much (imo) information to track for a board game) state machine for each enemy, represented on a side-board with a flow diagram representing the enemy's 'mind' (which can also be used to track health, strength, etc) be appropriate?

So something like the following, where you move to the right state (Priority is denoted by astrixes, the more the higher the priority) at the start of the monster's turn, and then take the action denoted by that state.

If Patrolling and see player, switch to approaching
*If Patrolling and below half health, switch to hiding

*If approaching and next to enemy switch to attacking
**If approaching and below half health switch to hiding
If approaching and no longer can see enemy, switch to patrolling

If attacking and no enemies adjacent, switch to approaching.
*If attacking and below half health, switch to hiding

If hiding and above no enemies in sight, switch to healing
*If hiding and above half health, switch to approaching

If healing and enemy in sight, switch to hiding
*If healing and above half health, switch to approaching

Arranged as a diagram, with notes of:

When patrolling, move to closest green arrow and follow green arrows

When approaching move towards nearest enemy.

When attacking attack adjacent enemy.

When hiding move away from nearest visible enemy.

When healing rest.

(Assuming that there's a rule somewhere that resting is staying still to recover damage, naturally the diagram and states and what to do will depend on both the personality of the monster and the game's rules)

Mitchell Allen
Mitchell Allen's picture
Offline
Joined: 08/09/2008
How Intelligent is "Random"?

I really think that a small set of logical actions, coupled with appropriate probablities would be sufficient to get a sense of artificial intelligence.

Really, with 15 monsters roaming the board, players are not going to be marvelling at the subtle wit of a level 2 ogre. They're going to be running or fighting for their lives.

In most of my games, I use the very convenient 10%, 20%, 30% 40% probabilities.
I have found that fine-tuning those numbers don't affect game-play considerably.

So, if you have four actions, assign an appropriate probability to each one and simply roll a 1d10 and interpret the roll in a way that is easy and makes the most sense.

For example:

Action Probability Roll
Toward 40% 1,2,3,4
Away 30% 5,6,7
Lurk 20% 8,9
Cast 10% 10

I just made up lurk and cast for the sake of the discussion.

It is interesting to note that 70% of the time, the monster will be in motion and, even though it may be moving away from one threat, he'll be moving TOWARD someone else, in all likelihood!

So, you get semi-intelligent behavior from random dice!

Cheers,

Mitch

kodarr
Offline
Joined: 08/04/2008
randomness

I want to show a little more intelligence than randomness. For instance I got it down to these few right now.
Goblin - follow green arrows until seeing a hero or room. If sees a hero flees away at players discretion of direction. If sees a room and doesn't see a hero goes towards the room.
Orc is similar but will charge and attack heroes.
and other monsters generally either go towards heros or rooms.
It's fairly simple but doesn't have the spark I'm looking for just yet. Though when I finish the art for my prototype then I can test it and see if it plays out well.

matt_k
Offline
Joined: 08/30/2008
I think a key question is how

I think a key question is how intelligent you want the movement to "feel", bearing in mind that no random factor at all means that all movement will be predictable, which may lead to considerable down-time, depending on how analytical the group of players are.

The two thoughts that came to mind for me involve either using the board or a deck of cards. You may find a way to combine both.

On the board each of the six enemies has a basic route to follow, moving say one to three spaces per turn. Some of the spaces have "decision" icons on them, which will cause the creature to attack a player if in range, block an exit, hide or whatever. If you wanted to mix that up a bit you could randomise the placement of the icons, but then you have fiddly set up AND lots of potential down time. However this may be a good basis from which to work.

For the deck of cards - again, each creature has a "default" movement that they follow regardless. On each turn a card is drawn which gives instructions to some or all of the creatures. For example:

Vampire - Attack if in same room
Goblin - Default
Orc - Approach if in same room
Maniac - Retreat two squares
Troll - Do not move
Ogre - Move towards player one square

or

Vampire - Default
Goblin - Retreat one square
Orc - Move towards room
Maniac - Attack nearest player
Troll - Move towards player
Ogre - Default

Now I'm not sure what range of actions you have in mind for your creatures, but this could open up a number of possibilities, that would require a lot of complex tables otherwise. To make it simple in terms of book-keeping, define two "states" that a creature could be in, either "within range" or "out of range". Call the range a constant number, say 4 squares, and each creature would have only three possible actions on each card (default, in range, out of range). Simple to manage ona turn-by-turn basis, but with a wide range of possible actions limited only by the size of the deck that you'd be happy with.

Of course the really tricky bit is then working out what actions appear for what creatures at what frequency.

kodarr
Offline
Joined: 08/04/2008
cards huh?

I really like the card idea. I don't want the board cluttered too much so the other idea wouldn't work. My only problem with the cards is I already have 5-6 different decks of cards in the game. I don't know if adding yet another one would be a good move.
As for intelligence players should be able to predict what they are going to do so they can implore strategies like loring an orc after one player so another can get a treasure the orc would have stolen.
I think the way I have it might be the best from reading all of these posts at least the best for what I want to accomplish.
I was hoping for some clever mechanic that is fast and accomplished the same thing. But most would add a bit more time which I'm trying to cut down on.

Gizensha
Offline
Joined: 07/26/2008
Just discovered a couple of

Just discovered a couple of articles on the subject of AI in boardgames which might be of interest. (The rest of the series of 300 mechanics are mainly videogame themed, for the record)

http://www.squidi.net/three/entry.php?id=81 and http://www.squidi.net/three/entry.php?id=82

Syndicate content


forum | by Dr. Radut