In conjunction with an offline Pokemon Showdown server, battle the teams from Brilliant Diamond and Shining Pearl's Singles format Battle Tower.
poke-env
library to challenge a player, behaving like the in-game trainer AI does††AI has been coded by hand based on observations of in-game behaviour and online research and is still a work-in-progress. If you see erroneous logic, pull requests are most welcome!
poke-env
poke-dojo
makes heavy use of the poke-env
library. poke-env
requires python >= 3.6 and a local Pokemon Showdown server.
pip install poke-env
There's one thing you need to update for your local server when running it, otherwise the normal installation instructions in the README suffice: Trainers in the Battle Tower aren't restricted by the Item Clause. Some teams have multiple Pokemon holding a Focus Sash, for example. With that in mind, your BDSP 3v3 singles format needs to remove that clause. You can do so by:
pokemon-showdown/config/formats.ts
.[Gen 8 BDSP] 3v3 Singles
(last I checked it was lines 1015
- 1022
)ruleset
, add '! Item Clause'
. The ruleset line should now look like:
ruleset: ['Flat Rules', '! Item Clause', 'Min Source Gen = 8'],
Without this change, Showdown will reject Battle Tower trainers' attempts to challenge you if their team violates the item clause.
config
, in poke-dojo
's root directory.config
, create a challenger.txt
file and inside it add the username noted in step 3, and nothing else. E.g., if your username is SaltyBoi420
, the file would simply contain
SaltyBoi420
poke-dojo
's root directory, run the simulator.
python .\battle_tower_simulator.py
Part of the AI's decision-making process involves simulating damage rolls against the opposing Pokemon. At the moment, this is done using POST requests to an API created by Smogon users Nineage and TheFenderStory. With this in mind, the simulator is not truly offline, because these requests obviously require an internet connection. It also slows down the AI's decision-making slightly. Having a proper, offline damage calculation solution is a high priority, but I don't have a clear plan for that yet, as the Pokemon Showdown calculator repository is in TypeScript, and short of hosting an offline calculator server to receive POST requests instead, I'm not sure how to utilise it. I'm open to ideas!
poke-env
library