pysc2 icon indicating copy to clipboard operation
pysc2 copied to clipboard

Got issue in BuildMarines minigame

Open KrikunovEV opened this issue 5 years ago • 2 comments

Hi,

I ran BuildMarines mini-game with Agent that does nothing. The environment was created by this way: env = sc2_env.SC2Env( map_name="BuildMarines", step_mul=1, visualize=False, agent_interface_format=sc2_env.AgentInterfaceFormat( feature_dimensions=sc2_env.Dimensions( screen=32, minimap=32) )

Sometimes SCVs are able to collect all resources from middle mineral (when appeared between mineral field and CC) for 14 min and some sec (episode lasts 15 minutes by default). And if i reset the environment then will get the bug: This mineral will not recover and SCVs will stand still beside command center in the next episode although they should start to gather minerales themselves. It will continue until i restart the game (recreate the environment).

As workaround i use game_steps_per_episode=16*60*14 to reduce episode time to 14 min.

I don't know is it designed so but it breaks down NN's learning process.

PySC2==2.0.2 StarCraft II is up to date.

wxiIHJv

KrikunovEV avatar May 18 '19 12:05 KrikunovEV

Got the same issue with pysc2==3.0.0. It happens every time after a certain mineral is exhausted. Resetting the environment does not reset this mineral. A HUGE bug for RL agents, for it can only run for a few episodes before learning to build SCVs to exhaust those minerals.

ccr-cheng avatar Nov 30 '20 11:11 ccr-cheng

I have to use the simple expedient of rebuilding a new environment (instead of restarting) when detecting the bug. For example, when the number of idle workers is greater than 0 when a game starts because by default SCVs are sent to mining.

ccr-cheng avatar Nov 30 '20 12:11 ccr-cheng