MagicTheGathering / mtg-sdk-python

Magic: The Gathering SDK - Python
MIT License
255 stars 45 forks source link

more a personal problem #32

Open RhythmicGaming opened 4 years ago

RhythmicGaming commented 4 years ago

does anyone have ideas on parsing card text for synergies ive used the sdk to create a database in hopes i can find a player bot ai to train with all these cards but basically im looking for anything anyone has done with this apk in the way of development, the project i hope to one day complete is fairly feature heavy and i could use all the help i can get, tysm for this library its been incredibly helpful

hitz commented 4 years ago

you could try manually curating synergy between cards (just rate each entry in the matrix on like a 0-5 scale) - do this for one set or a partial set and try to train a ML alg to predict it for a different set. Might also help you come up with some heuristics?

RhythmicGaming commented 4 years ago

The issue with manual curation is at that point I'd basically be building every decklist possible, manually, which is something like 400billion combinations possible, I'm looking into training an ai to recognize interactions and text implications at the moment, if I could get the bot to identify synergies and label them for me, I think what youre saying could work.

On Fri, Oct 18, 2019, 12:06 PM Ben Hitz notifications@github.com wrote:

you could try manually curating synergy between cards (just rate each entry in the matrix on like a 0-5 scale) - do this for one set or a partial set and try to train a ML alg to predict it for a different set. Might also help you come up with some heuristics?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/MagicTheGathering/mtg-sdk-python/issues/32?email_source=notifications&email_token=ANN5RRJPJBT7BMSNUHGXIPTQPHNJHA5CNFSM4JCIYCGKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBU6Z5A#issuecomment-543812852, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANN5RRKRG7QLVL4Y5RNRSTDQPHNJHANCNFSM4JCIYCGA .

hitz commented 4 years ago

no you just approximate it with a pairwise matrix. Like if a card says "other goblins you control get +1/+1" then you give a 4 to every other card with creature type goblin. It's something like 250x250 interactions but there are a lot of zeros.

But you can't train anything without a training set.

RhythmicGaming commented 4 years ago

Very true, I figured something similar could be used for tribal interactions, its everything else I feel overwealmed by, specifically etb effects and non creature interactions, these exceptions are a little complex for me to try to make any generalizations about, not all of them are even possitive things in some cases, which is also dependant on synergy and at times even game state.

On Fri, Oct 18, 2019, 12:24 PM Ben Hitz notifications@github.com wrote:

no you just approximate it with a pairwise matrix. Like if a card says "other goblins you control get +1/+1" then you give a 4 to every other card with creature type goblin. It's something like 250x250 interactions but there are a lot of zeros.

But you can't train anything without a training set.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/MagicTheGathering/mtg-sdk-python/issues/32?email_source=notifications&email_token=ANN5RRKXNELSRDJKK3A2UT3QPHPKHA5CNFSM4JCIYCGKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBVAUWA#issuecomment-543820376, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANN5RROVKK4ASBYSWAL6QYDQPHPKHANCNFSM4JCIYCGA .

miguelBra commented 3 years ago

The best way I think its to develop a graph neural network for authomatic embedding of card features. For a very detailed ability learning you could use a recurrent neural network but that could be too difficult, considering you would also need a nice embedding for starting processing words. I just discovered this api and I think I will start also trying to fit a graph (in case i am able to understand how to manipulate the querysets... no success so far).