diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index df11b6257..b25f0ed8e 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -79,7 +79,7 @@ jobs: dockerfile: src/envs/atari_env/server/Dockerfile - name: git-env dockerfile: src/envs/git_env/server/Dockerfile - - name: my-env # Add your environment here + - name: connect4-env # Add your environment here dockerfile: src/envs/connect4_env/server/Dockerfile - name: textarena-env dockerfile: src/envs/textarena_env/server/Dockerfile @@ -87,6 +87,8 @@ jobs: dockerfile: src/envs/browsergym_env/server/Dockerfile - name: snake-env dockerfile: src/envs/snake_env/server/Dockerfile + - name: doom-env + dockerfile: src/envs/doom_env/server/Dockerfile steps: - name: Checkout code diff --git a/.gitignore b/.gitignore index fed309b07..6f1712282 100644 --- a/.gitignore +++ b/.gitignore @@ -108,4 +108,11 @@ outputs/ /uv.lock .uv/ +# ViZDoom generated files +**/_vizdoom.ini +_vizdoom.ini + *.backup*/ + +# .sesskey +*.sesskey diff --git a/docs/environments.md b/docs/environments.md index ab9b3624f..da8a2367e 100644 --- a/docs/environments.md +++ b/docs/environments.md @@ -200,6 +200,25 @@ The OpenEnv community has built a catalog of ready-to-run environments that cove +
+ ViZDoom-powered 3D environment for visual RL research with multiple scenarios, configurable resolution, and real-time rendering. +
+
+
+
Visual Reinforcement Learning for OpenEnv
+"Training agents is more fun when they're fighting demons"
+
+ 















RGB or grayscale screen buffers with configurable resolution
+Health, ammo, kills, armor - perfect for reward shaping
+Fully containerized with web interface for debugging
+Discrete action IDs or button combinations
+Works with TRL, torchforge, and SkyRL
+from envs.doom_env import DoomAction, DoomEnv
+import numpy as np
+
+# Deploy with Docker - fully isolated
+env = DoomEnv.from_docker_image("doom-env:latest")
+
+# Standard RL interface
+obs = env.reset()
+print(f"Screen shape: {obs.observation.screen_shape}")
+
+# Take actions and get visual observations
+for step in range(1000):
+ obs = env.step(DoomAction(action_id=1))
+
+ # Reshape screen buffer for vision models
+ frame = np.array(obs.observation.screen_buffer)
+ frame = frame.reshape(obs.observation.screen_shape)
+
+ # Feed to CNN/ViT/VLM
+ if obs.observation.done:
+ break
+
+env.close()
+ import torch
+from torchvision import transforms
+
+# Process observations for different vision models
+obs = env.reset()
+screen = np.array(obs.observation.screen_buffer)
+screen = screen.reshape(obs.observation.screen_shape)
+
+# For CNN: Direct pixel input [H, W, C] → [C, H, W]
+cnn_input = torch.tensor(screen).permute(2, 0, 1).float() / 255.0
+
+# For ViT: Resize to standard patch size
+vit_transform = transforms.Compose([
+ transforms.ToPILImage(),
+ transforms.Resize((224, 224)),
+ transforms.ToTensor()
+])
+vit_input = vit_transform(screen)
+
+# For VLM: Combine with task description
+task_prompt = "Navigate the corridor and eliminate enemies"
+vlm_input = (screen, task_prompt)
+
+ Learn fundamental movement and shooting mechanics. Perfect starting point for RL agents.
+
+ Navigate through a dangerous corridor while avoiding or eliminating monsters.
+
+ Survive waves of attacking monsters from all directions. Test defensive strategies.
+
+ Resource collection under time pressure. Learn to prioritize and navigate efficiently.
+
+ Pure navigation challenge. Find the exit in a maze-like environment.
+
+ Anticipate and hit moving targets. Develops temporal reasoning skills.
+
+ Defend a line against incoming monsters. Test strategic positioning.
+
+ Learn defensive strategies. Avoid enemy fire by using cover effectively.
+