Tools to play around with GoBattleSim-Engine, including GameMaster parser & PokeQuery builder.
64-bit Windows
64-bit Python 3.5+
pip install gobattlesim
I'll introduce each module by a step-by-step example of generating a kanto starter battle matrix from raw GAME MASTER.
The official Game Master GAME_MASTER.json can be found in online resources such as this repository. One has been prepared in game_master/GAME_MASTER.json.
Let's make the big and heavy Game Master more organized:
python -m gobattlesim.GameMaster game_master/GAME_MASTER.json
- You can add "
-o
" to change the output filepath. The default is "./GBS.json".
The result can be used to configure GoBattleSim Engine.
We usually simulate many combinations of Pokemon and Move at a time (batch simulation). Specifying each one of them by hand could sometimes be very tedious. Module PokeQuery
is here to help. It generates such combinations based on special queries (let's called them PokeQuery
), which works much like the in-game search bar.
In our example, we can do:
python -m gobattlesim.PokeQuery "(charmander,bulbasaur,squirtle) & !(purified,shadow,fall,norm)" "*" "*" -o examples/kanto_starters.csv
-
The nasty term "
& !(purified,shadow,fall,norm)
" is used to filter out those special forms, leaving only the OG starters. -
"
*
" matches all moves in the Pokemon's movepool. -
Output format is determined by the output file extension name; in this case,
csv
. Other options includetsv
andjson
. -
Additionally, "
-c
" specifies the path to GBS configuration. Default to "./GBS.json".
Great, now we have species and moves information ready, but we are still missing the Pokemon stats (attack, defense, maxHP). Our next Module Matrix
can derive stats for each Pokemon based on the targe PvP league.
Let's do:
python -m gobattlesim.Matrix examples/kanto_starters.csv --league great --pokemon -o examples/kanto_starters_with_stats.csv
-
"
--league great
" tells the tool to derive the stats based on target CP 1500. -
"
--pokemon
" tells the tool to only export the pokemon pool and not run the matrix. It is a good habit to verify the input before simulation. In this instance we want to check whether the derived stats are correct.
To run the matrix simulations, just remove the "--pokemon
" flag (and change the output path):
python -m gobattlesim.Matrix examples/kanto_starters.csv --league great -o examples/matrix.csv
-
Same as above, the matrix output format is determined by the extension name. Other options include
tsv
andjson
. -
We can also use kanto_starters_with_stats.csv from earlier step. This way the tool can grab the derived stats instead of doing the derivation again.
This is the core module, the juice of the meat.
To test the Engine
module works with your machine:
python -m gobattlesim
If no error pops up, then you are good to go!
If othwerise the error says:
WindowsError: ... not a valid Win32 application
This could be that your Python is 32-bit. I only compiled a 64-bit libGoBattleSim.dll
.
You can either install a 64-bit Python, or build the library from source yourself.
Of course, it's 100% fine to use the other tools without the Engine
module.
Engine
takes different types of simulation input, including BattleMatrix
. Refer to GoBattleSim-Engine/examples for other types of simulation input supported.
Using above Matrix
module, we can alternatively save the actual simulation input and check it:
python -m gobattlesim.Matrix examples/kanto_starters.csv --league great --input -z -o examples/matrix_input.json
-
The "
--input
" exports the simulation input instead of running the matrix. -
The "
-z
" keeps only the necessary fields for Pokemon.
We can then directly use Engine
to process the input:
python -m gobattlesim examples/matrix_input.json