google-deepmind / google-deepmind/pysc2

RGB pixels are all zero?

Open
#329 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
8.3k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

I'm trying to get the RGB screen and minimap values. The exact code that I'm running is as such (I'm on a mac):
```
from pysc2.agents import base_agent, scripted_agent
from pysc2.env import sc2_env
from pysc2.lib import actions, features, units
from absl import app

def main(unused_argv):
agent = scripted_agent.MoveToBeacon()
try:
while True:
with sc2_env.SC2Env(map_name='MoveToBeacon',
players=[sc2_env.Agent(sc2_env.Race.zerg)],
agent_interface_format=features.AgentInterfaceFormat(
rgb_dimensions=features.Dimensions(screen=84, minimap=64),
),
step_mul=16,
game_steps_per_episode=0,
visualize=True) as env:
agent.setup(env.observation_spec(), env.action_spec())

timesteps = env.reset()
agent.reset()

while True:
step_actions = [agent.step(timesteps[0])]
if timesteps[0].last():
break
timesteps = env.step(step_actions)
except KeyboardInterrupt:
pass

if __name__ == '__main__':
app.run(main)
```

Basically, I'm just running the MoveToBeacon mini game agent.

However, when I check `timesteps[0].observation['rgb_screen']`, I am always getting (480, 276, 3) numpy array with all zeros!

* Getting all zeros for RGB values doesn't seem right. How do I fix this?
* 480, 276 dimension values look arbitrary since I set the dimension of screen as 84. How are the dimensions calculated for RGB screen and minimap values?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.