
I built an XR proof of concept that combines AI-generated puzzles with an interactive augmented reality experience. Using 8th Wall, I created a game where players navigate a hidden path as a robot, discovering the correct way to reach a flag. To generate unique puzzles dynamically, I experimented with DeepSeek, a Chain of Thought AI model, which played the role of a game master designing fresh maze layouts.
In this post, I'll walk through the key elements of the project, from leveraging 8th Wall’s AR capabilities to integrating DeepSeek for AI-generated mazes.
Game Concept
The game starts with the player spawning as a robot in an augmented reality scene. The objective is simple: navigate a hidden path through a maze to reach a flag. However, there's a twist:
- The tile the player stands on is fully visible, while adjacent tiles are transparent.
- The rest of the maze remains hidden, making it a discovery-based puzzle.
- A nav mesh ensures the player can only move along valid paths.
- Upon reaching the flag, the robot plays a wave animation as a success indicator.
Using 8th Wall for the XR Environment
8th Wall was a perfect choice for this proof of concept since it allows for WebAR experiences with easy deployment. For this proof of concept I borrowed similar mechanics from a previous game developed on 8th Wall.
Generating Dynamic Mazes with DeepSeek
The heart of this project was exploring DeepSeek's ability to generate unique, playable mazes dynamically. Instead of predefining levels, I wanted an AI model to create solvable mazes on the fly.

System Prompt for DeepSeek
To achieve this, I crafted a structured system prompt for DeepSeek, ensuring it followed specific rules for maze generation:
System: You're a game master.
Can you create a unique maze?
Return a 10 x 10 array where:
- Start point is "S" (always at the bottom).
- End point is "E" (always at the top).
- "X" represents walkable paths.
- "0" represents non-walkable tiles.
- Paths cannot be diagonal.
- "S" and "E" must have at least one adjacent "X".
- Every "X" must have exactly one adjacent path
(X, S, or E) ensuring a complete, solvable maze.
- Return the maze as a JSON code block.
The result
[
[”0”, “0”, “0”, “0”, “0”, “0”, “E”, “X”, “X”, “0”],
[”0”, “X”, “0”, “0”, “X”, “0”, “0”, “0”, “X”, “X”],
[”0”, “X”, “0”, “0”, “X”, “X”, “0”, “0”, “0”, “X”],
[”0”, “X”, “0”, “0”, “0”, “0”, “0”, “0”, “X”, “X”],
[”0”, “X”, “X”, “X”, “X”, “X”, “X”, “0”, “X”, “0”],
[”0”, “0”, “0”, “X”, “0”, “0”, “X”, “0”, “X”, “0”],
[”0”, “0”, “0”, “X”, “0”, “0”, “X”, “X”, “X”, “0”],
[”0”, “0”, “X”, “X”, “X”, “X”, “0”, “0”, “0”, “0”],
[”0”, “X”, “X”, “0”, “0”, “X”, “0”, “0”, “0”, “0”],
[”0”, “S”, “0”, “0”, “0”, “0”, “0”, “0”, “0”, “0”]
]
This structure ensured the AI generated fully connected and valid paths. Additional options allowed users to request variations such as difficulty adjustments, dead ends, or custom sizes.
Backend Integration with DeepSeek (via Replicate)
I handled the AI integration through a backend script that:
- Hides my API token and system prompt for security.
- Processes user requests (e.g., difficulty adjustments).
- Sends a POST request to DeepSeek (Replicate) to generate a new maze.
- Streams the response using Server-Sent Events (SSE) to keep the user engaged while waiting for the puzzle to load.
The AI-generated maze was then used to dynamically place GLTF models and update the nav mesh accordingly.

Challenges and Learnings
- Prompt Engineering Was Key Initially. DeepSeek made many errors in maze generation, such as disjointed paths or unwalkable routes. It took multiple iterations of prompt fine-tuning to ensure it consistently generated valid mazes.
- AI isn't the Most Efficient Approach. While using DeepSeek was fun, procedural generation with traditional algorithms might be a more elegant solution for structured puzzles. However, the ability to "talk" to an AI and get a unique, custom puzzle felt like a powerful concept.
- User Experience Matters. Since DeepSeek takes time to generate a response, using SSE to stream updates was crucial to preventing users from thinking the app was stuck.
Conclusion
This experiment successfully combined XR, AI, and procedural puzzle generation into a dynamic, interactive experience. The proof of concept borrowed elements from my previous game, Time Jump, but explored a fresh take on AI-assisted level design.
Would I use DeepSeek for final production? Maybe not for efficiency, but definitely for its flexibility in generating tailor-made puzzles. The idea of AI as a game master that can dynamically create new challenges is something I'd love to explore further in future projects.
If you're working on an XR project or experimenting with AI-generated content, I'd love to hear your thoughts. What do you think about AI-driven puzzle design? Let's discuss!
← Back to Home