Drafting
by mtgrares
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Re: Drafting
by Rob Cashwalker » 31 Oct 2011, 17:18
I wonder if something was broken in the no-repeat feature when the card object was split.... Simple test - make a cube with too-few cards and it should eventually hit an exception when there are no cards left in the pool.
The Force will be with you, Always.
-
Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
Re: Drafting
by juzamjedi » 03 Nov 2011, 00:50
I tried the test you have suggested to amusing results. I built a cube list with 4 cards and the normal 15 cards per pack, 3 packs per drafter. I get no error message. It keeps saying qty 1 in the pack even though there seems to be more than 1 in the pack. At the end of the draft I have a deck with 35 Aerathi Berserker, 5 Aether Tradewinds, 2 Aether Web, 3 Aethersnipe.
Re: Drafting
by Niv-Mizzet » 05 Nov 2011, 21:36
I take it from this that there's still no way to make each card only appear once per draft? I just put my Pauper Cube into Forge (minus about 30 cards) to see how it would go. It's really cool but you do get a lot of duplicates.
-
Niv-Mizzet - Posts: 125
- Joined: 17 Oct 2009, 21:20
- Has thanked: 0 time
- Been thanked: 5 times
Re: Drafting
by Rob Cashwalker » 07 Nov 2011, 20:16
I'll get back into some of those details soon.
I have written a CardRating class that will enable ratings to be tracked locally, plus have an immediate impact on the card's rating for the duration of the draft. Every updated rating the user accumulates can be uploaded either periodically or on command. Ratings can be pulled from the server on command.
I just finished some new PHP scripts to marshal a new submission format. I set up new database table with 8 rating data points for each card in each format. The resulting averages will actually be averaged across more than 2 data points at a time.
Next up is re-defining the rating value code.
I have written a CardRating class that will enable ratings to be tracked locally, plus have an immediate impact on the card's rating for the duration of the draft. Every updated rating the user accumulates can be uploaded either periodically or on command. Ratings can be pulled from the server on command.
I just finished some new PHP scripts to marshal a new submission format. I set up new database table with 8 rating data points for each card in each format. The resulting averages will actually be averaged across more than 2 data points at a time.
Next up is re-defining the rating value code.
The Force will be with you, Always.
-
Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
Re: Drafting
by delirimouse » 10 Nov 2011, 23:36
I'm super excited to see where this goes. I actually think Innistrad is a good set to get this sort of thing going in. There is a lot of archetype drafting, and maybe that is the key to doing super well, but just drafting good cards should be enough for the AI to give players a run for their money, and simultaneously give human players practice drafting difficult to accomplish archetypes.
Keep up the good work, and let me know if you want any input on the algorithms involved in drafting, card rating, and deck building.
Keep up the good work, and let me know if you want any input on the algorithms involved in drafting, card rating, and deck building.
- delirimouse
- Posts: 39
- Joined: 30 Aug 2011, 23:33
- Has thanked: 0 time
- Been thanked: 3 times
Re: Drafting
by Rob Cashwalker » 11 Nov 2011, 14:24
I'm planning to use another class to contain the rating calculation methods. Effectively removing all the clumsy code I added to the human pick handler. I'm envisioning the main method would expect three parameters - "Cardname|Set", overall draft pick count and pack size. The class would store some arrays of the cards picked and ratings. After the completion of the draft, another method would be called to push the rating data into the central CardRatings class and ultimately uploaded.
By tracking all the cards picked in the draft, picking a card more than once in a draft will be recognizable and its rating can be increased. Off-color default picks will be recognizable and their ratings could be dropped from the data set instead of lowering their averages.
I really liked the suggestion of tracking cards that were involved in winning the game. With the central CardRatings class, some code can be added in the Win/Lose code in GameAction to track which cards were in the game environment. 1 rating point can be added to cards that were in the library or hand. 2 rating points can be added to cards in the graveyard or exile. 3 rating points can be added to cards in play. (BTW, this only would be checked in draft games, but for either player whoever the winner is)
By tracking all the cards picked in the draft, picking a card more than once in a draft will be recognizable and its rating can be increased. Off-color default picks will be recognizable and their ratings could be dropped from the data set instead of lowering their averages.
I really liked the suggestion of tracking cards that were involved in winning the game. With the central CardRatings class, some code can be added in the Win/Lose code in GameAction to track which cards were in the game environment. 1 rating point can be added to cards that were in the library or hand. 2 rating points can be added to cards in the graveyard or exile. 3 rating points can be added to cards in play. (BTW, this only would be checked in draft games, but for either player whoever the winner is)
The Force will be with you, Always.
-
Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
-
moomarc - Pixel Commander
- Posts: 2091
- Joined: 04 Jun 2010, 15:22
- Location: Johannesburg, South Africa
- Has thanked: 371 times
- Been thanked: 372 times
Re: Drafting
by delirimouse » 12 Nov 2011, 19:24
I would encourage you to only increase a card's AI rating if the AI wins with it (rather than when the human or AI wins with it). For example, a human can probably win with a Burning Vengeance deck very reliably, but the AI should probably never play Burning Vengeance.
There are certainly also cards that involve a lot of skill the AI does not have, so while humans will play them well, the AI will not. Of course, you could argue the AI should still take those cards highly, so the human doesn't run them over, but they probably shouldn't play them in their decks.
Perhaps you should not mix the draft pick order and deck performance ratings, but rather separate them, and use one rating when drafting and one when deck building.
There are certainly also cards that involve a lot of skill the AI does not have, so while humans will play them well, the AI will not. Of course, you could argue the AI should still take those cards highly, so the human doesn't run them over, but they probably shouldn't play them in their decks.
Perhaps you should not mix the draft pick order and deck performance ratings, but rather separate them, and use one rating when drafting and one when deck building.
- delirimouse
- Posts: 39
- Joined: 30 Aug 2011, 23:33
- Has thanked: 0 time
- Been thanked: 3 times
Re: Drafting
by Rob Cashwalker » 14 Nov 2011, 18:59
If the card has the AI Deck SVars, then it would either not be drafted or played in the deck in the first place...
What if the AI winning with a card gives it double the bonus?
What if the AI winning with a card gives it double the bonus?
The Force will be with you, Always.
-
Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
Re: Drafting
by delirimouse » 15 Nov 2011, 02:10
Giving double the bonus sounds great to me. You just have to be sure that the bonus doesn't scale oddly.
I propose something like this:
Adj_Pick_Average = Average_pick - AI_Win_%-.5*Human_Win_%, where here Average_pick is just the average slot a human has picked it in (out of whatever the pack size is), and AI_Win_% is a number between 0 and 1 indicating how often that AI has won when the card was in the AI's deck. Human_Win_% would be similar. With this system, the best a card can possibly be rated is -0.5, and the worst (in a set with 14 pack boosters) would be 14.
The most important thing is that when the AI or a Human wins with a card, it should not result in a linear bump in the rating, as that would result in very poorly behaved ratings (that would, for example, not necessarily stay bounded).
I propose something like this:
Adj_Pick_Average = Average_pick - AI_Win_%-.5*Human_Win_%, where here Average_pick is just the average slot a human has picked it in (out of whatever the pack size is), and AI_Win_% is a number between 0 and 1 indicating how often that AI has won when the card was in the AI's deck. Human_Win_% would be similar. With this system, the best a card can possibly be rated is -0.5, and the worst (in a set with 14 pack boosters) would be 14.
The most important thing is that when the AI or a Human wins with a card, it should not result in a linear bump in the rating, as that would result in very poorly behaved ratings (that would, for example, not necessarily stay bounded).
- delirimouse
- Posts: 39
- Joined: 30 Aug 2011, 23:33
- Has thanked: 0 time
- Been thanked: 3 times
Re: Drafting
by juzamjedi » 04 Dec 2011, 13:34
Cube update. Lots of additions for Innistrad, this set is really sweet. Also I made Green much more ramp-focused in this update. As a reminder my cube only has cards that AI can use.
Also, I don't know what needs to be done, but is it possible to force the AI to draft 2, or 3 color decks at the most? AI loses a lot of games right now due to terrible mana.
Also, I don't know what needs to be done, but is it possible to force the AI to draft 2, or 3 color decks at the most? AI loses a lot of games right now due to terrible mana.
- Attachments
-
JuzamjediCube.zip
- (4.61 KiB) Downloaded 251 times
Re: Drafting
by delirimouse » 04 Dec 2011, 23:22
I think this is a main goal of the current (huge) update to the draft / deckbuilding AI.
I've been encouraging that the AI be allowed to cheat a little if it finds it can't build a two color deck from its pool (say by throwing in a few mediocre on color commons at random). I can see how some people would oppose this idea, but I think the AI really needs the help, so a little cheating seems more than fair.
I've been encouraging that the AI be allowed to cheat a little if it finds it can't build a two color deck from its pool (say by throwing in a few mediocre on color commons at random). I can see how some people would oppose this idea, but I think the AI really needs the help, so a little cheating seems more than fair.
- delirimouse
- Posts: 39
- Joined: 30 Aug 2011, 23:33
- Has thanked: 0 time
- Been thanked: 3 times
Re: Drafting
by juzamjedi » 05 Dec 2011, 23:31
The purist in me wants to see the AI be disciplined enough to "stick to its colors" after it has made enough picks to know what is available. I am thrilled to hear about this (huge) update tease and would be happy to provide more feedback. I cube draft a LOT with Forge already.
That said, I'm in favor of letting the AI "cheat" by adding in some mediocre cards if this is required to build 2 color decks. It isn't fun to keep destroying the AI after it made the first 4-5 land drops (all different) and still can't cast a spell. Mana is (probably) the most critical resource in Magic and right now AI is terrible at managing mana resources.
That said, I'm in favor of letting the AI "cheat" by adding in some mediocre cards if this is required to build 2 color decks. It isn't fun to keep destroying the AI after it made the first 4-5 land drops (all different) and still can't cast a spell. Mana is (probably) the most critical resource in Magic and right now AI is terrible at managing mana resources.
Re: Drafting
by Sloth » 06 Dec 2011, 12:45
Sorry juzamjedi, but there are still cards in your cube the AI won't draft. I once posted a list of cards that would have to go, but you did not remove all of them.juzamjedi wrote:Cube update. Lots of additions for Innistrad, this set is really sweet. Also I made Green much more ramp-focused in this update. As a reminder my cube only has cards that AI can use.
juzamjedi wrote:Also, I don't know what needs to be done, but is it possible to force the AI to draft 2, or 3 color decks at the most? AI loses a lot of games right now due to terrible mana.
OK screw that. Looking at the code it seems that the AI always tries to put at least 15 creatures into the deck and if it hasn't 15 creatures in the two colors it will take creatures from other colors before non-creature spells. Why?
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Drafting
by Sloth » 06 Dec 2011, 17:42
After looking further into the code, i can make out two more crucial factors that prevent the AI from building proper decks:
1. The AI won't pick colorless cards (at least not higher than off color cards).
but most importantly:
2. The boosters aren't really passed around. Only the human gets to pick from a different booster each time. The AI opponents pick mostly from the same booster again and again (until their booster gets handed to the human and then it shifts one booster).
1. The AI won't pick colorless cards (at least not higher than off color cards).
but most importantly:
2. The boosters aren't really passed around. Only the human gets to pick from a different booster each time. The AI opponents pick mostly from the same booster again and again (until their booster gets handed to the human and then it shifts one booster).

-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Who is online
Users browsing this forum: No registered users and 84 guests