Page 1 of 3

Genetic algorithm to find the strongest AI decks

PostPosted: 01 May 2018, 05:57
by austinio7116
I've been playing around with a simple genetic algorithm to learn the best decks in Standard for the AI to play. I use the deck based card generator to create an initial population, then evaluate the fitness of the decks using an AI vs AI swiss tournament. The weaker decks are culled, and new decks generated, slightly favouring decks generated from the same key cards as the best decks from the previous generation. This process is then repeated over several generations.

My first results suggest that Mono white aggro is the strongest archetype as it took over the population after 20 generations. This was the winning decklist:

[metadata]
Name=GAS_1_Benalish Marshal - Adorned Pouncer based deck_398_6
[Main]
4 Adorned Pouncer|HOU
3 Aethersphere Harvester|AER
4 Benalish Marshal|DOM
4 Cartouche of Solidarity|AKH
1 Heart of Kiran|AER
3 History of Benalia|DOM
4 Legion's Landing|XLN
1 Plains|AKH|3
1 Plains|AKH|4
2 Plains|DOM|3
1 Plains|DOM|4
1 Plains|KLD|1
9 Plains|RIX
2 Plains|XLN|2
3 Plains|XLN|3
1 Prizefighter Construct|AER
4 Sacred Cat|AKH
4 Servo Exhibition|KLD
1 Shefet Dunes|HOU
2 Skymarcher Aspirant|RIX
3 Sram's Expertise|AER
2 Toolcraft Exemplar|KLD
[Sideboard]
4 Dauntless Bodyguard|DOM
1 Toolcraft Exemplar|KLD

Re: Genetic algorithm to find the strongest AI decks

PostPosted: 01 May 2018, 05:58
by austinio7116
If you want a strong AI opponent to test decks against - give this one a try.

Re: Genetic algorithm to find the strongest AI decks

PostPosted: 21 Jul 2018, 17:39
by mercazole70
Great. This deck was certainly strong.
Are there any other strong AI decks?

Re: Genetic algorithm to find the strongest AI decks

PostPosted: 31 Jul 2018, 15:22
by mercazole70
Can you learn the best decks in Legacy for the AI ?
Because this deck is strong, I am interested in what happens if you do the same learning in Legacy.
I am not English speaker so I am sorry in immature English.

Re: Genetic algorithm to find the strongest AI decks

PostPosted: 31 Jul 2018, 17:35
by austinio7116
mercazole70 wrote:Can you learn the best decks in Legacy for the AI ?
Because this deck is strong, I am interested in what happens if you do the same learning in Legacy.
I am not English speaker so I am sorry in immature English.
Sorry, I only posted these on discord, should have put them here too.

Re: Genetic algorithm to find the strongest AI decks

PostPosted: 31 Jul 2018, 17:37
by austinio7116
Basically, merfolk won in legacy

Re: Genetic algorithm to find the strongest AI decks

PostPosted: 31 Jul 2018, 17:39
by austinio7116
And vintage, and soul sisters won Modern.

Re: Genetic algorithm to find the strongest AI decks

PostPosted: 01 Aug 2018, 05:39
by mercazole70
Thank you very much for the very strong AI deck collection.
What does each number mean?
Can the first number be interpreted as a ranking? (1> 2> 3> ...> 25)

Re: Genetic algorithm to find the strongest AI decks

PostPosted: 01 Aug 2018, 05:54
by austinio7116
Yes, the final numbers are just generation and deck counters that you can ignore the first is the rank in the final round tournament.

Re: Genetic algorithm to find the strongest AI decks

PostPosted: 12 Aug 2018, 08:35
by AntoineLeo
Your work is really interesting.

Is it possible to get access to the source code you made to get that result ?

What programming language did you use ?

Re: Genetic algorithm to find the strongest AI decks

PostPosted: 12 Aug 2018, 17:08
by austinio7116
It's written in Java in my fork of the Forge git repo. I think the required classes might already be in the upstream master.

Re: Genetic algorithm to find the strongest AI decks

PostPosted: 12 Aug 2018, 17:10
by austinio7116

Re: Genetic algorithm to find the strongest AI decks

PostPosted: 15 Aug 2018, 23:05
by Arcanist
I don't mean to nitpick, but what you are finding is not really the strongest archetype, but the one that Forge plays best.

I don't know if you are aware of this, but there is a small YouTube channel where someone discusses attempts at building decks with genetic algorithms and Forge. The quality of the videos is not great unfortunately. I am not just talking about the sound but also the lack of structure. However, there are some interesting tidbits here and there, where the commentator details the issues he has encountered, and what he did to solve them or work around them.

Re: Genetic algorithm to find the strongest AI decks

PostPosted: 16 Aug 2018, 00:45
by friarsol
Arcanist wrote:I don't mean to nitpick, but what you are finding is not really the strongest archetype, but the one that Forge plays best.
I'm not sure he really suggested that. He said `to learn the best decks in Standard for the AI to play`

The `strongest archetype` that's referenced later is clearly in this context of "Things the AI is good at"

Re: Genetic algorithm to find the strongest AI decks

PostPosted: 16 Aug 2018, 12:16
by austinio7116
Arcanist wrote:I don't mean to nitpick, but what you are finding is not really the strongest archetype, but the one that Forge plays best.
- absolutely right - that is what I intended - in the absence of a strong AI I thought a low hanging fruit would be to try to optimize to some extend the decks that the AI uses to create a stronger and more consistent opponent against which to test our own decks.[/quote]
Arcanist wrote:I don't know if you are aware of this, but there is a small YouTube channel where someone discusses attempts at building decks with genetic algorithms and Forge. The quality of the videos is not great unfortunately. I am not just talking about the sound but also the lack of structure. However, there are some interesting tidbits here and there, where the commentator details the issues he has encountered, and what he did to solve them or work around them.
- thanks - yes I had seen that and as you say I found it lacking in clarity in many ways, but quite interesting nonetheless.