Portal rebuild deck
HARD
The oblique near-plane clip is a published matrix edit that will still cost you a day, and then you discover that authoring a chamber whose solution is visible from the doorway and still not obvious is a completely different job.
You will get the loop working. Then the real work starts.
The oblique near plane is the day you lose. Everything looks correct until you approach at an angle and catch a sliver of the back of the exit wall, and the fix is a projection matrix edit no agent writes unprompted — ask for a debug view that draws the virtual camera and its clip plane. Beyond that the chamber comes together fast, and then you find that designing a puzzle whose solution is visible from the doorway and still not obvious is a completely different skill from writing the renderer. Nineteen of those, in the right order, is what Valve actually shipped.
- Difficulty
- HARD · 3 of 5
- First playable
- A weekend
- The original
- 20 team-years
- Released
- 2007 · PC
- Genre
- First-Person Puzzle
Build one first-person portal test chamber. three.js, one room, two portal surfaces. Do not attempt the campaign. Requirements: - The virtual camera is the load-bearing detail. To render the view through portal A, place a camera at destB * yaw180 * inverse(srcA) * playerCamera, render it to a texture, and set that camera's near plane oblique to the plane of portal B so nothing between B and the virtual camera is drawn. Get the oblique near plane wrong and you see the back of the wall the exit portal sits in. Cap recursion at two levels and fill the deepest layer with flat colour. - Compute that transform once and use the same matrix for rendering, teleporting and velocity. Two implementations drift and the seam pops. - Teleport when the player's centre crosses the portal plane, transforming position, orientation and velocity together. While overlapping a portal, disable collision with the wall it sits in, or you walk into the surface you are passing through. - Portal placement by raycast onto surfaces flagged portalable, with a validity check for fit and overlap. - A carryable cube, a pressure plate, a door, and a field that deletes portals and cubes on contact. - The room needs a drop of at least eight metres, because speed carried through a floor portal and out of a wall portal is the only interesting thing portals do. Definition of done: I fall through a floor portal, exit a wall portal at the speed I entered, and land on a ledge I cannot reach by jumping.
- Nineteen test chambers ordered so precisely that they teach a mechanic nobody had ever played, without a single line of tutorial text
- GLaDOS — the writing and the performance, which is what anyone who played it actually remembers
- Years of Source physics behind held objects, ragdolls and the fizzler, all of it already hardened before Portal borrowed it
- The turn where the chambers stop and the game becomes a different game, which is a structural trick you only get to play once
Momentum through a seam — one change-of-basis matrix transforms position and velocity together, so you come out going the right way at the right speed.
Any teleport, wormhole, wrap-around edge or mirror needs this, and they all break identically: the position gets transformed and the velocity gets copied. Do it properly once and it generalises to every seam you will ever write.
ScopeAn evening— build just this, not the game
Build a 2D momentum-through-a-portal toy as a single self-contained HTML file, Canvas 2D, no build step. Requirements: - Two portals, each a line segment at an arbitrary angle, drawn with its normal. - A ball under gravity, bouncing off walls with restitution. - When the ball crosses a portal segment, transform it through a change of basis: express position and velocity in the entry portal's local frame of tangent and normal, rotate 180 degrees about the normal, then re-express in the exit portal's frame. One matrix, applied to both. Do not special-case axis-aligned portals. - Drag either portal endpoint to change its angle live. - Draw a faint ghost of the ball at its transformed position whenever it is within one radius of a portal, so the transit reads as continuous. - Print entry and exit speed on each transit; they must match. Definition of done: a ball entering a floor portal at 45 degrees leaves an angled wall portal at the mirrored angle with the same speed, and it still holds after I drag them to new angles.
Not a clone — Portal re-themed and cut down to something you can finish. The angle is the important reel: it is what turns a project into a weekend. 24,360 ways to land.
Verdant One Room
Portal, but one level, done properly, set in a solarpunk city. Rendered in modern low-poly diorama.
Build a browser game called "Verdant One Room". The pitch in one line: a first-person puzzle in the spirit of Portal, but one level, done properly, set in a solarpunk city. WHAT THIS IS Take the SHAPE of Portal — its core loop, and whatever makes that loop good — and rebuild it as your own game in a different world at a smaller scope. Use your own names, art and audio, which you want anyway: a reskin of somebody else's game is less interesting than a new one that works the same way. THE ANGLE — this is the important constraint, honour it above everything else One level, done properly. A single space, built to a finish quality you could not sustain across twenty. Every prop and every sightline is deliberate. This is what makes the project finishable. If a decision would push the scope back towards the original's, take the smaller option every time. THE THEME A solarpunk city. Abundance rather than scarcity, and conflict that comes from competing goods rather than from enemies. The theme is not a coat of paint. Let it change what the mechanics mean — a reload, a health pack and a locked door should all be things that make sense in this world and nowhere else. LOOK Modern low-poly diorama. Facetted meshes, baked AO, miniature tilt-shift feel, and a colour script of 5–6 base hues max. REQUIREMENTS - Runs in a browser with no build step. Canvas 2D unless the angle genuinely requires 3D, in which case three.js. - Fixed-timestep update loop with interpolated rendering, so it behaves the same at 60Hz and 144Hz. - Every tuning constant in one CONFIG object at the top, exposed as live sliders in a debug panel. You will find the feel by dragging those, not by prompting. - All content — levels, entities, balance numbers — in JSON or plain data files, never inline in the logic. - Audio generated with the Web Audio API rather than asset files. - Respect prefers-reduced-motion: keep the fades, drop the shake and the parallax. BUILD ORDER 1. The core loop with placeholder rectangles, at the reduced scope the angle demands. No theme, no art, no audio. Make it fun as rectangles first. 2. The angle's consequences. Cutting to bots, or to turn-based, or to one level changes the design rather than just shrinking it — find out how and rewrite step 1. 3. The theme, as content and data. 4. The look, applied last as a rendering layer over a game that already works. Start by writing a one-page plan: the core loop, what the angle removes and what that frees you to do properly, and what you are deliberately leaving out. Wait for me to approve it before writing code.
- Eric Lengyel on oblique near-plane clipping — the exact projection matrix edit this needs
- three.js — render targets and stencil work for the portal views
Half the time one of these already does what you wanted, and the other half it saves you a week of solving a problem someone documented in 1997.
One count per game. No account — it is tied to a salted hash of your IP, which is not stored in a form anyone can reverse. Every build adds 20 team-years to the counter on the homepage.
Then try these
Questions
How hard is Portal to rebuild with an AI agent?
Yes — every game is buildable at some scope. The question is how hard, and Portal is HARD (3 of 5). You will get the loop working. Then the real work starts. The oblique near-plane clip is a published matrix edit that will still cost you a day, and then you discover that authoring a chamber whose solution is visible from the doorway and still not obvious is a completely different job. Reckon on a weekend to something you can actually play — not to something that matches the 20 team-years Valve spent.
What makes Portal hard to rebuild?
The oblique near-plane clip is a published matrix edit that will still cost you a day, and then you discover that authoring a chamber whose solution is visible from the doorway and still not obvious is a completely different job. That is why it sits at HARD rather than a tier either side of it. If you want the idea without the project, the transferable part is momentum through a seam — one change-of-basis matrix transforms position and velocity together, so you come out going the right way at the right speed. — an evening of work.
How long does it take to build a Portal clone?
Wrong question, and it is worth saying why. Nobody rebuilds Portal — the original took Valve on the order of 20 team-years, released in 2007 on PC. What you can do is reach something playable and genuinely yours in about a weekend, and then keep going for as long as it stays interesting. Any figure that claims otherwise is measuring a prototype and calling it a game.
What do I lose by building my own Portal?
Nineteen test chambers ordered so precisely that they teach a mechanic nobody had ever played, without a single line of tutorial text. GLaDOS — the writing and the performance, which is what anyone who played it actually remembers. Years of Source physics behind held objects, ragdolls and the fizzler, all of it already hardened before Portal borrowed it. Those are the parts a prompt will not hand you.
Which AI coding agent should I use to build it?
Any of Claude Code, Codex or Cursor will handle this prompt. Paste it as your first message, let the agent scaffold the project, then iterate on feel — the second, third and tenth prompts are where a game actually gets good. Work in an empty folder or a fresh git branch so you can throw it away cheaply.
One email when new games go on the list. No other reason to email you, ever.