Repository: google-deepmind/meltingpot
Issue: Issue in substrate_tutorial
Root cause: Documentation Deficiency

Dear all, thanks for developing such good environment. I am a beginner and I tried to follow the tutorial in https://github.com/deepmind/meltingpot/blob/main/meltingpot/docs/substrate_tutorial/index.md.

In the [getting started section](https://github.com/deepmind/meltingpot/blob/main/meltingpot/docs/substrate_tutorial/index.md#getting-started), I ran the following command at the root of the repo.

```
python3 meltingpot/examples/tutorial/harvest/play_harvest.py -- --observation WORLD.RGB --display_text
```

However, it returned

```
/usr/local/bin/python3: can't open file '/Users/goingmyway/Projects/deepmind/meltingpot/meltingpot/examples/tutorial/harvest/play_harvest.py': [Errno 2] No such file or directory`
```

I tried to copy the examples in `meltingpot` to `meltingpot/meltingpot` and then re-ran the above command

```
$ python3 meltingpot/examples/tutorial/harvest/play_harvest.py -- --observation WORLD.RGB --display_text
pygame 2.1.2 (SDL 2.0.18, Python 3.9.10)
Hello from the pygame community. https://www.pygame.org/contribute.html
Running an episode with 0 players.
W @./meltingpot/lua/modules/base_simulation.lua:205] GameObject 'scene' did not have a StateManager component, but explicitly specifying one is strongly preferred. Using a default.
W @./meltingpot/lua/modules/base_simulation.lua:211] GameObject 'scene' did not have a Transform component, but explicitly specifying one is strongly preferred. Using a default.
I @./meltingpot/lua/modules/base_simulation.lua:432] grid
 

Traceback (most recent call last):
  File "/Users/goingmyway/Projects/deepmind/meltingpot/meltingpot/examples/tutorial/harvest/play_harvest.py", line 67, in <module>
    app.run(main)
  File "/usr/local/lib/python3.9/site-packages/absl/app.py", line 312, in run
    _run_main(main, args)
  File "/usr/local/lib/python3.9/site-packages/absl/app.py", line 258, in _run_main
    sys.exit(main(argv))
  File "/Users/goingmyway/Projects/deepmind/meltingpot/meltingpot/examples/tutorial/harvest/play_harvest.py", line 55, in main
    level_playing_utils.run_episode(
  File "/Users/goingmyway/Projects/deepmind/meltingpot/meltingpot/python/human_players/level_playing_utils.py", line 284, in run_episode
    observation_shape = obs_spec.shape
UnboundLocalError: local variable 'obs_spec' referenced before assignment
```

It seems `WORLD.RGB` was not in `observation_spec`. So, I manually add the following code to `meltingpot/python/human_players/level_playing_utils.py`

```python
 else:
   render_observation = 'WORLD.RGB'
   obs_spec = observation_spec[f'{render_observation}']
```

However, it couldn't show the text in the PyGame GUI after that. By following  [A-Minimal-Game](https://github.com/deepmind/meltingpot/blob/main/meltingpot/docs/substrate_tutorial/index.md#a-minimal-game) section, I couldn't get the right result and instead got a black blanket GUI. Could you please help me?

The OS is macOS Monterey and the Python version is 3.9. I installed the lasted meltingpot.



Hi, it seems like you might be running outdated code? If you look at the place of your error (https://github.com/deepmind/meltingpot/blob/main/meltingpot/python/human_players/level_playing_utils.py#L284) that line differs from the main branch of the repository code. I suggest reinstalling meltingpot and seeing if the problem persists.

> Hi, it seems like you might be running outdated code? If you look at the place of your error (https://github.com/deepmind/meltingpot/blob/main/meltingpot/python/human_players/level_playing_utils.py#L284) that line differs from the main branch of the repository code. I suggest reinstalling meltingpot and seeing if the problem persists.

Hi, thanks for the response. I updated the code and the same issue happens. 

Apologies for the delay. We are investigating. We'll get back to you soon.

> Apologies for the delay. We are investigating. We'll get back to you soon.

@duenez Thanks for the reply.

Hello, the issue is an extra ` -- ` in the command. So, the correct command is:

```
python3 meltingpot/examples/tutorial/harvest/play_harvest.py --observation WORLD.RGB --display_text
```

We are updating the documentation to remove these extra dashes in all commands in the tutorial and elsewhere. I'm closing this issue, but do let me know if you encounter any more issues.