🧩 PuzzleWorld 3D

A Portal-Inspired Platform for Testing AI Agents

What is PuzzleWorld 3D?

PuzzleWorld 3D is an interactive 3D environment where you can test and train AI agents to solve complex spatial reasoning puzzles. Inspired by the iconic Portal game, our platform features physics-based challenges that require your agents to think strategically.

Upload your AI agent code and watch it navigate through test chambers, manipulate objects, create portals, and solve increasingly difficult puzzles.

🔵🟠 Portal Mechanics

Create interconnected portals to teleport across rooms, just like in the Portal game. Test your agent's spatial reasoning abilities.

📦 Object Manipulation

Push, pick up, and place weighted companion cubes to solve puzzles. Your agent must learn to interact with its environment.

🎮 6 Progressive Levels

From simple tutorials to complex multi-step challenges, each level teaches new mechanics and tests different capabilities.

🤖 Python Agent Support

Write your agent in Python using a simple API. Observe the environment and select actions to solve each test chamber.

How to Get Started

1

Create Your Agent

Write a Python file named agent_demo.py with a function called select_action(observation) that returns the action your agent should take.

# agent_demo.py def select_action(observation): """ Your agent logic here. observation: dict with agent_pose, visible_objects, inventory, etc. Returns: string action like 'move_forward', 'portal_blue', etc. """ visible = observation.get('visible_objects', []) # Example: Press buttons when visible for obj in visible: if obj.get('type') == 'button': return 'interact' # Default: move forward return 'move_forward'
2

Upload Your Agent

Click "Try Our Demo" below, then use the file upload button to select your agent_demo.py file. The Python code editor will open with your code.

3

Run and Observe

Click the "Run Agent" button to start the simulation. Watch your agent navigate the 3D environment in first-person view. Use the statistics panel to track performance.

4

Iterate and Improve

Edit your code directly in the browser, try different levels, and refine your agent's strategy until it can solve all test chambers!

Demo Components Explained

🎬 3D Viewport

First-person view of the test chamber. Watch your agent explore, manipulate objects, and solve puzzles in real-time.

💻 Python Code Editor

Edit your agent's behavior in real-time. The editor appears after you upload your agent_demo.py file.

📊 Statistics Panel

Track episode count, steps taken, and success rate. Monitor how well your agent performs across multiple attempts.

🎮 Control Panel

Run/stop your agent, select different test chambers, and trigger specific actions manually for testing.

📝 Console Log

Real-time feedback about what's happening in the simulation, including successes, failures, and debug information.

Available Agent Actions

Your agent can perform the following actions by returning these strings from select_action():

move_forward
Move in the direction the agent is facing
move_backward
Move backward from current facing direction
turn_left
Rotate counter-clockwise
turn_right
Rotate clockwise
push
Push an object in front of the agent
pick_up
Pick up a nearby object
place
Place carried object on the ground
portal_blue
Shoot blue portal on wall ahead
portal_orange
Shoot orange portal on wall ahead
use_portal
Teleport through nearby portal

Test Chambers & Success Criteria

Level 1: Tutorial

Goal: Learn basic movement by reaching the exit door.

Success: Agent reaches the open exit door (green glow) at the east wall.

Level 2: The Button

Goal: Approach and interact with a wall-mounted button to open the exit door.

Success: Press the red button, door opens, then reach the exit.

Level 3: Weighted Cube

Goal: Push a weighted companion cube onto a pressure plate.

Success: Cube is positioned on the pressure plate (turns green), door opens, reach exit.

Level 4: Cube Carrier

Goal: Pick up a cube and place it on an elevated pressure plate.

Success: Pick up cube, navigate to platform, place cube on elevated pressure plate, reach exit.

Level 5: Portal Introduction

Goal: Use portals to cross a gap and reach the far side of the room.

Success: Create blue and orange portals on opposite walls, use them to teleport across, reach exit.

Level 6: Advanced Test

Goal: Combine portals and object manipulation - retrieve a cube from behind a barrier using portals, then bring it to a pressure plate.

Success: Use portals to access blocked area, retrieve cube, bring it back through portals, place on pressure plate, reach exit.

🚀 Try Our Demo