Repository: google-deepmind/meltingpot
Issue: load_substrates without RLlib and PettingZoo
Root cause: Documentation Deficiency

How to load substrates of meltingpot without using RLlib and PettingZoo, can you give me a demo with ppo?

and are there a doc describing the space of observation and action?

In terms of loading, it should be as easy as importing and using [substrate.py](https://github.com/deepmind/meltingpot/blob/main/meltingpot/python/substrate.py):

```
config = substrate.build('clean_up')
with substrate.build(config) as env:
  # Use the dm_env environment with your setup.
```

I don't know how you'd use our environments with your RL setup and your implementation of PPO.

Does that help?

> In terms of loading, it should be as easy as importing and using [substrate.py](https://github.com/deepmind/meltingpot/blob/main/meltingpot/python/substrate.py):
> 
> ```
> config = substrate.build('clean_up')
> with substrate.build(config) as env:
>   # Use the dm_env environment with your setup.
> ```
> 
> I don't know how you'd use our environments with your RL setup and your implementation of PPO.
> 
> Does that help?

That's not what I mean, I just want to ask, how to directly use the existing substrates environment without using ray, for example: 
`env_name = "commons_harvest_open"`
`env_config = substrate.get_config(env_name)`
`test_env = utils.env_creator(env_config)`
I don't know if it's correct to write？ 
I also want to ask if I can change the number of agents in the environment and if so which parameter should I change?

For Melting Pot v1 you can run an episode like this:

```
config = substrate.get_config('commons_harvest_open') 
config.num_players = 4   # Changing num_players may not work in v1.
with substrate.build(config) as env:
  timestep = env.reset()
  while True:
    actions = joint_policy(timestep)  # However you get these from your policies.
    timestep = env.step(actions)
    if timestep.step_type.first():
      break
```

For the just released Melting Pot v2 it's now:

```
num_players = 4
with substrate.build(
    name='commons_harvest_open',
    roles=('default',) * num_players,
) as env:
  ...
```

> For Melting Pot v1 you can run an episode like this:
> 
> ```
> config = substrate.get_config('commons_harvest_open') 
> config.num_players = 4   # Changing num_players may not work in v1.
> with substrate.build(config) as env:
>   timestep = env.reset()
>   while True:
>     actions = joint_policy(timestep)  # However you get these from your policies.
>     timestep = env.step(actions)
>     if timestep.step_type.first():
>       break
> ```
> 
> For the just released Melting Pot v2 it's now:
> 
> ```
> num_players = 4
> with substrate.build(
>     name='commons_harvest_open',
>     roles=('default',) * num_players,
> ) as env:
>   ...
> ```

This is very useful for me, thank you very much

> For Melting Pot v1 you can run an episode like this:
> 
> ```
> config = substrate.get_config('commons_harvest_open') 
> config.num_players = 4   # Changing num_players may not work in v1.
> with substrate.build(config) as env:
>   timestep = env.reset()
>   while True:
>     actions = joint_policy(timestep)  # However you get these from your policies.
>     timestep = env.step(actions)
>     if timestep.step_type.first():
>       break
> ```
> 
> For the just released Melting Pot v2 it's now:
> 
> ```
> num_players = 4
> with substrate.build(
>     name='commons_harvest_open',
>     roles=('default',) * num_players,
> ) as env:
>   ...
> ```

How to render when I training it?

There's a `WORLD.RGB` observation (identical for each player) that shows a visual representation of the whole game that we use to make our movies. Note, however that it doesn't show things like `INVENTORY` and `READY_TO_SHOOT` observations.

> There's a `WORLD.RGB` observation (identical for each player) that shows a visual representation of the whole game that we use to make our movies. Note, however that it doesn't show things like `INVENTORY` and `READY_TO_SHOOT` observations.

thank you!