pysc2 icon indicating copy to clipboard operation
pysc2 copied to clipboard

crash after clicking on my base with layer

Open Khallil opened this issue 6 years ago • 2 comments

I'm on Ubuntu 16.04, using python 3.5, pysc2 : 2.0.1

With the agent interface, It happen very often, that while I'm looking elsewhere in the map and then I click on my base to switch the view on it, the entire program crash.

Error :

File "/usr/local/lib/python3.5/dist-packages/pysc2/lib/features.py", line 969, in transform_action func, func_call.arguments)) ValueError: Argument is out of range for 2/select_point (6/select_point_act [4]; 0/screen [0, 0]), got: [[<SelectPointAct.select: 0>], [84, 6]] I0627 11:34:44.179687 140010580911872 sc2_env.py:531] Environment Close

My SC2Env :

sc2_env.SC2Env(
        map_name="AbyssalReef",
        players=[sc2_env.Agent(sc2_env.Race.zerg), # our Bot
                sc2_env.Bot(sc2_env.Race.protoss,sc2_env.Difficulty.very_easy)], # Blizzard bot
        agent_interface_format=features.AgentInterfaceFormat( # Interface parameters
            feature_dimensions=features.Dimensions(screen=84, minimap=64),use_feature_units=True),
        step_mul=8, # steps before our Agent take a decision 8=300APM, 16=150
        game_steps_per_episode=0, #run game as long as necessary
        visualize=True)

If this issue is already resolved please show me where can I found the solution

Khallil avatar Jun 27 '18 03:06 Khallil

In waiting for a solution : I commented line 966 to 970 in /pysc2/lib/features.py

'''
for s, a in zip(sizes, arg):
        if not 0 <= a < s:
          raise ValueError("Argument is out of range for %s, got: %s" % (
              func, func_call.arguments))
'''

Now I got no crash and everything seems to work normally

Khallil avatar Jun 27 '18 08:06 Khallil

Solution seemed to work for me as well. in the latest version of psych2 / it's lines 1642 - 1645.

UserHIJ avatar Jan 31 '20 22:01 UserHIJ