Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

draftbots and afk autopicks will more aggressivly take rares #5397

Merged
merged 4 commits into from Oct 27, 2018

Conversation

@brodee
Copy link
Contributor

@brodee brodee commented Oct 27, 2018

two draft quality of life improvements for situations when real players
quit or go afk.

  1. made the draftbot lean on rarity for card ratings. this helps make
    the draftbots behave and not just pass bombs to the human players.
  2. changed the draft autopick that happens when the timer runs out and
    the player hasn't selected anything. I changed it to pick the last card
    in the pack, which should be the rarest, so basically it raredrafts.
    again making it so AFK players aren't just feeding real live human
    players the best cards.
two draft quality of life improvements for situations when real players
quit or go afk.
1. made the draftbot lean on rarity for card ratings. this helps make
the draftbots behave and not just pass bombs to the human players.
2. changed the draft autopick that happens when the timer runs out and
the player hasn't selected anything. I changed it to pick the last card
in the pack, which should be the rarest, so basically it raredrafts.
again making it so AFK players aren't just feeding real live human
players the best cards.
@JayDi85
Copy link
Member

@JayDi85 JayDi85 commented Oct 27, 2018

Some remarks about score -- it's not only draft. Score system uses for AI game's decisions too (it's checks all possible actions, plays it as simulation, calcs new table score and selects action with max possible score). That's why that's consts must be selected with caution.

@JayDi85 JayDi85 added the AI label Oct 27, 2018
@brodee
Copy link
Contributor Author

@brodee brodee commented Oct 27, 2018

Some remarks about score -- it's not only draft. Score system uses for AI game's decisions too (it's checks all possible actions, plays it as simulation, calcs new table score and selects action with max possible score). That's why that's consts must be selected with caution.

ok, well using rarity for threat assessment isn't a bad idea either. how serious is the ai development for this project?

@brodee
Copy link
Contributor Author

@brodee brodee commented Oct 27, 2018

I have no idea why these 5 tests are failing:

testSummonersEggImprint(org.mage.test.cards.facedown.SummonersEggTest): (Hand) Card counts for card Sejiri Merfolk for PlayerA are not equal expected:<1> but was:<0>
testSummonersEggDies(org.mage.test.cards.facedown.SummonersEggTest): (Hand) Card counts for card Sejiri Merfolk for PlayerA are not equal expected:<1> but was:<0>
testOpponentReturnsCreatureFromGrave(org.mage.test.cards.single.soi.PrizedAmalgamTest): Life amounts are not equal for player PlayerA expected:<16> but was:<17>
testReanimation(org.mage.test.cards.single.soi.PrizedAmalgamTest): Life amounts are not equal for player PlayerA expected:<18> but was:<17>
testOpponentReturnsCreatureFromYourGrave(org.mage.test.cards.single.soi.PrizedAmalgamTest): (Battlefield) Permanents counts for PlayerA are not equal (Merfolk Looter) expected:<1> but was:<0>

none of these tests even look like they're using AI in them. anyone have any hints about that?

@JayDi85
Copy link
Member

@JayDi85 JayDi85 commented Oct 27, 2018

ok, well using rarity for threat assessment isn't a bad idea either. how serious is the ai development for this project?

It's not at development now. AI can't play combos. AI can't use some hard cards/abilities too. About tests failures: I think it's about new rarity coefficient in score calc. You can try to change it from 80 to 40 and etc to test. I'll look later on it too.

P.S. Test engine uses AI for card playing.

@brodee
Copy link
Contributor Author

@brodee brodee commented Oct 27, 2018

ok, well using rarity for threat assessment isn't a bad idea either. how serious is the ai development for this project?

It's not at development now. AI can't play combos. AI can't use some hard cards/abilities too. About tests failures: I think it's about new rarity coefficient in score calc. You can try to change it from 80 to 40 and etc to test. I'll look later on it too.

ok I see whats happening, the tests use the rating to figure out which card to imprint.

some options, I could move that rarity rating checker just specifically to the drafting part.
or I could change those unit tests to use creatures that are of the same rarity

@JayDi85
Copy link
Member

@JayDi85 JayDi85 commented Oct 27, 2018

Nope, it's a good idea for AI too (not only draft). Need more research. It's a test engine bugs, not yours (at least for one of the test).

As example: failed testOpponentReturnsCreatureFromGrave -- it's have direct target option, but test engine ignores it and uses AI selection (it's returns from graveyard rare Prized Amalgam instead common Hill Giant).

shot_181027_103915

@JayDi85 JayDi85 added the bug label Oct 27, 2018
brodee added 3 commits Oct 27, 2018
…arity

multicolor cards are the payoffs for playing those colors so they should
be better
reduced the effect of rarity increasing the rating
addtarget was being ignored and AI was being used to determine a target.
the spell has a target so I think this is not a bug with add target but
rather the test itself
this test uses ai to determine which card to imprint, with my other
changes to AI, the rarity of the cards changed the relative rating of
these two cards. I changed the merfolk to be a common merfolk so that
part of the card rating shouldn't affect it
@brodee
Copy link
Contributor Author

@brodee brodee commented Oct 27, 2018

ok, so my changes fixed the tests.
I'm not exactly sure how addTarget is supposed to work, but it looks like for targeted spells, you should specify the target within the cast call. if that isn't how it should work then that should probably be filed as a separate bug.

the summoner's egg test shouldn't rely on AI at all, it should really hardcode to specify which card to imprint. I couldn't figure out how to do that so I just changed the card name to a common. summoner's egg isn't a targeting spell and the addTarget function didn't seem to allow me to set it.

imo, there are probably lots of tests that implicitly use AI and that should be avoided.

I have a few more ideas for updates to the AI, and I guess I'll just have to update the tests that they disrupt as I find them.

@JayDi85 JayDi85 merged commit 92fddeb into magefree:master Oct 27, 2018
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants