r0adkll / DeckBox

DeckBox for Pokémon TCG: https://play.google.com/store/apps/details?id=com.r0adkll.deckbuilder
GNU General Public License v3.0
117 stars 19 forks source link

[FEATURE] Energy Calculator #121

Open r0adkll opened 4 years ago

r0adkll commented 4 years ago

A tool to calculate/approximate the number of energies of potentially multiple types that your in-progress deck would need based on the number and breakdown of pokemon that you have already added?

Algorithm Inputs

Requirements

FireFlamePhoenx commented 4 years ago

@r0adkll I dont know much about coding but I have been crunching numbers with my deck and I think I have an idea where the equation for the feature should start. Add up all the required colored energies of one color for all the pokemon cards then divide the total by the total number of pokemon moves in every pokemon card the deck. Then times that by 10

So it'd look like:

(TotalEnergyTypeA ÷ TotalMovesTypeA) × 10

Once it does that equation you could have it automatically round up the total to a whole number. The algorithm would run the equation for each type of energy in the deck simultaneously.

But let's say you want to add the total of tag team move bonuses costs, add 1 to the total number of tag team moves of all cards and divide by the total number of bonus costs by the this sum. You get a more realistic requirement of energies when you add 1 to the total number of tag team gx moves. So it'll look like this.

((TotalEnergyTypeA ÷ TotalMovesTypeA) × 10) + ((TotalTagTeamCost) ÷ (TotalTagTeamBonuses + 1)

Anyway I hope this helps you get know where to get started with figuring out how to calculate some of the algorithms. I'll keep playing around with the constants and see if I can come up with anything

sjTaylor commented 4 years ago

For a first pass, I think it'd be best to just use some simple heuristics/rules.

Most decks probably have 8-15 energies.

  1. If all attacks require 1 type of energy, just add 8 of that type to the deck.
  2. If attacks require 2+ types of energy add 2 of each unique type, and then fill the rest in with the most common type.

Obviously there are some issues, but this is just supposed to be an estimate. For example, some pokemon are uses just for their ability (Jirachi, Zebstrika, and mismagius come to mind) so adding energy for them isn't helpful.

I think if we wanted to get really fancy, it would be good (at some point) to do something statistically. For example, use a database of decks that people have made and just take the energy from the most similar deck, or train some machine learning algorithm to predict the amount of each energy. The sample decks in this case could be from websites (e.g. decktrio.com) or from the app somehow.

r0adkll commented 4 years ago

That was my thought to just do something simple and have it appear in the UI like a modal/card that suggests the user adds energy to their deck but doesn't force it as well as letting them dismiss the card or turn off the suggestion for individual decks.

I would love to do some fancy checks for existing / similar deck profiles and suggest energy amounts based on them, or to even use ML with the existing DeckBox database, but that is probably reaching to high in the sky at this point in time.