Hook Horizon is a fishing-line platformer I built in four days for the 2026 Epic AI MegaJam. The same game runs in a web browser and in Unreal Engine 5.8, and neither one is a port. Both run the same TypeScript.
I wrote it with Claude Opus, working in Claude Code. In those four days it came to 243 commits, about 83,000 lines of TypeScript and a small C++ shell inside Unreal. This post covers how the code is laid out, how TypeScript ends up running inside Unreal, the multiplayer server behind story co-op, Hook Brawl and Party, and how working with an AI pair changed what fits into a jam.
π Play it in your browser: hookhorizon.app
β Rate the jam entry: itch.io/jam/2026-epic-ai-megajam/rate/5377909
The jam
The Epic AI MegaJam is Epic Games' game jam built around making games with AI tools. The theme and the deadline force you to decide fast, so I set two goals:
- Make a game that's fun with friends on a couch, not just a tech demo.
- Prove that one codebase can target both the open web and Unreal Engine, without writing the game twice.
The game
You play Bobber, a little fishing float carrying the last spark of the Horizon Lighthouse. A storm put the lighthouse out and the stars fell into the sea. The ghost of the lighthouse keeper guides you as you try to bring the light back.
The core verb is casting. You cast at anything on the horizon and reel it in through the depth layers into your play plane:
- Light things become platforms. Reel in a crate, a kite or a lantern, and you can stand on it.
- Heavy things reel you instead. A "Big Pull" can drag you across the sea to an island on the horizon.
From that one mechanic came:
- A campaign: 7 island zones on a world map, 21 levels and 7 bosses. Each boss teaches a new ability: Swing, Long Cast, Double Line, Power Reel and a spore-kite glide.
- Story co-op for 1β4 players, local or online. AI partners fill empty seats.
- Hook Brawl, a versus mode for 2β4 players.
- Party, a board game across the islands with minigames between turns.
- Pool Party, a laid-back lagoon where everyone fishes, collects things and shows off hats while a DJ plays.
- Phones as controllers: scan a QR code and your phone becomes the gamepad.
- An AI hat wardrobe: describe a hat on your phone, an LLM designs it and you wear it in the game.
That's a lot for four days. Most of this post is about how the architecture made it possible.
The architecture: the game doesn't know which engine it's in
The most important decision was the one I made first. Gameplay code never touches an engine.
src/core/ engine-agnostic gameplay: sim, controller, levels, campaign,
AI, versus, party, fishing, story, net, cosmetics
src/scene/ one engine-neutral scene graph
src/platform/web/ three.js renderer, DOM input/UI, WebAudio (built with Vite)
unreal/ts/ the Unreal platform layer, running in PuerTS
unreal/HookHorizon the UE 5.8 C++ shell (~2.4k lines)
src/core is pure simulation: physics, the fishing line, level logic, the campaign, the versus rules, the party board and the AI. It has no imports from three.js or Unreal. That also makes it testable and lets it run headless, which matters later for multiplayer.
src/scene is the scene graph. It uses three.js objects but only as plain data: positions, meshes, materials and hierarchy. Nothing in it draws anything.
A platform only has to implement two interfaces, SceneServices and SceneInput. Everything else is shared.
The web build
The web platform is the simple one. three.js renders the scene graph directly, DOM events become SceneInput, WebAudio plays sounds and Vite bundles it. This is where most iteration happened, because a browser reload takes seconds.
The Unreal build: TypeScript inside UE 5.8
This is where it gets interesting. Unreal runs the game through PuerTS, a plugin that embeds V8 and lets TypeScript call Unreal's APIs.
esbuild bundles src/core, src/scene and unreal/ts into one HorizonMain.js in the Unreal project's Content/JavaScript folder. The C++ side is deliberately small, about 2,400 lines. It holds a mesh actor, a networking bridge, an updater and a canvas.
The key piece is the scene mirror (unreal/ts/mirror.ts). Every frame it walks the shared scene graph and keeps Unreal in sync:
- One Unreal actor per drawable in the scene graph.
-
Geometry is uploaded once to a
ProceduralMeshComponent, then just transformed. -
Materials are mapped onto one master material (
M_HH) as parameters, so there are no per-object material assets to hand-author. -
Coordinates are converted from three.js's Y-up meters to Unreal's Z-up centimeters:
(x, y, z) β (βz, x, y) Γ 100.
Because the mirror is generic, a new enemy, level prop or boss works in Unreal as soon as it works in the browser. I never wrote "the Unreal version" of a feature.
Effects and audio, defined once
Particles and sound use the same trick. Each is defined once, as data:
-
src/scene/particles.tsdescribes every effect. The web draws them as instanced meshes. In Unreal,unreal/ts/fx.tsand a commandlet build real Niagara systems from code. -
src/scene/sounds.tsdescribes every sound. The web plays them through WebAudio. In Unreal,unreal/ts/audio.tsbuilds voices with the MetaSound Builder API.
So the Unreal build gets native Niagara and MetaSounds, and nobody hand-builds an effect in the editor.
Multiplayer: one server, four kinds of room
Every online mode runs on one Colyseus server with four room types: brawl, coop, party and fishing. All of them reuse the same src/core code the clients run. Two players with the same room code always land in the same room, and an empty code drops you into matchmaking.
Inputs are tiny. Every input is a 7-number array: a sequence number, movement, ten button bits and aim. A protocol version check turns away an outdated client with "update required" instead of letting it desync.
Hook Brawl: prediction and reconciliation
The server runs the versus sim headless at 120 Hz and sends exact deltas 20 times a second, each carrying the last input it applied for every player. The client predicts everything: it restores the server snapshot, drops the inputs the server has acknowledged, and re-simulates the rest. Small errors are smoothed out visually; big ones snap. If a player's inputs stall, the server holds their buttons for a quarter of a second before letting go.
Quickplay searches for about 25 seconds, then server-side CPUs fill the empty seats. A human who joins late takes over a CPU's seat mid-match, keeping its score. If you drop out, you have 20 seconds to reconnect before a bot takes your seat.
Story co-op: a single-player sim, made multiplayer
The campaign's LevelSim was written for one player on one machine, not for netcode. Instead of rewriting it, the server runs the real LevelSim with every player in it, and a generic object-graph mirror diffs the whole sim into JSON deltas while keeping shared references intact. Game-feel effects are recorded on the server and replayed on each client, so hits and splashes still feel instant. Each client predicts its own float and eases toward the server's position.
The lobby is the world map itself. Everyone walks their own token, anyone can propose a level, and the crew votes on a ten-second countdown. Players can drop in mid-level, and the team shares hearts and checkpoints.
Party: a board game plus seeded minigames
The server owns the board: turns, rolls, items, and the CPU players that fill empty seats or replace someone who leaves. When a minigame starts, the server picks a random seed and every client builds the same minigame from it. From there it runs on the same predicted, acknowledged-input model as Hook Brawl.
Couch Party: phones with no game code
For Couch Party, the TV opens a private room and shows a QR code. Phones open a small controller page and join that room as pads. They draw nothing and simulate nothing; they just stream inputs. One message moves every phone from Party to Hook Brawl to story co-op, keeping the same room code. Phones get three minutes to reconnect, because screens lock.
Pool Party
The lagoon is lighter. Each player fishes locally, and the server owns the shared vibe: the time of day and the DJ set.
Running it
The server ships as a Docker image and redeploys automatically whenever server code or shared game code changes. Profiles and leaderboards live in Postgres. On a benchmark using a single CPU core, it handled 720 co-op players across 180 rooms.
On the client side, browsers already have WebSocket and fetch. PuerTS inside Unreal doesn't, so a small C++ bridge (HHNet) provides both. With that in place, the same @colyseus/sdk client runs unchanged inside Unreal. There is no second network implementation and no protocol drift between the two builds.
Over-the-air updates for an Unreal game
There's a nice bonus to having the game logic in JavaScript: you can update it without shipping a new binary.
The Unreal build checks an update endpoint for ed25519-signed JS bundles and applies them on the next launch. Only JS and data paks are ever downloaded, never native code. If an update crashes on boot, a guard falls back to the JS that shipped with the build. During a jam, that means a balance tweak or bug fix reaches players in minutes.
Working with Claude Opus
Here's the honest version of what building a game with Claude Opus in Claude Code was like.
The numbers: 243 commits over four days, from the first browser prototype on November 12 to a packaged, signed Unreal build on November 15. That's roughly 83k lines of TypeScript. The busiest day had 126 commits.
What worked:
- Architecture first, then volume. Once the core / scene / platform split was set and the platform contract was two interfaces, Claude could add features at high speed without them leaking into engine code. A clean boundary is what lets an AI move fast without making a mess.
- The browser as the fast loop. Claude built and tuned features in the web build. The Unreal build picked them up through the mirror. Unreal-specific work was limited to the platform layer: Niagara, MetaSounds, networking, packaging and signing.
- Generic over special-case. The scene mirror, the particle and sound definitions, and the modular AI all exist because I kept pushing for one general system instead of ten one-offs. Claude is very good at building the general version when you ask for it.
- One AI brain for every mode. The bots in co-op, versus and party share one modular AI. Behaviors bid on tags, candidate moves are simulated on a clone of the physics body, and a single "smartness" dial sets difficulty.
- The boring parts. Build scripts, packaging, Developer ID signing, notarization, CI on a self-hosted Mac and the OTA publisher are the things that usually eat the last day of a jam. Here they were just more commits.
What still needed a human:
- Taste. What's fun, how a cast should feel, when a level is too long.
- Playtesting on real hardware, especially controllers and phones.
- Deciding what to cut. Four days is still four days.
The AI asset pipeline
The code wasn't the only AI-assisted part:
- Icons: about 80 UI icons, generated with an image model through the Vercel AI Gateway and baked into game-ready sprites by a script.
- Music: generated with ElevenLabs' music model through the same gateway, with every prompt logged, then layered into stems that a small deck player mixes in game.
- Hats: in the Wardrobe, players describe a hat on their phone and Claude returns a structured hat spec through a forced tool call. The game builds the hat from that spec, so every hat is a real in-game object, not a flat image.
A note on the jam build
The jam's web export can't run PuerTS, so the official MegaJam entry is the packaged Unreal build. The browser version at hookhorizon.app runs the same game code, so it's the quickest way to try it.
What's next
More platforms are on the roadmap. The platform contract is small, and the Unreal layer already handles touch input. The shared-core approach means each new target is a platform layer, not a rewrite.
Play it, and rate it
If you made it this far, I'd love for you to try Hook Horizon and rate it for the jam:
- π£ Play in your browser: hookhorizon.app
- β Rate it on itch.io: 2026 Epic AI MegaJam: Hook Horizon
- π° About the jam: unrealengine.com/news/2026-epic-ai-megajam
Questions about the PuerTS setup, the scene mirror, or building with Claude Opus? Ask in the comments. I'm happy to go deeper on any of it.
Top comments (0)