Environment resets to the exact same level
roger-creus opened this issue · comments
Roger Creus commented
Hi!
I am new to ProcGen, and I'm seeing that using this very simple code I get that the map looks the same after 5 different environment resets. I would expect to see different randomly generated maps. Am I missing something?
import gym
import matplotlib.pyplot as plt
env = gym.make("procgen:procgen-maze-v0")
for i in range(5):
obs = env.reset()
plt.figure()
plt.imshow(obs)
plt.savefig(f"img_{i}.png")
Thank you!
Roger Creus commented
Solved by using the PrcogenEnv class and not using any manual reset
import matplotlib.pyplot as plt
import procgen
import numpy as np
from procgen import ProcgenEnv, ProcgenGym3Env
env = ProcgenEnv(num_envs=1, env_name="maze", num_levels=0, start_level=0, distribution_mode="hard")
for i in range(3000):
ns, r, d, inf = env.step(np.array([5]))
if d:
print("new episode")
plt.figure()
plt.imshow(ns["rgb"][0])
plt.savefig(f"img_{i}.png")