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

AssertionError: Error with move copycat #330

Open akashsara opened 2 years ago

akashsara commented 2 years ago

Error Message

>battle-gen8anythinggoes-736305
|request|{"active":[{"moves":[{"move":"Switcheroo","id":"switcheroo","pp":16,"maxpp":16,"target":"normal","disabled":false},{"move":"Thunder Wave","id":"thunderwave","pp":32,"maxpp":32,"target":"normal","disabled":false},{"move":"Encore","id":"encore","pp":8,"maxpp":8,"target":"normal","disabled":false},{"move":"Copycat","id":"copycat","pp":31,"maxpp":32,"target":"self","disabled":false}]}],"side":{"name":"GeneralAPISimple 2","id":"p2","pokemon":[{"ident":"p2: Lopunny","details":"Lopunny, F","condition":"64/271","active":true,"stats":{"atk":188,"def":258,"spa":129,"spd":257,"spe":319},"moves":["switcheroo","thunderwave","encore","copycat"],"baseAbility":"klutz","item":"assaultvest","pokeball":"pokeball","ability":"klutz"},{"ident":"p2: Zorua","details":"Zorua, F","condition":"221/221","active":false,"stats":{"atk":149,"def":125,"spa":245,"spd":125,"spe":247},"moves":["darkpulse","extrasensory","sludgebomb","nastyplot"],"baseAbility":"illusion","item":"lifeorb","pokeball":"pokeball","ability":"illusion"},{"ident":"p2: Rapidash","details":"Rapidash-Galar, F","condition":"84/334","active":false,"stats":{"atk":212,"def":176,"spa":197,"spd":196,"spe":339},"moves":["calmmind","morningsun","storedpower","mysticalfire"],"baseAbility":"pastelveil","item":"grassyseed","pokeball":"pokeball","ability":"pastelveil"},{"ident":"p2: Amoonguss","details":"Amoonguss, M","condition":"432/432","active":false,"stats":{"atk":185,"def":239,"spa":206,"spd":218,"spe":96},"moves":["spore","gigadrain","sludgebomb","toxic"],"baseAbility":"regenerator","item":"blacksludge","pokeball":"pokeball","ability":"regenerator"},{"ident":"p2: Flareon","details":"Flareon, M","condition":"0 fnt","active":false,"stats":{"atk":394,"def":156,"spa":203,"spd":257,"spe":229},"moves":["flareblitz","facade","superpower","quickattack"],"baseAbility":"guts","item":"toxicorb","pokeball":"pokeball","ability":"guts"},{"ident":"p2: Rhyperior","details":"Rhyperior, F","condition":"0 fnt","active":false,"stats":{"atk":317,"def":296,"spa":131,"spd":229,"spe":116},"moves":["earthquake","stealthrock","stoneedge","heatcrash"],"baseAbility":"solidrock","item":"leftovers","pokeball":"pokeball","ability":"solidrock"}]},"rqid":37}
Traceback (most recent call last):
  File "E:\Dev\meta-discovery\torch_env\lib\site-packages\poke_env\player\player_network_interface.py", line 179, in _handle_message
    await self._handle_battle_message(split_messages)
  File "E:\Dev\meta-discovery\torch_env\lib\site-packages\poke_env\player\player.py", line 240, in _handle_battle_message
    battle._parse_request(request)
  File "E:\Dev\meta-discovery\torch_env\lib\site-packages\poke_env\environment\battle.py", line 100, in _parse_request
    self.active_pokemon.available_moves_from_request(active_request)
  File "E:\Dev\meta-discovery\torch_env\lib\site-packages\poke_env\environment\pokemon.py", line 487, in available_moves_from_request
    assert {
AssertionError: Error with move copycat. Expected self.moves to contain copycat, metronome, mefirst, mirrormove, assist, transform or mimic. Got {'outrage': outrage (Move object), 'switcheroo': switcheroo (Move object), 'thunderwave': thunderwave (Move object), 'encore': encore (Move object)}
Task exception was never retrieved
future: <Task finished name='Task-1409248' coro=<PlayerNetwork._handle_message() done, defined at E:\Dev\meta-discovery\torch_env\lib\site-packages\poke_env\player\player_network_interface.py:165> exception=AssertionError("Error with move copycat. Expected self.moves to contain copycat, metronome, mefirst, mirrormove, assist, transform or mimic. Got {'outrage': outrage (Move object), 'switcheroo': switcheroo (Move object), 'thunderwave': thunderwave (Move object), 'encore': encore (Move object)}")>
Traceback (most recent call last):
  File "E:\Dev\meta-discovery\torch_env\lib\site-packages\poke_env\player\player_network_interface.py", line 230, in _handle_message
    raise exception
  File "E:\Dev\meta-discovery\torch_env\lib\site-packages\poke_env\player\player_network_interface.py", line 179, in _handle_message
    await self._handle_battle_message(split_messages)
  File "E:\Dev\meta-discovery\torch_env\lib\site-packages\poke_env\player\player.py", line 240, in _handle_battle_message
    battle._parse_request(request)
  File "E:\Dev\meta-discovery\torch_env\lib\site-packages\poke_env\environment\battle.py", line 100, in _parse_request
    self.active_pokemon.available_moves_from_request(active_request)
  File "E:\Dev\meta-discovery\torch_env\lib\site-packages\poke_env\environment\pokemon.py", line 487, in available_moves_from_request
    assert {
AssertionError: Error with move copycat. Expected self.moves to contain copycat, metronome, mefirst, mirrormove, assist, transform or mimic. Got {'outrage': outrage (Move object), 'switcheroo': switcheroo (Move object), 'thunderwave': thunderwave (Move object), 'encore': encore (Move object)}
akashsara commented 2 years ago

From L2, the moves are supposed to be Copycat, Switcheroo, Thunder Wave and Encore. Copycat gets replaced by Outrage for some reason. From my understanding of Copycat it doesn't actually replace the move the Pokemon has, so this should not be happening right?

akashsara commented 2 years ago
>battle-gen8uu-1839769
|request|{"active":[{"moves":[{"move":"Ancient Power","id":"ancientpower","pp":0,"maxpp":8,"target":"normal","disabled":true},{"move":"Dazzling Gleam","id":"dazzlinggleam","pp":0,"maxpp":16,"target":"allAdjacentFoes","disabled":true},{"move":"Soft-Boiled","id":"softboiled","pp":0,"maxpp":16,"target":"self","disabled":true},{"move":"Metronome","id":"metronome","pp":8,"maxpp":16,"target":"self","disabled":false}]}],"side":{"name":"Battle_Agent_2","id":"p2","pokemon":[{"ident":"p2: Togepi","details":"Togepi, F","condition":"211/211","active":true,"stats":{"atk":68,"def":185,"spa":181,"spd":225,"spe":76},"moves":["ancientpower","dazzlinggleam","softboiled","metronome"],"baseAbility":"serenegrace","item":"eviolite","pokeball":"pokeball","ability":"serenegrace"},{"ident":"p2: Kingdra","details":"Kingdra, M","condition":"291/291","active":false,"stats":{"atk":203,"def":227,"spa":317,"spd":226,"spe":269},"moves":["surf","dracometeor","hurricane","hydropump"],"baseAbility":"swiftswim","item":"lifeorb","pokeball":"pokeball","ability":"swiftswim"},{"ident":"p2: Cleffa","details":"Cleffa, M","condition":"290/290","active":false,"stats":{"atk":86,"def":82,"spa":145,"spd":146,"spe":137},"moves":["softboiled","toxic","protect","endeavor"],"baseAbility":"magicguard","item":"eviolite","pokeball":"pokeball","ability":"magicguard"},{"ident":"p2: Quagsire","details":"Quagsire, F","condition":"376/394","active":false,"stats":{"atk":206,"def":278,"spa":149,"spd":183,"spe":106},"moves":["earthquake","toxic","recover","scald"],"baseAbility":"unaware","item":"leftovers","pokeball":"pokeball","ability":"unaware"},{"ident":"p2: Drampa","details":"Drampa, F","condition":"359/359","active":false,"stats":{"atk":140,"def":206,"spa":405,"spd":220,"spe":108},"moves":["hypervoice","dracometeor","flamethrower","roost"],"baseAbility":"berserk","item":"leftovers","pokeball":"pokeball","ability":"berserk"},{"ident":"p2: Stunfisk","details":"Stunfisk, F","condition":"0 fnt","active":false,"stats":{"atk":151,"def":247,"spa":198,"spd":280,"spe":100},"moves":["stealthrock","discharge","earthpower","toxic"],"baseAbility":"static","item":"leftovers","pokeball":"pokeball","ability":"static"}]},"rqid":123}
Traceback (most recent call last):
  File "E:\Dev\meta-discovery\torch_env\lib\site-packages\poke_env\player\player_network_interface.py", line 179, in _handle_message
    await self._handle_battle_message(split_messages)
  File "E:\Dev\meta-discovery\torch_env\lib\site-packages\poke_env\player\player.py", line 240, in _handle_battle_message
    battle._parse_request(request)
  File "E:\Dev\meta-discovery\torch_env\lib\site-packages\poke_env\environment\battle.py", line 100, in _parse_request
    self.active_pokemon.available_moves_from_request(active_request)
  File "E:\Dev\meta-discovery\torch_env\lib\site-packages\poke_env\environment\pokemon.py", line 487, in available_moves_from_request
    assert {
AssertionError: Error with move metronome. Expected self.moves to contain copycat, metronome, mefirst, mirrormove, assist, transform or mimic. Got {'skullbash': skullbash (Move object), 'ancientpower': ancientpower (Move object), 'dazzlinggleam': dazzlinggleam (Move object), 'softboiled': softboiled (Move object)}
2022-09-09 19:16:12,946 - Battle_Agent_2 - WARNING - Unmanaged [from]move message received - move Metronome in cleaned up message ['', 'move', 'p2a: Togepi', 'Horn Attack', 'p1a: Type: Null'] in battle battle-gen8uu-1839769 turn 56
Task exception was never retrieved
future: <Task finished name='Task-36510' coro=<PlayerNetwork._handle_message() done, defined at E:\Dev\meta-discovery\torch_env\lib\site-packages\poke_env\player\player_network_interface.py:165> exception=AssertionError("Error with move metronome. Expected self.moves to contain copycat, metronome, mefirst, mirrormove, assist, transform or mimic. Got {'skullbash': skullbash (Move object), 'ancientpower': ancientpower (Move object), 'dazzlinggleam': dazzlinggleam (Move object), 'softboiled': softboiled (Move object)}")>
Traceback (most recent call last):
  File "E:\Dev\meta-discovery\torch_env\lib\site-packages\poke_env\player\player_network_interface.py", line 230, in _handle_message
    raise exception
  File "E:\Dev\meta-discovery\torch_env\lib\site-packages\poke_env\player\player_network_interface.py", line 179, in _handle_message
    await self._handle_battle_message(split_messages)
  File "E:\Dev\meta-discovery\torch_env\lib\site-packages\poke_env\player\player.py", line 240, in _handle_battle_message
    battle._parse_request(request)
  File "E:\Dev\meta-discovery\torch_env\lib\site-packages\poke_env\environment\battle.py", line 100, in _parse_request
    self.active_pokemon.available_moves_from_request(active_request)
  File "E:\Dev\meta-discovery\torch_env\lib\site-packages\poke_env\environment\pokemon.py", line 487, in available_moves_from_request
    assert {
AssertionError: Error with move metronome. Expected self.moves to contain copycat, metronome, mefirst, mirrormove, assist, transform or mimic. Got {'skullbash': skullbash (Move object), 'ancientpower': ancientpower (Move object), 'dazzlinggleam': dazzlinggleam (Move object), 'softboiled': softboiled (Move object)}

Same scenario but with metronome