Just another WordPress.com site

Initial AI notes

Hey All,

I wanted to get some notes down for the general strategy of the game and the plan for the AI. To start consider what happens in a turn:

The sheriff goes first and then it goes around clock wise, so consider the sheriffs turn:

Check for Jail or dynamite (the only two things that preclude drawing)

You draw 2 cards (unless it is modified by your character), so there is some type of draw phase

Next there is a main phase (to borrow from magic), where you can play 1 bang card (unless modified), any number of blue cards (cards that stay in play in front of you) and any number of other non-bang cards. This is where the strategy comes in, you have to decide who to shoot, what to card to destroy and really what to do with each card. Do you even want to shoot anyone? Should you hold onto that card? There are a very large number of decisions to be made.

End your turn and move to the next person

There are victory condition checkers (when someone dies, does that end the game?) and rewards to be given out, etc, which are fairly simple and might get a post in the future, but the big challenge now that we have most of the basic game set is getting the strategy coded.

Earlier I presented a list of the character cards and ordered them into groups, so when presented with two options the computer will have the ability to pick wisely and gain from seeing two cards.

Next we have to create a similar list for every card in the game, to help give direction for cards. Consider Cat Balou, which destroys target card or forces a player to discard at random. There a few decisions to make: Should we use it? Who do we target? Do we target their hand or the board? If we target the board, what do we target?

This leads to a decision tree and there has to be logic at each step. Lets walk through each step for Cat Balou.

Should we use it?

Generally, sitting on cards in hand has some risk. There is a chance that someone makes you discard and if you have more cards than you have life you will have to discard. So if at the end of the turn we will have to discard, we should use it. We also have to consider the time value of it, if we have it next turn or the turn after that is there something to be gained. Consider the Bang! card, you need it to not take damage from the Indians card, so if maintaining your life is of concern, you might want to hold on to one. Furthermore, you have to consider threats on the board currently, as well as potential future threats. For Cat Balou, if there are no big scary cards on the table right now and we don’t know of any big scary cards in opponents hands (for a chance to remove them), is it worth holding onto it (risking having it stolen or discarded) to use in the future against potential scary cards. Generally, using it now seems like it is the strongest play, but it  all depends on who you are, so breaking out into roles:

Sheriff/Deputes: You goal is to keep the sheriff alive, so if you see an outlaw with a big scary clearly you target it. The proximity of the outlaw to the sheriff is also a factor, since that dictates how easy it is to shoot him. I think this is one of the roles where it might make sense to play more defensively with it and wait for scary cards to come into play. If an outlaw gets a gun that lets him hit the sheriff and you cat balou it, you have saved a lot of damage on the sheriff. This is the scenario where you want to use it most often here and I think it outweighs the risk of getting it taken or discarded.

Outlaws: The logic for the outlaws is generally straightforward, use whatever it is you have to hurt the sheriff. Unless the deputies have a very high powered card you are scared of, you just want to tax the sheriff more. If the sheriff has something on the board that is effecting the game state, you should remove it (barrels, horses, etc), but if he has nothing it is still worth it to target his hand to get rid of resources. In my current understanding of the game, directing your damage toward the sheriff is almost always (essentially 100% of the time) the proper decision.

Renegade: The logic for the renegade is very complex. You are trying to balance power. Cat Balou allows you to get rid of powerful cards that might tip the scales towards either other side. So if the outlaws throw down a volcanic (big scary gun), you should remove it, if the outlaws are ahead or let them have it for a bit if they are behind. You start out playing as a deputy and the shift from team to team based on the general power levels of them. It is hard to consider individual cards for the renegade, with out first figuring out how it will play.

Who to target/what to do?

Outlaws: Really just target the sheriff, unless there is something very powerful from a deputy.

Sheriff/deputies: target the most powerful threat to the sheriff.

Renegade: target powerful items and try to keep the other two in check.

How we manage the power level of items is yet to be coded. I think the best bet is to go through and rank each card into categories, like we did with character cards and then decide using that. Given the computer having perfect knowledge, if a play reveals a card on a draw from a general store or a character ability, it will be known, so you might have some information about the cards in their hand. So if they have a very powerful card in their hand, you would weight that and assume the other cards are of average power and decide that way. Things on the board are simpler, since if you see something powerful you just go for it. Generally you prefer removing board threats first, since you get them no matter what.

Currently I am working on ranking each card, so we can set this logic up. In the future coming up with ways of adding nuisances, like this card with this character is powerful, etc, will be good, but for now I think it will be a straight ranking.

A note on the renegade

I am not sure if the renegade will be in for the first run through. The logic for the renegade gets a bit more complicated. Since you are playing a balancing game, we will have to come up with a team strength metric. As long as you don’t know who is who, it will be a bit less useful, but as roles become clear the renegade will need a way to say that the outlaws are stronger than the deputies, so I should help the deputies. The factors that go into this decision will be, life totals (with some weighting, because really low life totals mean that the person could drop out quickly), number of cards in hand, what cards in hand (if known), cards on the board and a special emphasis on threats to the sheriff, since that ends the game. It should be fun to write out, but I don’t know if it will be a focus right now.

If you have any thoughts on the ordering of the cards for the power ranking, let me know, that is what I am working on now.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Tag Cloud

%d bloggers like this: