Author: Justin Robb
Date: 8/30/2016
Generates a team of six Gen II pokemon for use in Pokemon Gold or Silver. Built in order to supply Pokemon Stadium 2 with a better selection of Pokemon.
- Install Project64.
- Acquire Pokemon Stadium 2 and Pokemon Gold or Silver ROMs legally.
- Install the latest release.
- Provide the locations for each executable in PokemonGenerator program.
- Click Generate (or press CTRL+F12).
- Launch Pokemon Stadium 2. Configure the controller and transfer pak if necessary using the instructions here.
- PokemonGenerator: A GUI to use to easily interact with the core executable.
- Installer: A friendly installer project for quick deployments.
- PokemonGenerator.Tests.Integration: Integration tests.
- PokemonGenerator.Tests.Unit: Unit tests.
- Native Binaries: Binaries needed to run Sql Server Compact.
- ThePokeBase.sdf Compact Database containing all the info needed for Gen II Pokemon.
- Silver.sav & Gold.sav are bundled Gen II Save files.
Pokemon teams are generated using a fairly strict set of rules, with only a bit of randomness, to get the appearence of complete randomness without any of the downsides. There are three steps in this process.
This is one of the easier steps. Given a level, the program chooses six Gen II pokemon out of the available 251. To do this, we first eliminate any pokemon which cannot exist at the level, whether because it would have already evolved, or because it's previous evolution would not have evolved yet. Then we can assign probabilities to each of the remaining pokemon. Giving a higher chance of getting a normal pokemon, a very unlikely chance of getting a lenendary, and a zero chance of getting something stupid like an unknown.
Once we have our team, we can pull all of their base stats from the database - these never change. The only
values that change are IV
and EV
values. You can read about them on bulbapedia, but basically an IV
is a
stat value between 0-15 that is assigned to a pokemon at birth. An EV
is a
number between 0 and 65535 which a pokemon accumulates the more it trains. Both of these values positively
effect stats (the higher the better). To choose these values, we can use a sudo-gaussian algorithm which
tends to choose mid-range values and has a standard deviation of enough to get some variation.
(e.g. IV
values may have a mean of 7.5 and a std deviation of 3). The rest of the stats are based on
formulas defined for Gen II pokemon.
This is by far the most complicated step as each pokemon has four move slots to fill, and a bunch of choices to fill these slots. I will give a brief overview on my process.
- We can get a set of all moves that a pokemon can learn be summing up the moves that it can learn from
HM
's,TM
's, Breeding and leveling up. - We want to choose on average of 3 attack moves that do damage, and one special move which alters stats for each pokemon. This makes each individual move choice easier because it cuts the total move possibilities in half.
- We do not want to see the same move used everywhere, so we can go ahead and prune moves already chosen by pokemon in the current team.
We can also limit the
TM
's available to a team so that, like in the game, a pokemon that consumes aTM
to learn a move makes it so no other pokemon can use thatTM
. (not completely realistic, as some TMs can be purchased or found multiple times, but close enough) - With the remaining moves to choose from, we can assign a probability value to each move. The higher this value is compared to all of the other moves, the more likely this move is to be chosen.
- We Consider the following when assigning probabilities:
- The damage type of the move matches the pokemon's damage type
(physical or special based on the pokemon's base
attack
and basespAttack
values). - If the move has a certain effect, we can weigh it based on this effect. (e.g. moves that cause the user to faint are weighed very low).
- If we are concerned about damage, we prefer moves that do the most damage.
- If a move relies on another move being chosen in order to be effective, we must look at the previously chosen moves and decide a weight based on prerequisites being filled.
- We should favor moves that are different. If a move has already been chosen, or a very similar move has been chosen (same effect, same type), then the move will be very unlikely to be picked.
- We also need to consider type advantages. If the move type compliments the pokemon's type, either matches the type or is strong against pokemon that the pokemon is usually weak against, then the move is preferred.
- The damage type of the move matches the pokemon's damage type
(physical or special based on the pokemon's base
- Make config an injected global config
- Split out player 1/2 forms into common code
- Add Config section for directories
- Create app settings degug/release for default directories (can use %APPDATA% and such)
- Create provider for directory
- AutoFac over ninject
- XUnit over Nunit
- Split tests into unit and integration
- Add PokemonGeneratorForm to injection
- AssignIVsAndEVsToTeam take into account level
- Condense interfaces
- Add ability to add/remove possible pokemon
- Status bar updates for saved/loaded/generated events
- Add Additional Settings Window
- Add Move Filter Window
- Add Legendary/Special effects to pokemon settings window
- Add ability to turn off randomness and pick your own team
- Add options window for pokemon likeliness
- Fix Generator so that if it doesn't have enough to pick from it duplicates picks (team of charizards?)
- Fix allAvailablePokemon and don't display pokemon if level is too low
- Add tooltips
- Add ability to turn on/off level decisions like banning lvl 100 Pikachu (will always choose Riachu instead) (also it's funny that Pikachu is recognized by autocorrect but Riachu is not)
- Reduce size by truncating unused database tables and optimizing resources
- Save configurations on exit so that subsequent GUI load use saved information
- Support changing the macro from Ctrl+F12, in the GUI for generating pokemon
- Test installer on an x86 platform
- Add ability to turn off randomness and pick your own moves
- Add window to show move probabilities for a pokemon at a level
- Add text overlay for disabled pokemon with minimum level
- Replace all icon images with svg images