After the update of StarCraft II on Nov 25th 2024 (from verison 5.0.13 to 5.0.14), for the current version burnysc2(vsersion 7.0.1), we received a key error summarized below
1. Location of the KeyError:
• The issue arises in sc2/unit.py in the from_proto method while trying to retrieve proto.ability_id (value: 4132) from bot_object.game_data.abilities.
2. Cause:
• The ability ID 4132 is not present in bot_object.game_data.abilities.
• This could happen if:
• The ability ID is invalid or unregistered.
• There is a mismatch between the game data and the bot logic (e.g., the game is updated, but the library is outdated).
3. Impact:
• The bot cannot interpret the order associated with the ability ID 4132.
• This prevents the bot from processing the unit’s orders correctly.
File "", line 1, in
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/multiprocessing/spawn.py", line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
│ │ └ 4
│ └ 35
└ <function _main at 0x1062944c0>
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/multiprocessing/spawn.py", line 129, in _main
return self._bootstrap(parent_sentinel)
│ │ └ 4
│ └ <function BaseProcess._bootstrap at 0x10624f370>
└
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
self.run()
│ └ <function BaseProcess.run at 0x10624e9e0>
└
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
│ │ │ │ │ └ {}
│ │ │ │ └
│ │ │ └ (<DictProxy object, typeid 'dict' at 0x1062b00a0>, <AcquirerProxy object, typeid 'Lock' at 0x1062b01c0>, 'Ancient Cistern LE'...
│ │ └
│ └ <function protoss_agent_vs_build_in at 0x11c9f0af0>
└
File "/Users/leowu/Desktop/research/llm_coa/nips_repo/sc2_rl_agent/starcraftenv_test/env/bot/Protoss_bot.py", line 2153, in protoss_agent_vs_build_in
result = run_game(maps.get(map),
│ │ │ └ 'Ancient Cistern LE'
│ │ └ <function get at 0x107bff1c0>
│ └ <module 'sc2.maps' from '/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/sc2/maps.py'>
└ <function run_game at 0x11c967370>
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/sc2/main.py", line 496, in run_game
result: Result = asyncio.run(_host_game(map_settings, players, *kwargs))
│ │ │ │ │ └ {'realtime': False, 'save_replay_as': '/Users/leowu/Desktop/research/llm_coa/nips_repo/sc2_rl_agent/starcraftenv_test/env/bot...
│ │ │ │ └ [<sc2.player.Bot object at 0x309d5fe80>, <sc2.player.Computer object at 0x309d5fd90>]
│ │ │ └ Map(/Applications/StarCraft II/maps/Ancient Cistern LE.SC2Map)
│ │ └ <function _host_game at 0x11c966f80>
│ └ <function _patch_asyncio..run at 0x11c9af760>
└ <module 'asyncio' from '/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/asyncio/init.py'>
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/nest_asyncio.py", line 31, in run
return loop.run_until_complete(task)
│ │ └ <Task pending name='Task-1' coro=<_host_game() running at /Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/s...
│ └ <function _patch_loop..run_until_complete at 0x11c9f04c0>
└ <_UnixSelectorEventLoop running=True closed=False debug=False>
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/nest_asyncio.py", line 93, in run_until_complete
self._run_once()
│ └ <function _patch_loop.._run_once at 0x11c9f0550>
└ <_UnixSelectorEventLoop running=True closed=False debug=False>
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/nest_asyncio.py", line 129, in _run_once
handle._run()
│ └ <function Handle._run at 0x107d870a0>
└ <Handle Task.__wakeup()>
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/asyncio/events.py", line 80, in _run
self._context.run(self._callback, self._args)
│ │ │ │ │ └ <member '_args' of 'Handle' objects>
│ │ │ │ └ <Handle Task.wakeup()>
│ │ │ └ <member '_callback' of 'Handle' objects>
│ │ └ <Handle Task.__wakeup()>
│ └ <member '_context' of 'Handle' objects>
└ <Handle Task.wakeup()>
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/asyncio/tasks.py", line 315, in wakeup
self.step()
└ <Task pending name='Task-1' coro=<_host_game() running at /Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/s...
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/nest_asyncio.py", line 205, in step
step_orig(task, exc)
│ │ └ None
│ └ <Task pending name='Task-1' coro=<_host_game() running at /Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/s...
└ <function Task.step at 0x107de5240>
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/asyncio/tasks.py", line 232, in step
result = coro.send(None)
│ └ <method 'send' of 'coroutine' objects>
└ <coroutine object _host_game at 0x309d29fc0>
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/sc2/main.py", line 369, in _host_game
result = await _play_game(players[0], client, realtime, portconfig, game_time_limit, rgb_render_config)
│ │ │ │ │ │ └ None
│ │ │ │ │ └ None
│ │ │ │ └ None
│ │ │ └ False
│ │ └ <sc2.client.Client object at 0x309d888e0>
│ └ [<sc2.player.Bot object at 0x309d5fe80>, <sc2.player.Computer object at 0x309d5fd90>]
└ <function _play_game at 0x11c966dd0>
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/sc2/main.py", line 226, in _play_game
result = await _play_game_ai(client, player_id, player.ai, realtime, game_time_limit)
│ │ │ │ │ │ └ None
│ │ │ │ │ └ False
│ │ │ │ └ <sc2_rl_agent.starcraftenv_test.env.bot.Protoss_bot.Protoss_Bot object at 0x1062341c0>
│ │ │ └ <sc2.player.Bot object at 0x309d5fe80>
│ │ └ 1
│ └ <sc2.client.Client object at 0x309d888e0>
└ <function _play_game_ai at 0x11c966c20>
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/sc2/main.py", line 196, in _play_game_ai
await run_bot_iteration(iteration) # Main bot loop
│ └ 230
└ <function _play_game_ai..run_bot_iteration at 0x308c46b00>
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/sc2/main.py", line 156, in run_bot_iteration
await ai.on_step(iteration)
│ │ └ 230
│ └ <function Protoss_Bot.on_step at 0x11c9f8820>
└ <sc2_rl_agent.starcraftenv_test.env.bot.Protoss_bot.Protoss_Bot object at 0x1062341c0>
File "/Users/leowu/Desktop/research/llm_coa/nips_repo/sc2_rl_agent/starcraftenv_test/env/bot/Protoss_bot.py", line 1996, in on_step
information = self.get_information()
│ └ <function Protoss_Bot.get_information at 0x11c9f11b0>
└ <sc2_rl_agent.starcraftenv_test.env.bot.Protoss_bot.Protoss_Bot object at 0x1062341c0>
File "/Users/leowu/Desktop/research/llm_coa/nips_repo/sc2_rl_agent/starcraftenv_test/env/bot/Protoss_bot.py", line 448, in get_information
"building": self._get_building_information(),
│ └ <function Protoss_Bot._get_building_information at 0x11c9f12d0>
└ <sc2_rl_agent.starcraftenv_test.env.bot.Protoss_bot.Protoss_Bot object at 0x1062341c0>
File "/Users/leowu/Desktop/research/llm_coa/nips_repo/sc2_rl_agent/starcraftenv_test/env/bot/Protoss_bot.py", line 475, in _get_building_information
self.base_pending = self.already_pending(UnitTypeId.NEXUS)
│ │ │ │ │ └ UnitTypeId.NEXUS
│ │ │ │ └ <enum 'UnitTypeId'>
│ │ │ └ <function BotAI.already_pending at 0x11c0a67a0>
│ │ └ <sc2_rl_agent.starcraftenv_test.env.bot.Protoss_bot.Protoss_Bot object at 0x1062341c0>
│ └ 0
└ <sc2_rl_agent.starcraftenv_test.env.bot.Protoss_bot.Protoss_Bot object at 0x1062341c0>
KeyError: 4132
2024-11-26 16:28:28.465 | INFO | sc2.sc2process:_close_connection:231 - Closing connection at 51614...
2024-11-26 16:28:28.467 | INFO | sc2.sc2process:kill_all:33 - kill_switch: Process cleanup for 1 processes
Process Process-3:
Traceback (most recent call last):
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
self.run()
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/multiprocessing/process.py", line 108, in run
self._target(*self._args, self._kwargs)
File "/Users/leowu/Desktop/research/llm_coa/nips_repo/sc2_rl_agent/starcraftenv_test/env/bot/Protoss_bot.py", line 2153, in protoss_agent_vs_build_in
result = run_game(maps.get(map),
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/sc2/main.py", line 496, in run_game
result: Result = asyncio.run(_host_game(map_settings, players, kwargs))
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/nest_asyncio.py", line 31, in run
return loop.run_until_complete(task)
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/nest_asyncio.py", line 99, in run_until_complete
return f.result()
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/asyncio/futures.py", line 201, in result
raise self._exception.with_traceback(self._exception_tb)
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/asyncio/tasks.py", line 232, in step
result = coro.send(None)
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/sc2/main.py", line 369, in _host_game
result = await _play_game(players[0], client, realtime, portconfig, game_time_limit, rgb_render_config)
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/sc2/main.py", line 226, in _play_game
result = await _play_game_ai(client, player_id, player.ai, realtime, game_time_limit)
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/sc2/main.py", line 196, in _play_game_ai
await run_bot_iteration(iteration) # Main bot loop
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/sc2/main.py", line 156, in run_bot_iteration
await ai.on_step(iteration)
File "/Users/leowu/Desktop/research/llm_coa/nips_repo/sc2_rl_agent/starcraftenv_test/env/bot/Protoss_bot.py", line 1996, in on_step
information = self.get_information()
File "/Users/leowu/Desktop/research/llm_coa/nips_repo/sc2_rl_agent/starcraftenv_test/env/bot/Protoss_bot.py", line 448, in get_information
"building": self._get_building_information(),
File "/Users/leowu/Desktop/research/llm_coa/nips_repo/sc2_rl_agent/starcraftenv_test/env/bot/Protoss_bot.py", line 475, in _get_building_information
self.base_pending = self.already_pending(UnitTypeId.NEXUS)
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/sc2/bot_ai.py", line 865, in already_pending
return self._abilities_count_and_build_progress[0][ability]
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/sc2/cache.py", line 46, in get__
value = self.func(obj)
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/sc2/bot_ai_internal.py", line 277, in _abilities_count_and_build_progress
for order in unit.orders:
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/functools.py", line 981, in get
val = self.func(instance)
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/sc2/unit.py", line 1028, in orders
return [UnitOrder.from_proto(order, self._bot_object) for order in self._proto.orders]
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/sc2/unit.py", line 1028, in
return [UnitOrder.from_proto(order, self._bot_object) for order in self._proto.orders]
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/sc2/unit.py", line 95, in from_proto
ability=bot_object.game_data.abilities[proto.ability_id],
KeyError: 4132
After the update of StarCraft II on Nov 25th 2024 (from verison 5.0.13 to 5.0.14), for the current version burnysc2(vsersion 7.0.1), we received a key error summarized below
The original error log is below:
2024-11-26 16:28:28.449 | ERROR | sc2.main:run_bot_iteration:161 - Caught unknown exception: 4132 Traceback (most recent call last):
File "", line 1, in
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/multiprocessing/spawn.py", line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
│ │ └ 4
│ └ 35
└ <function _main at 0x1062944c0>
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/multiprocessing/spawn.py", line 129, in _main
return self._bootstrap(parent_sentinel)
│ │ └ 4
│ └ <function BaseProcess._bootstrap at 0x10624f370>
└
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
self.run()
│ └ <function BaseProcess.run at 0x10624e9e0>
└
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
│ │ │ │ │ └ {}
│ │ │ │ └
│ │ │ └ (<DictProxy object, typeid 'dict' at 0x1062b00a0>, <AcquirerProxy object, typeid 'Lock' at 0x1062b01c0>, 'Ancient Cistern LE'...
│ │ └
│ └ <function protoss_agent_vs_build_in at 0x11c9f0af0>
└
File "/Users/leowu/Desktop/research/llm_coa/nips_repo/sc2_rl_agent/starcraftenv_test/env/bot/Protoss_bot.py", line 2153, in protoss_agent_vs_build_in result = run_game(maps.get(map), │ │ │ └ 'Ancient Cistern LE' │ │ └ <function get at 0x107bff1c0> │ └ <module 'sc2.maps' from '/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/sc2/maps.py'> └ <function run_game at 0x11c967370>
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/sc2/main.py", line 496, in run_game result: Result = asyncio.run(_host_game(map_settings, players, *kwargs)) │ │ │ │ │ └ {'realtime': False, 'save_replay_as': '/Users/leowu/Desktop/research/llm_coa/nips_repo/sc2_rl_agent/starcraftenv_test/env/bot... │ │ │ │ └ [<sc2.player.Bot object at 0x309d5fe80>, <sc2.player.Computer object at 0x309d5fd90>] │ │ │ └ Map(/Applications/StarCraft II/maps/Ancient Cistern LE.SC2Map) │ │ └ <function _host_game at 0x11c966f80> │ └ <function _patch_asyncio..run at 0x11c9af760>
└ <module 'asyncio' from '/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/asyncio/init.py'>
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/nest_asyncio.py", line 31, in run
return loop.run_until_complete(task)
│ │ └ <Task pending name='Task-1' coro=<_host_game() running at /Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/s...
│ └ <function _patch_loop..run_until_complete at 0x11c9f04c0>
└ <_UnixSelectorEventLoop running=True closed=False debug=False>
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/nest_asyncio.py", line 93, in run_until_complete
self._run_once()
│ └ <function _patch_loop.._run_once at 0x11c9f0550>
└ <_UnixSelectorEventLoop running=True closed=False debug=False>
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/nest_asyncio.py", line 129, in _run_once
handle._run()
│ └ <function Handle._run at 0x107d870a0>
└ <Handle Task.__wakeup()>
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/asyncio/events.py", line 80, in _run
self._context.run(self._callback, self._args)
│ │ │ │ │ └ <member '_args' of 'Handle' objects>
│ │ │ │ └ <Handle Task.wakeup()>
│ │ │ └ <member '_callback' of 'Handle' objects>
│ │ └ <Handle Task.__wakeup()>
│ └ <member '_context' of 'Handle' objects>
└ <Handle Task. wakeup()>
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/asyncio/tasks.py", line 315, in wakeup
self.step()
└ <Task pending name='Task-1' coro=<_host_game() running at /Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/s...
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/nest_asyncio.py", line 205, in step
step_orig(task, exc)
│ │ └ None
│ └ <Task pending name='Task-1' coro=<_host_game() running at /Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/s...
└ <function Task.step at 0x107de5240>
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/asyncio/tasks.py", line 232, in step
result = coro.send(None)
│ └ <method 'send' of 'coroutine' objects>
└ <coroutine object _host_game at 0x309d29fc0>
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/sc2/main.py", line 369, in _host_game
result = await _play_game(players[0], client, realtime, portconfig, game_time_limit, rgb_render_config)
│ │ │ │ │ │ └ None
│ │ │ │ │ └ None
│ │ │ │ └ None
│ │ │ └ False
│ │ └ <sc2.client.Client object at 0x309d888e0>
│ └ [<sc2.player.Bot object at 0x309d5fe80>, <sc2.player.Computer object at 0x309d5fd90>]
└ <function _play_game at 0x11c966dd0>
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/sc2/main.py", line 226, in _play_game
result = await _play_game_ai(client, player_id, player.ai, realtime, game_time_limit)
│ │ │ │ │ │ └ None
│ │ │ │ │ └ False
│ │ │ │ └ <sc2_rl_agent.starcraftenv_test.env.bot.Protoss_bot.Protoss_Bot object at 0x1062341c0>
│ │ │ └ <sc2.player.Bot object at 0x309d5fe80>
│ │ └ 1
│ └ <sc2.client.Client object at 0x309d888e0>
└ <function _play_game_ai at 0x11c966c20>
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/sc2/main.py", line 196, in _play_game_ai
await run_bot_iteration(iteration) # Main bot loop
│ └ 230
└ <function _play_game_ai..run_bot_iteration at 0x308c46b00>
File "/Users/leowu/Desktop/research/llm_coa/nips_repo/sc2_rl_agent/starcraftenv_test/env/bot/Protoss_bot.py", line 1996, in on_step information = self.get_information() │ └ <function Protoss_Bot.get_information at 0x11c9f11b0> └ <sc2_rl_agent.starcraftenv_test.env.bot.Protoss_bot.Protoss_Bot object at 0x1062341c0>
File "/Users/leowu/Desktop/research/llm_coa/nips_repo/sc2_rl_agent/starcraftenv_test/env/bot/Protoss_bot.py", line 448, in get_information "building": self._get_building_information(), │ └ <function Protoss_Bot._get_building_information at 0x11c9f12d0> └ <sc2_rl_agent.starcraftenv_test.env.bot.Protoss_bot.Protoss_Bot object at 0x1062341c0>
File "/Users/leowu/Desktop/research/llm_coa/nips_repo/sc2_rl_agent/starcraftenv_test/env/bot/Protoss_bot.py", line 475, in _get_building_information self.base_pending = self.already_pending(UnitTypeId.NEXUS) │ │ │ │ │ └ UnitTypeId.NEXUS │ │ │ │ └ <enum 'UnitTypeId'> │ │ │ └ <function BotAI.already_pending at 0x11c0a67a0> │ │ └ <sc2_rl_agent.starcraftenv_test.env.bot.Protoss_bot.Protoss_Bot object at 0x1062341c0> │ └ 0 └ <sc2_rl_agent.starcraftenv_test.env.bot.Protoss_bot.Protoss_Bot object at 0x1062341c0>
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/sc2/bot_ai.py", line 865, in already_pending return self._abilities_count_and_build_progress[0][ability] │ │ └ AbilityId.PROTOSSBUILD_NEXUS │ └ <sc2.cache.property_cache_once_per_frame object at 0x11c0a8340> └ <sc2_rl_agent.starcraftenv_test.env.bot.Protoss_bot.Protoss_Bot object at 0x1062341c0> File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/sc2/cache.py", line 46, in get value = self.func(obj) │ │ └ <sc2_rl_agent.starcraftenv_test.env.bot.Protoss_bot.Protoss_Bot object at 0x1062341c0> │ └ <function BotAIInternal._abilities_count_and_build_progress at 0x11c0a44c0> └ <sc2.cache.property_cache_once_per_frame object at 0x11c0a8340> File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/sc2/bot_ai_internal.py", line 277, in _abilities_count_and_build_progress for order in unit.orders: │ │ └ <functools.cached_property object at 0x107f8d750> │ └ Unit(name='Probe', tag=4350279681) └ UnitOrder(AbilityData(name=Gather), 4314890241, 0.0) File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/functools.py", line 981, in get val = self.func(instance) │ │ └ Unit(name='Probe', tag=4350279681) │ └ <function Unit.orders at 0x107fa65f0> └ <functools.cached_property object at 0x107f8d750> File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/sc2/unit.py", line 1028, in orders return [UnitOrder.from_proto(order, self._bot_object) for order in self._proto.orders] │ │ │ │ │ │ └ <google.protobuf.internal.python_message._FieldProperty object at 0x107969c60> │ │ │ │ │ └ display_type: Visible │ │ │ │ │ alliance: Self │ │ │ │ │ tag: 4350279681 │ │ │ │ │ unit_type: 84 │ │ │ │ │ owner: 1 │ │ │ │ │ pos { │ │ │ │ │ x: 125.979004 │ │ │ │ │ y: 149.37012 │ │ │ │ │ z: 11.9975... │ │ │ │ └ Unit(name='Probe', tag=4350279681) │ │ │ └ <sc2_rl_agent.starcraftenv_test.env.bot.Protoss_bot.Protoss_Bot object at 0x1062341c0> │ │ └ Unit(name='Probe', tag=4350279681) │ └ <classmethod(<function UnitOrder.from_proto at 0x107f6ab90>)> └ <class 'sc2.unit.UnitOrder'> File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/sc2/unit.py", line 1028, in
return [UnitOrder.from_proto(order, self._bot_object) for order in self._proto.orders]
│ │ │ │ │ │ │ │ └ <google.protobuf.internal.python_message._FieldProperty object at 0x107969c60>
│ │ │ │ │ │ │ └ display_type: Visible
│ │ │ │ │ │ │ alliance: Self
│ │ │ │ │ │ │ tag: 4350279681
│ │ │ │ │ │ │ unit_type: 84
│ │ │ │ │ │ │ owner: 1
│ │ │ │ │ │ │ pos {
│ │ │ │ │ │ │ x: 125.979004
│ │ │ │ │ │ │ y: 149.37012
│ │ │ │ │ │ │ z: 11.9975...
│ │ │ │ │ │ └ Unit(name='Probe', tag=4350279681)
│ │ │ │ │ └ ability_id: 4132
│ │ │ │ │ target_unit_tag: 4358406145
│ │ │ │ │
│ │ │ │ └ <sc2_rl_agent.starcraftenv_test.env.bot.Protoss_bot.Protoss_Bot object at 0x1062341c0> │ │ │ └ Unit(name='Probe', tag=4350279681) │ │ └ ability_id: 4132 │ │ target_unit_tag: 4358406145 │ │
│ └ <classmethod(<function UnitOrder.from_proto at 0x107f6ab90>)> └ <class 'sc2.unit.UnitOrder'> File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/sc2/unit.py", line 95, in from_proto ability=bot_object.game_data.abilities[proto.ability_id], │ │ │ │ └ <google.protobuf.internal.python_message._FieldProperty object at 0x1079687c0> │ │ │ └ ability_id: 4132 │ │ │ target_unit_tag: 4358406145 │ │ │
│ │ └ {1: AbilityData(name=Smart), 2: AbilityData(name=Taunt), 4: AbilityData(name=Stop), 5: AbilityData(name=HoldFireSpecial), 6: ... │ └ <sc2.game_data.GameData object at 0x309d88a30> └ <sc2_rl_agent.starcraftenv_test.env.bot.Protoss_bot.Protoss_Bot object at 0x1062341c0>
KeyError: 4132 2024-11-26 16:28:28.465 | INFO | sc2.sc2process:_close_connection:231 - Closing connection at 51614... 2024-11-26 16:28:28.467 | INFO | sc2.sc2process:kill_all:33 - kill_switch: Process cleanup for 1 processes Process Process-3: Traceback (most recent call last): File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap self.run() File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/multiprocessing/process.py", line 108, in run self._target(*self._args, self._kwargs) File "/Users/leowu/Desktop/research/llm_coa/nips_repo/sc2_rl_agent/starcraftenv_test/env/bot/Protoss_bot.py", line 2153, in protoss_agent_vs_build_in result = run_game(maps.get(map), File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/sc2/main.py", line 496, in run_game result: Result = asyncio.run(_host_game(map_settings, players, kwargs)) File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/nest_asyncio.py", line 31, in run return loop.run_until_complete(task) File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/nest_asyncio.py", line 99, in run_until_complete return f.result() File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/asyncio/futures.py", line 201, in result raise self._exception.with_traceback(self._exception_tb) File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/asyncio/tasks.py", line 232, in step result = coro.send(None) File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/sc2/main.py", line 369, in _host_game result = await _play_game(players[0], client, realtime, portconfig, game_time_limit, rgb_render_config) File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/sc2/main.py", line 226, in _play_game result = await _play_game_ai(client, player_id, player.ai, realtime, game_time_limit) File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/sc2/main.py", line 196, in _play_game_ai await run_bot_iteration(iteration) # Main bot loop File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/sc2/main.py", line 156, in run_bot_iteration await ai.on_step(iteration) File "/Users/leowu/Desktop/research/llm_coa/nips_repo/sc2_rl_agent/starcraftenv_test/env/bot/Protoss_bot.py", line 1996, in on_step information = self.get_information() File "/Users/leowu/Desktop/research/llm_coa/nips_repo/sc2_rl_agent/starcraftenv_test/env/bot/Protoss_bot.py", line 448, in get_information "building": self._get_building_information(), File "/Users/leowu/Desktop/research/llm_coa/nips_repo/sc2_rl_agent/starcraftenv_test/env/bot/Protoss_bot.py", line 475, in _get_building_information self.base_pending = self.already_pending(UnitTypeId.NEXUS) File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/sc2/bot_ai.py", line 865, in already_pending return self._abilities_count_and_build_progress[0][ability] File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/sc2/cache.py", line 46, in get__ value = self.func(obj) File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/sc2/bot_ai_internal.py", line 277, in _abilities_count_and_build_progress for order in unit.orders: File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/functools.py", line 981, in get val = self.func(instance) File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/sc2/unit.py", line 1028, in orders return [UnitOrder.from_proto(order, self._bot_object) for order in self._proto.orders] File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/sc2/unit.py", line 1028, in
return [UnitOrder.from_proto(order, self._bot_object) for order in self._proto.orders]
File "/Users/leowu/miniconda3/envs/cos-sc2/lib/python3.10/site-packages/sc2/unit.py", line 95, in from_proto
ability=bot_object.game_data.abilities[proto.ability_id],
KeyError: 4132