Optimization related programming

Hi
To the pokemon fandom out there, I want to write a program to give the optimal attack types (yes you read that right)using the attack type chart (x2, x1, x.5, x0)(http://images.eurogamer.net/2013/usgamer/Type-Chart-Pokemon-Gen-VI.jpg ) to my 6 pokemon. the problem definition is as follows:

To have attacks on the 6 pokemon such that a random matchup of 1 of the 6 with any pokemon has the maximum possible probability to win. maximum probability to win can be defined as having x2 attack for that type and reducing as the attacks get weaker. it should be tried that all attack types have least possible repetitions.

Any help regarding formulating a logic or coding is appreciated.
Last edited on
I don't know how Nintendo does it, but I would probably imagine it something like a two dimensional array, with each element containing the type of Pokemon or move. Simply, a two dimensional array is such that each element in the first dimension points to all elements in the second.

For the type, I'd probably use enums or a class. And then as each attack comes up, compare the type of attack for array[typeHere][x] against the Pokemon type it's opposing [code]array[x][opposingType]]/code].
simply mentionning attack type , should give you an hint : type (enum ?)
For battle , you are asking for a ai system basically . Look for state machine , behaviour tree (more advanced) , etc.
Topic archived. No new replies allowed.