A Python interface to create battling pokemon agents
The pokemon showdown Python environment
A Python interface to create battling pokemon agents. poke-env offers an easy-to-use interface for creating rule-based or training Reinforcement Learning bots to battle on pokemon showdown.
Agents are instance of python classes inheriting from Player
. Here is what your first agent could look like:
class YourFirstAgent(Player):
def choose_move(self, battle):
for move in battle.available_moves:
if move.base_power > 90:
# A powerful move! Let's use it
return self.create_order(move)
# No available move? Let's switch then!
for switch in battle.available_switches:
if switch.current_hp_fraction > battle.active_pokemon.current_hp_fraction:
# This other pokemon has more HP left... Let's switch it in?
return self.create_order(switch)
# Not sure what to do?
return self.choose_random_move(battle)
To get started, take a look at our documentation!
Documentation and