Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ValueError: 3794 is not a valid AbilityId

See original GitHub issue

full stacktrace

$ python3 examples/protoss/
err = 3 /opt/blizzard/buildserver/data.noindex/repositories/sc2/branches/SC2.4.9/Game/Contrib/macteam/libs/ClampCursor/Contrib/mach_override/mach_override.c:244
err = 3 /opt/blizzard/buildserver/data.noindex/repositories/sc2/branches/SC2.4.9/Game/Contrib/macteam/libs/ClampCursor/Contrib/mach_override/mach_override.c:258
err = 3 /opt/blizzard/buildserver/data.noindex/repositories/sc2/branches/SC2.4.9/Game/Contrib/macteam/libs/ClampCursor/Contrib/mach_override/mach_override.c:263
INFO:sc2.protocol:Client status changed to Status.launched (was None)
INFO:sc2.controller:Creating new game
INFO:sc2.controller:Map:     (2)CatalystLE
INFO:sc2.controller:Players: Bot(Race.Protoss, <__main__.CannonRushBot object at 0x10b8d28d0>, name='CheeseCannon'), Computer(Race.Protoss, Difficulty.Medium)
INFO:sc2.protocol:Client status changed to Status.init_game (was Status.launched)
INFO:sc2.protocol:Client status changed to Status.in_game (was None)
INFO:root:Player id: 1 (CheeseCannon)
INFO:sc2.sc2process:kill_switch: Process cleanup
INFO:sc2.sc2process:Cleaning up...
INFO:sc2.sc2process:Cleanup complete
Traceback (most recent call last):
  File "examples/protoss/", line 60, in <module>
  File "examples/protoss/", line 57, in main
    ], realtime=False)
  File "/Users/wseobseo/.local/lib/python3.7/site-packages/sc2/", line 306, in run_game
    _host_game(map_settings, players, **kwargs)
  File "/Users/wseobseo/anaconda3/lib/python3.7/asyncio/", line 568, in run_until_complete
    return future.result()
  File "/Users/wseobseo/.local/lib/python3.7/site-packages/sc2/", line 233, in _host_game
    result = await _play_game(players[0], client, realtime, portconfig, step_time_limit, game_time_limit, rgb_render_config)
  File "/Users/wseobseo/.local/lib/python3.7/site-packages/sc2/", line 204, in _play_game
    result = await _play_game_ai(client, player_id,, realtime, step_time_limit, game_time_limit)
  File "/Users/wseobseo/.local/lib/python3.7/site-packages/sc2/", line 91, in _play_game_ai
    game_data = await client.get_game_data()
  File "/Users/wseobseo/.local/lib/python3.7/site-packages/sc2/", line 143, in get_game_data
    return GameData(
  File "/Users/wseobseo/.local/lib/python3.7/site-packages/sc2/", line 29, in __init__
    self.abilities = {a.ability_id: AbilityData(self, a) for a in data.abilities if a.ability_id in ids}
  File "/Users/wseobseo/.local/lib/python3.7/site-packages/sc2/", line 29, in <dictcomp>
    self.abilities = {a.ability_id: AbilityData(self, a) for a in data.abilities if a.ability_id in ids}
  File "/Users/wseobseo/.local/lib/python3.7/site-packages/sc2/", line 93, in __init__
    assert != 0
  File "/Users/wseobseo/.local/lib/python3.7/site-packages/sc2/", line 101, in id
    return AbilityId(self._proto.remaps_to_ability_id)
  File "/Users/wseobseo/anaconda3/lib/python3.7/", line 307, in __call__
    return cls.__new__(cls, value)
  File "/Users/wseobseo/anaconda3/lib/python3.7/", line 555, in __new__
    return cls._missing_(value)
  File "/Users/wseobseo/anaconda3/lib/python3.7/", line 568, in _missing_
    raise ValueError("%r is not a valid %s" % (value, cls.__name__))
ValueError: 3794 is not a valid AbilityId
ERROR:asyncio:Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x10c14b860>

my library versions

$ pip freeze | grep 'sc\?2'

Also, I use a touch bar MacBook Pro.

Could anybody help me ? thank you very much!

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:11
  • Comments:25

github_iconTop GitHub Comments

BurnySc2commented, May 26, 2019

It is a total mess right now.

Things were working well until StarCraft2 version 4.8.4. In 4.8.5, the pixelmap changed and self.state.upgrades stopped working. Thus, self.already_pending_upgrade(UPGRADEID) stopped working if the upgrade was completely researched (should return 1, but returns 0 instead). self.state.upgrades was fixed in SC2 version 4.9.0.

The master branch of this library is working for SC2 version 4.8.4, while the develop branch fixed the issues with pixelmap introduced in 4.8.5 (and is the same in 4.8.6). Pixelmaps were starting in the top left but are now starting in the bottom left, so they were flipped in y-axis. Also pixelmap values changed from bytes to bits (like pathing grid, placement grid, and in 4.9.0 also creep map).

Dentosal needs a working version for his competition which runs on (I believe) 4.7.1 because it is using this linux client and the master branch works fine for that.

However in SC2 client 4.9.0 a new bug got introduced (that was already there about half a year ago in november 2018) that you can’t run 2 bots against each other, but running bot against built-in AI works (because only one SC2 client needs to run for this). So new competitions like Probots ( ) decided to also run on client version 4.8.4

TLDR: If you want to run the latest SC2 client version 4.9.0 on windows/mac: You need to download and install the develop branch (instruction here: ) and go into the library installation in your python folder and do the following changes: In sc2/ you have to change self.creep: PixelMap = PixelMap(self.observation_raw.map_state.creep, mirrored=True) to self.creep: PixelMap = PixelMap(self.observation_raw.map_state.creep, in_bits=True, mirrored=True) and in sc2/ you have to remove the line assert != 0.

Also you need to download from here and let it run once (create subfolders sc2/ids first) to update the IDs that were changed once again in 4.9.0 Then copy these newly generated files into the sc2/ids/ folders of the library in your python installation.

ocnuybearcommented, Jul 4, 2019
  1. Browse to c:\program files (x86)\microsoft visual studio\shared\python37_64\lib\site-packages\sc2 (I’m using Python in Visual Studio 2019 environment)
  2. Edit and comment out ‘assert != 0’ with # in front, save changes.
  3. Edit and comment out ‘assert self.bits_per_pixel % 8 == 0, “Unsupported pixel density”’ with # in front, save changes.

Run again and game should work now fully updated on 4 Jul 2019

Read more comments on GitHub >

github_iconTop Results From Across the Web

Developers - ValueError: 3794 is not a valid AbilityId - - Bountysource
Coming soon: A brand new website interface for an even better experience!
Read more >
Starcraft starts with python-sc2 but nothing happens after the ...
1 Answer 1 ... I had the same error, the game's current version is not compactible with the modul. There is a thread...
Read more >
Issues · Dentosal/python-sc2 · GitHub
after fixing 3794/3795 error -botAI main_base_ramp fails ... ValueError: 3794 is not a valid AbilityId causing by "realtime=True/False".
Read more >
Use raw_cmd in ATX With Examples - LambdaTest
Learn how to use raw_cmd function in ATX framework for your next python automation project with LambdaTest Automation Testing Advisor.
Read more >
星际2 AI中文教程StarCraft2 AI with python-sc2/pysc2 API
ValueError : 3794 is not a valid AbilityId ... sc2.ids.ability_id import AbilityId from sc2.ids.buff_id import BuffId from sc2.ids.upgrade_id ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found