pmariglia / showdown

A Pokemon Showdown Battle Bot written in Python
GNU General Public License v3.0
261 stars 178 forks source link

nash_equilibrium bot not working in challenges #40

Closed blargheon77 closed 4 years ago

blargheon77 commented 4 years ago

I've tried using the nash_equilibrium bot multiple times in the accept_challenge mode, but it seems to hitch every time and leaves the match before even starting.

2 things it has done every time this happens are the following: -it's displayed this (blank when i tried for gen8ou and saying kartana when i tried gen8randombattle): [DEBUG] Making HTTP request to https://www.smogon.com/stats/2020-07/moveset/gen8ou-0.txt for usage stats [WARNING] No sets for , trying to find most likely attributes [WARNING] not in the sets lookup, using random battle abilities [WARNING] not in the random-battle sets lookup [WARNING] not in the sets lookup, using random battle items [WARNING] not in the random-battle sets lookup [WARNING] not in the sets lookup [WARNING] not in the random-battle sets lookup [WARNING] not in the sets lookup

and it has also displayed this: Traceback (most recent call last): File "run.py", line 110, in asyncio.get_event_loop().run_until_complete(showdown()) File "E:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\asyncio\base_events.py", line 579, in run_until_complete return future.result() File "run.py", line 93, in showdown winner = await pokemon_battle(ps_websocket_client, config.pokemon_mode) File "E:\Programming\GitPortable\showdown\showdown\run_battle.py", line 156, in pokemon_battle battle = await start_battle(ps_websocket_client, pokemon_battle_type) File "E:\Programming\GitPortable\showdown\showdown\run_battle.py", line 147, in start_battle battle = await start_standard_battle(ps_websocket_client, pokemon_battle_type) File "E:\Programming\GitPortable\showdown\showdown\run_battle.py", line 137, in start_standard_battle await handle_team_preview(battle, ps_websocket_client) File "E:\Programming\GitPortable\showdown\showdown\run_battle.py", line 47, in handle_team_preview best_move = await async_pick_move(battle_copy) File "E:\Programming\GitPortable\showdown\showdown\run_battle.py", line 32, in async_pick_move pool, battle_copy.find_best_move File "E:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\concurrent\futures\thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "E:\Programming\GitPortable\showdown\showdown\battle_bots\nash_equilibrium\main.py", line 191, in find_best_move decision = pick_move_in_equilibrium_from_multiple_score_lookups(list_of_payoffs) File "E:\Programming\GitPortable\showdown\showdown\battle_bots\nash_equilibrium\main.py", line 154, in pick_move_in_equilibrium_from_multiple_score_lookups weighted_choices = get_weighted_choices_from_multiple_score_lookups(score_lookups) File "E:\Programming\GitPortable\showdown\showdown\battle_bots\nash_equilibrium\main.py", line 139, in get_weighted_choices_from_multiple_score_lookups eq = find_nash_equilibrium(sl) File "E:\Programming\GitPortable\showdown\showdown\battle_bots\nash_equilibrium\main.py", line 112, in find_nash_equilibrium equilibria = find_all_equilibria(df) File "E:\Programming\GitPortable\showdown\showdown\battle_bots\nash_equilibrium\main.py", line 88, in find_all_equilibria sp = subprocess.Popen(cmd, stdout=subprocess.PIPE, stdin=subprocess.PIPE) File "E:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\subprocess.py", line 800, in init restore_signals, start_new_session) File "E:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\subprocess.py", line 1207, in _execute_child startupinfo) OSError: [WinError 87] The parameter is incorrect.

If you need any additional information I'd be happy to supply it. I hope the problem is something I overlooked, and if it is then pointing it out would be a great help.

pmariglia commented 4 years ago

Hi @blargheon77

Using the nash_equilibrium bot requires that you have the Gambit binaries installed with the path to the gambit-enummixed.exe executable pointed to by the environment variable GAMBIT_PATH.

However, you don't need to worry about this if you run the bot using docker. I recommend doing this if you are trying to use the nash_equilibrium mode.

See the README

blargheon77 commented 4 years ago

Ah, I must've glanced over that part of the readme, sorry. It's working now, so thanks!