hsahovic / poke-env

A python interface for training Reinforcement Learning bots to battle on pokemon showdown
https://poke-env.readthedocs.io/
MIT License
297 stars 103 forks source link

Metronome Battles / doubles move error? #128

Closed Flametix closed 3 years ago

Flametix commented 3 years ago

Hello,

I saw the update for doubles support some time ago and was interested in seeing how a bot might perform with Metronome Battles (2v2 format with only Metronome) and the possibility of training one to make optimal dynamaxes or something. In the past I've used a hacky method of always sending /choose default, and this has served well enough for mass-testing, but doesn't allow for options like dynamaxing. This time I tried using the choose_random_doubles_move function.

However whenever I ran a metronome battle, this error occurs:

Traceback (most recent call last): File "C:\GitHub\poke-env\src\poke_env\player\player_network_interface.py", line 131, in _handle_message await self._handle_battle_message(split_messages) File "C:\GitHub\poke-env\src\poke_env\player\player.py", line 293, in _handle_battle_message await self._handle_battle_request(battle) File "C:\GitHub\poke-env\src\poke_env\player\player.py", line 315, in _handle_battle_request message = self.choose_move(battle).message File "C:/GitHub/poke-env/src/poke_env/player/MetronomePlayer.py", line 21, in choose_move return self.choose_random_doubles_move(battle) File "C:\GitHub\poke-env\src\poke_env\player\player.py", line 400, in choose_random_doubles_move zip( TypeError: 'Pokemon' object is not iterable

This is not a huge deal for me since I was just testing poke-env out, but I figured I should submit an issue about it sooner or later. Personally I am not sure how this would be resolved, so I just wanted to let you know that it happens. I appreciate all the hard work put into this project and it's good to see that it's still being maintained.

hsahovic commented 3 years ago

Hi @Flametix,

Thanks a lot for the report! I'll take a deeper look at this and try to get a fix out over the weekend.

hsahovic commented 3 years ago

I found the problem: metronome battles were not considered double battles! Here is the faulty line of code. This should be fixed with this commit.

Flametix commented 3 years ago

Thanks for the quick response!

hsahovic commented 3 years ago

No worries - I ran metronomebattles using RandomPlayer agents successfully, but there might be other issues lurking our there. Let me know if you encounter any other!