# MaxCoderz

for your 1 bit pleasure!

 All times are UTC

 Page 1 of 2 [ 29 posts ] Go to page 1, 2  Next
Author Message
 Post subject: [BattleCards] Designing the AI of BattleCardsPosted: Tue 08 Feb, 2005 8:43 pm
 Maxcoderz Staff

Joined: Wed 15 Dec, 2004 7:26 pm
Posts: 2735
Location: The Hague, Netherlands
Introduction
Ok. This will be a small research of how a smart AI should work in the BattleCards game. I will try to write down all my thoughts in the first chapter, which I will call "Brainstorming". The second chapter I will try to translate my thoughts to a programable explanation of my thoughts... ah well... you'll figure it out once you read it I hope.

P.s.: Yes, this was written BEFORE I actually started writing the other things. I used this as an plan of how to approach this.

Brainstorming
Ok... We have an AI which should try to win. But what also is important that it doesn't want to lose. If you think those two are the same, you are wrong. For example, if the AI only wants to win, it will attack you every turn, no matter what. Rather simple. But the problem is, that it doesn't check whether it will lose or not. So in fact, to win, it must survive. As long as possible, with keeping also an eye on winning. Why? Only Healing doesn't help much either. So there must be a balance between winning and losing...

Let's say a AI is low on health. Let's say 10. It has a DMG15 card, which deals 15 damage to the opponent and a HP+15 card, which will heal 'him' (no offence to girls ). What is the best thing to do? Well... that depends on several things. How much HP does the AI have? How much HP does the opponent have? What could be the consequences in the next turn? Here some scenarios:
1.It's obvious that, if the opponents HP is higher than 15 there is no way of winning the game in this turn. Furthermore, if the opponent still has a DMG10 or even a DMG15 card he could win the next turn if the AI doesn't heal.

2.Let's say the opponent is also low on HP (also 10). It's the AI's turn, so why don't finish the opponent off? If the game is over, it's over, right? Right!

So in fact, the AI has to do several steps.
Step 1. Check whether the AI can win the game with a card on his hand.
Step 2. Check whether the player can win the next turn.
Step 3. If step 1 and step 2 resulted in a 'no', than play a card which fits best to it's person.

What's with the 'person' stuff? Well, I thought it may be a cool addition that an AI is not only based on stats, but also has a also a certain 'taste' and 'strategy'. For example, I could introduce a 'Snake-like' enemy, which could base his strategy on poison his enemy (poison card will be introduced later on to the engine). Another example could be a Monk, which would base his strategy on 'protect' and 'light' cards. Of course the enemy's would get decks based on their strategy (like a real human would build a deck based on his strategy).

Till now I got the following monsters with a strategy.

- Snake will mainly use poison card to poison the enemy and drain cards to get health.
- Tank will use protect cards to block attacks and strength-up cards to power up himself so that he can destroy the player in one great blow.
- Monk will use regenerate and other heal cards to keep his HP high. Light spells will be the main attack source for the monk. Secondly it will use Runes to power himself up.
- Devil will use a lot of fire cards, as well as paralyze the other player to block his attacks.

A more ambitious idea I just got is that the AI even could try to match the strategy of the human player to one of the AI's located in the game and than try to 'guess' what the next step of the human player would be. Or that he tries to find a pattern in the strategy of the human.
Ahhhh... AI, a very interesting subject indeed

End
Hmmm... Well, seems like the second chapter isn't really needed. So I will skip this section.

This is thread is a growing thread, so I might throw in some other idea's, but even better; I always like to get some input of others.

What are your idea's? I really would like to hear! Come on... don't be shy .

-kv83

_________________

Last edited by kv83 on Wed 21 Jun, 2006 1:05 pm, edited 1 time in total.

Top

 Post subject: Posted: Tue 08 Feb, 2005 9:41 pm
 Maxcoderz Staff

Joined: Sat 18 Dec, 2004 6:53 pm
Posts: 1349
Can't think of much to say, except that you've got this really well planned!!

_________________
[Gridwars Score] - E: 1860037 M: 716641 H: 261194

Top

 Post subject: Posted: Tue 08 Feb, 2005 9:49 pm
 Maxcoderz Staff

Joined: Fri 17 Dec, 2004 5:33 pm
Posts: 790
Location: On the dark side of the moon.
My preference goes to an AI that resembles humans most. Predictable to an extent with some unexpected moves now and then that can give him the upper hand or let him die.

So if you could tell use what 'players' know about each other I can better think of how I would plan it. Your plans look good though.

_________________
"They say that sea was created by a man named Maarten Zwartbol, a long time ago...." - Duck, an old Corbin version

Top

 Post subject: lolPosted: Tue 08 Feb, 2005 10:45 pm
 Calc Master

Joined: Fri 17 Dec, 2004 9:53 am
Posts: 1089
Location: Belgium
Very nice worked out, exactly as i would do, if i had enough wisdom exp. to think of something like that

_________________
TI-calculator = good time

Top

 Post subject: Posted: Wed 09 Feb, 2005 7:21 am
 Maxcoderz Staff

Joined: Wed 15 Dec, 2004 7:26 pm
Posts: 2735
Location: The Hague, Netherlands
Kozak wrote:
My preference goes to an AI that resembles humans most. Predictable to an extent with some unexpected moves now and then that can give him the upper hand or let him die.

So if you could tell use what 'players' know about each other I can better think of how I would plan it. Your plans look good though.
Well the good (or bad) thing is that you will never know what exactly is the next step, cause you don't know which card are in the hand of your opponent. The only thing you can see is the card he plays... and maybe even find a pattern in that... but it's hard I would think

_________________

Top

 Post subject: Posted: Wed 09 Feb, 2005 8:18 am
 Calc Wizard

Joined: Tue 25 Apr, 2006 2:24 pm
Posts: 552
does the computer know what cards the player has in his hand? In your first post it sounds like the AI will check if the player can win with what he has in his hand. But, you say the player can't see the computer's hand. Is there some gameplay element that I'm just missing, or does the AI have a huge advantage?

I like the idea of different styles of opponents, ie the snake or tank enemies. I think a good way to design them is to have one baseline characteristic that varies between each opponent, and one special move or style for each character. So for example, attack vs. defend is the baseline. Let's say your snake character uses lots of attacks, little defense, and poison / drain is his special type of move. Then you can have Tank, who has a slow attack pattern, but builds up a lot of defense (like you said). His special move could then be his big nuke drop or something that destroys the player and all his defense he's built up. This also requires you to build certain strategies based on who you're playing against.

I think our ideas are similar, but I think it's important to have the one sliding scale characteristic for each enemy, instead of a sort of random assortment of attributes. Then again, I am just throwing ideas around...

Top

 Post subject: Posted: Wed 09 Feb, 2005 11:26 am
 Maxcoderz Staff

Joined: Wed 15 Dec, 2004 7:26 pm
Posts: 2735
Location: The Hague, Netherlands
Hehe, nice... as you may read I am also only throwing idea's so that's ok

no, the AI does not know what kind of card the player has. it can only guess whether it is possible he will be destroyed or not. For example, the highest damage card atm is 15. So if his HP is below 15, he will know that there is a possibility that he can lose

_________________

Top

 Post subject: Posted: Sat 12 Feb, 2005 4:53 pm
 New Member

Joined: Sun 16 Jan, 2005 3:25 am
Posts: 59
Location: St. Louis
It could do some card counting type things, meaning, determine the likelihood the players has a DMG15 card if he has already played 4-5 of these.

-Mike

Top

 Post subject: Posted: Sat 12 Feb, 2005 5:38 pm
 Maxcoderz Staff

Joined: Wed 15 Dec, 2004 7:26 pm
Posts: 2735
Location: The Hague, Netherlands
Mike K wrote:
It could do some card counting type things, meaning, determine the likelihood the players has a DMG15 card if he has already played 4-5 of these.

-Mike
nah... that wouldn't be to realistic, since a player can make his own deck.

_________________

Top

 Post subject: Posted: Sat 12 Feb, 2005 11:38 pm
 New Member

Joined: Sun 16 Jan, 2005 3:25 am
Posts: 59
Location: St. Louis
Oh, gotcha. You wouldn't know how many max cards the other player COULD be holding.

-Mike

Top

 Post subject: Posted: Sat 12 Feb, 2005 11:40 pm
 Maxcoderz Staff

Joined: Wed 15 Dec, 2004 7:26 pm
Posts: 2735
Location: The Hague, Netherlands
Mike K wrote:
Oh, gotcha. You wouldn't know how many max cards the other player COULD be holding.

-Mike
exactly it nice though that you are trying to help... keep it coming!

_________________

Top

 Post subject: Posted: Sun 13 Feb, 2005 11:10 pm
 Maxcoderz Staff

Joined: Sat 18 Dec, 2004 6:53 pm
Posts: 1349
Shouldn't there be a limit of how many cards you have of certain ones? Some cards might be really useful but you'd only be allowed to have one, otherwise you could overpower your deck..

_________________
[Gridwars Score] - E: 1860037 M: 716641 H: 261194

Top

 Post subject: Posted: Sun 13 Feb, 2005 11:51 pm
 Regular Member

Joined: Sat 18 Dec, 2004 3:01 pm
Posts: 105
Perhaps the limit should be set for each card level? (Unless it's too much of a hassle) For example: DMG 3 has a limit of four and DMG+15 has a limit of 2.

Top

 Post subject: Posted: Mon 14 Feb, 2005 12:10 am
 Sir Posts-A-Lot

Joined: Sat 18 Dec, 2004 3:38 am
Posts: 228
I once wrote an AI for dutch card-game "toepen". I used my own experience of the game into the AI such as the sequence of playing cards and what to do in end-game situations. So it may be helpfull to play the game to other persons a few times to get the hang of it, learn some tricks, get the basic idea of what a good player should do, and then translate this behaviour into programmable conditionals or the like. It will feel humanlike and can be much faster then any A* depth-first or whatever treesearch.

Top

 Post subject: Posted: Mon 14 Feb, 2005 3:20 am
You could add cards that let's you draw or discard or retrieve cards from discard pile, etc

Just my two cent

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 2 [ 29 posts ] Go to page 1, 2  Next

 All times are UTC

#### Who is online

Users browsing this forum: No registered users and 2 guests

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ General    News and Information    General TI Discussion    Off Topic    Announce Your Projects    Pixel Art Projects    Staff Side Projects & Featured Projects    Aether 3D    BBC BASIC    Latenite, Brass and EarlyMorning    Metroid    Nostromo    Smash Bros    Super Mario - and the Elemental Crystal    Tankies    xLIB    solidFRAME Products    Staff Side Products & Featured Products    Desolate    Grayscale Dev Kit    The Verdante Forest    Trapped    Discontinued Projects Programming    Programming Help    Program Ideas    Programming Competition
Powered by phpBB ® Forum Software © phpBB Group | DVGFX2 by: Matt