*Author

Offline XenocidiusTopic starter

  • Legendary Member
  • ******
  • Posts: 2696
  • Reputation Power: 49
  • Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.
  • Fear the Darkness ...
  • Awards: Slice of Elements 3rd Birthday CakeFavorite Community Member of 2011Weekly Tournament WinnerWinner of Design a Competition Competition
Coding of the Game's AI (v1.293) https://elementscommunity.org/forum/index.php?topic=33350.msg420695#msg420695
« on: November 05, 2011, 01:57:51 am »
Here (http://elementscommunity.org/wiki/articles/coding-of-the-game-ai/) is the Wiki article I wrote on the coding of the game's AI.

It is basically an updated version of Chriskang's Sandbox (http://elementsthegame.wikia.com/wiki/User:Chriskang).

If you have any questions feel free to ask.
Don't cry because it's over, smile because it happened.

Brontos

  • Guest
Re: Coding of the Game's AI (v1.293) https://elementscommunity.org/forum/index.php?topic=33350.msg420700#msg420700
« Reply #1 on: November 05, 2011, 02:21:06 am »
Very informative! Thanks.

Why don't you check hand size before playing Shard of Serendipity?
Right now, AI wastes cards by playing it with hand full, and the algo line confirms this.

Adding random is good for variety, but creates "AI mistakes", like when AI doesn't use a free hostile skill it can use. Why don't you run another check at the end of the target finding to be sure that the skill has been used (or reduce the random factor influence)? I see flying Eternity with SoR not using their skill on my creatures quite frequently.

Hope I didn't miss something when I looked into this. :)

Offline XenocidiusTopic starter

  • Legendary Member
  • ******
  • Posts: 2696
  • Reputation Power: 49
  • Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.
  • Fear the Darkness ...
  • Awards: Slice of Elements 3rd Birthday CakeFavorite Community Member of 2011Weekly Tournament WinnerWinner of Design a Competition Competition
Re: Coding of the Game's AI (v1.293) https://elementscommunity.org/forum/index.php?topic=33350.msg420705#msg420705
« Reply #2 on: November 05, 2011, 02:29:44 am »
Why don't you check hand size before playing Shard of Serendipity?
Because I'm not zanzarino.

I imagine it will do that soon, but for now ... the AI's just stupid with SoSe.
Don't cry because it's over, smile because it happened.

Brontos

  • Guest
Re: Coding of the Game's AI (v1.293) https://elementscommunity.org/forum/index.php?topic=33350.msg420707#msg420707
« Reply #3 on: November 05, 2011, 02:57:12 am »
That's the answer I was waiting for.  :P
Thanks for sharing anyway. ;)

Offline OldTrees

  • Legendary Member
  • ******
  • Posts: 10297
  • Reputation Power: 114
  • OldTrees is a mythical and divine giver of immortality, one of the Turquoise Nymphs.OldTrees is a mythical and divine giver of immortality, one of the Turquoise Nymphs.OldTrees is a mythical and divine giver of immortality, one of the Turquoise Nymphs.OldTrees is a mythical and divine giver of immortality, one of the Turquoise Nymphs.OldTrees is a mythical and divine giver of immortality, one of the Turquoise Nymphs.OldTrees is a mythical and divine giver of immortality, one of the Turquoise Nymphs.OldTrees is a mythical and divine giver of immortality, one of the Turquoise Nymphs.OldTrees is a mythical and divine giver of immortality, one of the Turquoise Nymphs.OldTrees is a mythical and divine giver of immortality, one of the Turquoise Nymphs.OldTrees is a mythical and divine giver of immortality, one of the Turquoise Nymphs.OldTrees is a mythical and divine giver of immortality, one of the Turquoise Nymphs.OldTrees is a mythical and divine giver of immortality, one of the Turquoise Nymphs.OldTrees is a mythical and divine giver of immortality, one of the Turquoise Nymphs.OldTrees is a mythical and divine giver of immortality, one of the Turquoise Nymphs.OldTrees is a mythical and divine giver of immortality, one of the Turquoise Nymphs.
  • I was available for questions.
  • Awards: Brawl #2 Winner - Team FireTeam Card Design Winner
Re: Coding of the Game's AI (v1.293) https://elementscommunity.org/forum/index.php?topic=33350.msg420719#msg420719
« Reply #4 on: November 05, 2011, 03:50:22 am »
Wow the AI has learned a lot since the last sandbox update.

Is there any place in the AI code that you think the AI is mistaken?
"It is common sense to listen to the wisdom of the wise. The wise are marked by their readiness to listen to the wisdom of the fool."
"Nothing exists that cannot be countered." -OldTrees on indirect counters
Ask the Idea Guru: http://elementscommunity.org/forum/index.php/topic,32272.0.htm

Offline XenocidiusTopic starter

  • Legendary Member
  • ******
  • Posts: 2696
  • Reputation Power: 49
  • Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.
  • Fear the Darkness ...
  • Awards: Slice of Elements 3rd Birthday CakeFavorite Community Member of 2011Weekly Tournament WinnerWinner of Design a Competition Competition
Re: Coding of the Game's AI (v1.293) https://elementscommunity.org/forum/index.php?topic=33350.msg420720#msg420720
« Reply #5 on: November 05, 2011, 03:59:35 am »
Considering that sandbox was written, what, before version 1? It has learned quite a bit. ::)

As mentioned, it's not very smart with Shard of Serendipity. This should and probably will be fixed.

Strangely, it seems that it now plays Purify with no regard for poison damage. It used to play it if (poison currently suffered by AI > AI HP/20). Considering few decks use poison, maybe playing Purify immediately is smarter. Or maybe not.

By mistaken do you mean the coding is wrong/buggy or just that there could be a better way of doing it?
Don't cry because it's over, smile because it happened.

Offline OldTrees

  • Legendary Member
  • ******
  • Posts: 10297
  • Reputation Power: 114
  • OldTrees is a mythical and divine giver of immortality, one of the Turquoise Nymphs.OldTrees is a mythical and divine giver of immortality, one of the Turquoise Nymphs.OldTrees is a mythical and divine giver of immortality, one of the Turquoise Nymphs.OldTrees is a mythical and divine giver of immortality, one of the Turquoise Nymphs.OldTrees is a mythical and divine giver of immortality, one of the Turquoise Nymphs.OldTrees is a mythical and divine giver of immortality, one of the Turquoise Nymphs.OldTrees is a mythical and divine giver of immortality, one of the Turquoise Nymphs.OldTrees is a mythical and divine giver of immortality, one of the Turquoise Nymphs.OldTrees is a mythical and divine giver of immortality, one of the Turquoise Nymphs.OldTrees is a mythical and divine giver of immortality, one of the Turquoise Nymphs.OldTrees is a mythical and divine giver of immortality, one of the Turquoise Nymphs.OldTrees is a mythical and divine giver of immortality, one of the Turquoise Nymphs.OldTrees is a mythical and divine giver of immortality, one of the Turquoise Nymphs.OldTrees is a mythical and divine giver of immortality, one of the Turquoise Nymphs.OldTrees is a mythical and divine giver of immortality, one of the Turquoise Nymphs.
  • I was available for questions.
  • Awards: Brawl #2 Winner - Team FireTeam Card Design Winner
Re: Coding of the Game's AI (v1.293) https://elementscommunity.org/forum/index.php?topic=33350.msg420732#msg420732
« Reply #6 on: November 05, 2011, 04:23:00 am »
Considering that sandbox was written, what, before version 1? It has learned quite a bit. ::)

As mentioned, it's not very smart with Shard of Serendipity. This should and probably will be fixed.

Strangely, it seems that it now plays Purify with no regard for poison damage. It used to play it if (poison currently suffered by AI > AI HP/20). Considering few decks use poison, maybe playing Purify immediately is smarter. Or maybe not.

By mistaken do you mean the coding is wrong/buggy or just that there could be a better way of doing it?
You answered my question. I was wondering where the AI might have room for improvement. SoSer looks likely. Purify might be changed to a hybrid of the two strategies if poison gains more popularity from SoSac.
"It is common sense to listen to the wisdom of the wise. The wise are marked by their readiness to listen to the wisdom of the fool."
"Nothing exists that cannot be countered." -OldTrees on indirect counters
Ask the Idea Guru: http://elementscommunity.org/forum/index.php/topic,32272.0.htm

Offline XenocidiusTopic starter

  • Legendary Member
  • ******
  • Posts: 2696
  • Reputation Power: 49
  • Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.
  • Fear the Darkness ...
  • Awards: Slice of Elements 3rd Birthday CakeFavorite Community Member of 2011Weekly Tournament WinnerWinner of Design a Competition Competition
Re: Coding of the Game's AI (v1.293) https://elementscommunity.org/forum/index.php?topic=33350.msg420737#msg420737
« Reply #7 on: November 05, 2011, 04:32:35 am »
Hybrid of the two strategies ... that would be good. I'd do something like:
  • If a poison card is played in the first two turns, use the poison strategy for the whole game.
  • If no poison card is played in the first two turns, use the current 'strategy'.
  • If at any time a poison card is played, switch to the poison strategy for the rest of the game.
And for SoSe, a rough idea would be:
  • If less than 5 cards in hand, play immediately.
  • If 5 or more cards in hand, chance to play is equal to (8 - number of cards in hand)/10 + desperatio.
Fun speculation, anyway.
Don't cry because it's over, smile because it happened.

Offline Jocko

  • Hero Member
  • *****
  • Posts: 1256
  • Country: ar
  • Reputation Power: 19
  • Jocko is a Blue Crawler starting to think about his first run.Jocko is a Blue Crawler starting to think about his first run.Jocko is a Blue Crawler starting to think about his first run.
  • New to Elements
  • Awards: Slice of Elements 4th Birthday CakeWar #5 Winner - Team AetherSlice of Elements 3rd Birthday CakeHoliday Fun Redux! Winner
Re: Coding of the Game's AI (v1.293) https://elementscommunity.org/forum/index.php?topic=33350.msg420980#msg420980
« Reply #8 on: November 05, 2011, 04:47:09 pm »
Maybe play purify according to the quanta production of the enemy, or the cards he play. Wouldn't work against rainbows, but it could hold purify if in presence of a death, life or time deck.

Offline TheonlyrealBeef

  • Master of Darkness
  • *
  • *
  • *
  • Posts: 4058
  • Country: nl
  • Reputation Power: 61
  • TheonlyrealBeef shines with the light of the Morning Glory!TheonlyrealBeef shines with the light of the Morning Glory!TheonlyrealBeef shines with the light of the Morning Glory!TheonlyrealBeef shines with the light of the Morning Glory!TheonlyrealBeef shines with the light of the Morning Glory!TheonlyrealBeef shines with the light of the Morning Glory!TheonlyrealBeef shines with the light of the Morning Glory!TheonlyrealBeef shines with the light of the Morning Glory!TheonlyrealBeef shines with the light of the Morning Glory!TheonlyrealBeef shines with the light of the Morning Glory!TheonlyrealBeef shines with the light of the Morning Glory!TheonlyrealBeef shines with the light of the Morning Glory!
  • Do not underestimate the power of the dark side!
  • Awards: War #14 Winner - Team Aether14th Trials - Master of Darkness2019 - PvP World ChampionSlice of Elements 11th Birthday CakeWar #13 Winner - Team Darkness13th Trials - Master of DarknessWeekly Tournament WinnerWeekly Tournament WinnerWeekly Tournament Winner4th Grandmaster Battle Winner - DarknessGold DonorSlice of Elements 10th Birthday CakeWar #12 Winner - Team DarknessWeekly Tournament Winner12th Trials - Master of DarknessWeekly Tournament WinnerWeekly Tournament WinnerSlice of Elements 9th Birthday Cake2017 - PvP World ChampionWeekly Tournament WinnerWeekly Tournament WinnerWeekly Tournament WinnerSlice of Elements 8th Birthday CakeWeekly Tournament WinnerWeekly Tournament WinnerWeekly Tournament WinnerBattle League 3/2016 2nd PlaceWeekly Tournament WinnerWeekly Tournament WinnerWeekly Tournament WinnerWeekly Tournament WinnerWeekly Tournament WinnerWeekly Tournament WinnerWeekly Tournament WinnerWeekly Tournament WinnerSlice of Elements 3rd Birthday CakeTeam PvP #4 Winner5th Trials - Master of Darkness4th Trials - Master of Darkness3rd Trials - Master of DarknessWeekly Tournament WinnerMS Paint Card Art #2 Winner
Re: Coding of the Game's AI (v1.293) https://elementscommunity.org/forum/index.php?topic=33350.msg420988#msg420988
« Reply #9 on: November 05, 2011, 04:57:32 pm »
Maybe play purify according to the quanta production of the enemy, or the cards he play. Wouldn't work against rainbows, but it could hold purify if in presence of a death, life or time deck.
Suddenly, Mono Darkness spamming Liquid Shadow from Nymphs onto a Voodoo Doll.
Most Life or Time decks don't use Poison either, making it hold it for no good reason, not to mention it might only lead to more waste if other elements end up getting cards that can cause Poison.

Offline furballdn

  • Legendary Member
  • ******
  • Posts: 7573
  • Reputation Power: 86
  • furballdn is a mythical and divine giver of immortality, one of the Turquoise Nymphs.furballdn is a mythical and divine giver of immortality, one of the Turquoise Nymphs.furballdn is a mythical and divine giver of immortality, one of the Turquoise Nymphs.furballdn is a mythical and divine giver of immortality, one of the Turquoise Nymphs.furballdn is a mythical and divine giver of immortality, one of the Turquoise Nymphs.furballdn is a mythical and divine giver of immortality, one of the Turquoise Nymphs.furballdn is a mythical and divine giver of immortality, one of the Turquoise Nymphs.furballdn is a mythical and divine giver of immortality, one of the Turquoise Nymphs.furballdn is a mythical and divine giver of immortality, one of the Turquoise Nymphs.furballdn is a mythical and divine giver of immortality, one of the Turquoise Nymphs.furballdn is a mythical and divine giver of immortality, one of the Turquoise Nymphs.furballdn is a mythical and divine giver of immortality, one of the Turquoise Nymphs.furballdn is a mythical and divine giver of immortality, one of the Turquoise Nymphs.furballdn is a mythical and divine giver of immortality, one of the Turquoise Nymphs.furballdn is a mythical and divine giver of immortality, one of the Turquoise Nymphs.
  • Facetious trollnotmod
  • Awards: Epic 3 Card Winner - Clockwork GolemBest Recruiter of FriendsBest JournalistBest Chat PainterBattle - Slayer of The Great ChimeraBest Crafted Relic of Other
Re: Coding of the Game's AI (v1.293) https://elementscommunity.org/forum/index.php?topic=33350.msg421178#msg421178
« Reply #10 on: November 06, 2011, 01:35:04 am »
Very useful. Thanks Xeno!

Offline antiaverage

  • Administrator
  • ********
  • ********
  • Posts: 1497
  • Reputation Power: 36
  • antiaverage is a Gargoyle, dangerous and everlasting.antiaverage is a Gargoyle, dangerous and everlasting.antiaverage is a Gargoyle, dangerous and everlasting.antiaverage is a Gargoyle, dangerous and everlasting.antiaverage is a Gargoyle, dangerous and everlasting.antiaverage is a Gargoyle, dangerous and everlasting.antiaverage is a Gargoyle, dangerous and everlasting.
  • HTML5-hipster-sloth.bunchie();
  • Awards: Slice of Elements 15th Birthday CakeSlice of Elements 12th Birthday CakeSlice of Elements 10th Birthday CakeSlice of Elements 9th Birthday CakeRaise the Banners...AgainSlice of Elements 6th Birthday CakeSlice of Elements 5th Birthday CakeMS Paint Card Art #7 WinnerSlice of Elements 4th Birthday CakeSlice of Elements 3rd Birthday Cake
Re: Coding of the Game's AI (v1.293) https://elementscommunity.org/forum/index.php?topic=33350.msg1037855#msg1037855
« Reply #11 on: February 02, 2013, 03:39:58 pm »
The page on coding the AI is gone, any chance we could have it put back up?
Developer of http://dek.im - a Deck Image generator with rollover to view full cards, current to version 1.327

Thanks to Amashi for my avatar!

 

anything
blarg: Amashi