bstaple1 / MTGA_Draft_17Lands

Magic: The Gathering Arena draft tool that utilizes 17Lands data
MIT License
108 stars 31 forks source link

contribution and idea #14

Closed adverseselection closed 1 year ago

adverseselection commented 2 years ago

Hi I would like to contribute but I'm new to github but am an interemediate python coder. Let me know what's the best way help.

One idea I'd like to implement is a column for chance of wheeling based on this sierkovitz article https://mtgazone.com/how-to-wheel-in-drafts/.

bstaple1 commented 2 years ago

Hi adverseselection,

If you would like to reach out to me to submit ideas, then the best way to do so would be to join the 17Lands discord and DM me (Wumpus#3068). I might not respond immediately. Create an issue ticket in Github if you have a feature request.

Creating a Github issue remains the best way to notify me, and other users, of potential bugs. If you don't have a Github account, then you can try reaching out to me on discord. Please don't report bugs in any of the 17Lands discord channels.

It might take me a few days, or even a week, to review the pull request and provide feedback.

Thanks.

bstaple1 commented 2 years ago

I spent some time reading through Sierkovitz's article and I pushed some relevant code to the DEV_0303 branch.

I took some data points from his Relation of ALSA and probability of wheeling graph, applied a best-fit curve for P9-P14, and calculated the coefficients for the curve polynomial. The curves appear to line up reasonably well with his graph.

image

image

I added a column drop-down option for displaying the wheel percentage in the tables. Initially, I was displaying the raw wheel percentage result, however, I felt that the generalized percentage value didn't reflect the probability of that card being chosen when compared with the rest of the cards in the pack. I ended up normalizing the percentages within the pack so that they all add up to ~100%. The results can be seen below:

image

I spent some time cleaning the code to better comply with the PEP8 style guidelines (ongoing). I will try to be better about code cleaning and documentation since it appears that people are interested in contributing.

The CardResult class in card_logic.py handles the logic that processes the data for the application tables. The new __process_wheel and __process_wheel_normalized functions handle this new logic. The coefficients are stored in the WHEEL_COEFFICIENTS list within the constants.py module.

@adverseselection What are your thoughts on this approach? Feel free to contribute to the DEV_0303 branch.

tony-- commented 2 years ago

Hi @bstaple1. I am on 17lands discord and would like to message you, but I can't find you in the user list and when I try to @ you I get no results.

image

Did you change your name or leave 17lands discord or do I need to wait for you to come online or do I need to learn how to use discord? :confused:

bstaple1 commented 2 years ago

Hi Tony,

I'm taking a little break from the Magic, 17Lands, and this draft tool while I handle some real-life issues. I was in the 17Lands channel not too long ago, however, I've left because I was finding it, as well as the other Magic channels, a bit too distracting.

If you've identified an issue, or you have an enhancement request, then it's probably best to create an issue ticket in Github. I will look into the ticket when I get a chance.

If you're interested in this wheel percentage feature, then the code for the feature, as it's outlined in the post above, is already in the main. As stated above, the methods are part of the CardResult class in card_logic.py. To enable the feature, you just need to add the FIELD_LABEL and DATA_FIELD constants to the COLUMNS_OPTIONS_MAIN_DICT and COLUMNS_OPTIONS_EXTRA_DICT dictionaries in constants.py

adverseselection commented 1 year ago

I haven't checked this email in awhile so I missed your awesome implementation. Thanks for that!

The raw wheel percentage makes more sense to me than the normalized version because if I want two of the cards from the pack (from your example, let's say "negate" and "extinguish the light"), if I take a chance on one of those cards wheeling, how likely will it come back (I take "extinguish" and estimate that I have 3/4 of a chance of getting the "negate"). If we were just ranking the likelihood of the wheel, ATA or ALSA should do that.

Have you ever looked into the pandas library? It seems to be a good fit since there's a lot of filtering and caluclations on tabular data.

When I get some time and become familiar witht the code base, I'll look to contribute. Thanks!