Elements the Game Forum - Free Online Fantasy Card Game
Elements the Game => General Discussion => Topic started by: Xenocidius 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.
-
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. :)
-
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.
-
That's the answer I was waiting for. :P
Thanks for sharing anyway. ;)
-
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?
-
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?
-
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.
-
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.
-
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.
-
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.
-
Very useful. Thanks Xeno!
-
The page on coding the AI is gone, any chance we could have it put back up?
-
It'd be long out of date. This thread is over a year old.
-
It'd be long out of date. This thread is over a year old.
Indeed, but no other resources I know of on the game AI. Can you point me to one?
-
The AI should not have changed much. Just changing in PC priorities, if I remember correctly? As well as playing habits of shards like SoSac.
-
The AI should not have changed much. Just changing in PC priorities, if I remember correctly? As well as playing habits of shards like SoSac.
Remember the massive change with how the AI treats negative attack creatures? That was after the latest update to the article (Jan 2012). There are also several new cards that didn't exist back then.
-
Ah, yes, Antimatter Priority...
-
It would be interesting to read about the AI coding, too bad that the links in the first post are dead..
-
It would be interesting to read about the AI coding, too bad that the links in the first post are dead..
You can still read them via archive. Here:
http://web.archive.org/web/20120329152323/http://elementscommunity.com/wiki/articles/coding-of-the-game-ai/
5 January, 2012 @ 23:32 [Current Revision] by Xenocidius
-
You can still read them via archive. Here:
http://web.archive.org/web/20120329152323/http://elementscommunity.com/wiki/articles/coding-of-the-game-ai/
5 January, 2012 @ 23:32 [Current Revision] by Xenocidius
Cool, thanks for the information!
blarg: