Package: gobattlesim
GoBattleSim-PythonTools to play around withGoBattleSim-Engine, including GameMaster parser & PokeQuery builder.Prerequisites64-bit Windows64-bit Python 3.5+Installingpip install gobattlesimI'll introduce each module by a step-by-step example of generating akanto starter battle matrixfrom raw GAME MASTER.Module: Game MasterThe official Game MasterGAME_MASTER.jsoncan be found in online resources such asthis repository.Let's make the big and heavy Game Master more organized:python -m gobattlesim.GameMaster game_master/GAME_MASTER.json -o examples/gbs_game_master.jsonThe resultgbs_game_master.jsoncan be used to configure GoBattleSim Engine.Module: PokeQueryWe 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. ModulePokeQueryis here to help. It generates such combinations based on special queries (let's called themPokeQuery), 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)" "*" "*" -c examples/gbs_game_master.json -o examples/kanto_starters.csvThe 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."-c examples/gbs_game_master.json" uses our Game Master from the previous step."-o examples/kanto_starters.csv" saves the generated Pokemon list to the file we desire. Other format options are available; run with "-h" for details.Module: Battle MatrixGreat, now we have species and moves information ready, but we are still missing the Pokemon stats (attack, defense, maxHP). Our next ModuleMatrixcan derive stats for each Pokemon based on the targe PvP league.Let's do:python -m gobattlesim.Matrix examples/kanto_starters.csv -c examples/gbs_game_master.json --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 -c examples/gbs_game_master.json --league great -o examples/matrix.csvNote that we can also usekanto_starters_with_stats.csvfrom earlier step. This way the tool can grab the derived stats instead of doing the derivation again.Module: EngineThis is the core module, the juice of the meat.To test theEnginemodule works with your machine:python -m gobattlesimIf no error pops up, then you are good to go!If othwerise the error says:WindowsError: ... not a valid Win32 applicationThis could be that your Python is 32-bit. I only compiled a 64-bitlibGoBattleSim.dll.
You can either install a 64-bit Python, or build the library fromsourceyourself.Of course, it's 100% fine to use the other tools without theEnginemodule.Enginetakes different types of simulation input, includingBattleMatrix. Refer toGoBattleSim-Engine/examplesfor other types of simulation input supported.Using aboveMatrixmodule, we can alternatively save the actual simulation input and check it:python -m gobattlesim.Matrix examples/kanto_starters.csv -c examples/gbs_game_master.json --league great -iz -o examples/matrix_input.jsonThe "-i" exports the simulation input instead of running the matrix.The "-z" keeps only the necessary fields for Pokemon.We can then directly useEngineto process the input:python -m gobattlesim examples/matrix_input.json -c examples/gbs_game_master.json