01Home 02Experience 03Achievements 04Interests 05Bing Beats 06MegaGem Live 07Asset Management ↗
Project 02 — Game · AI · 3D · Feb 2026

MegaGem Live.

An interactive auction-strategy game — one human against two AI bidders — played from a first-person seat inside a neon 3D auction room. Nobody holds full information: read the hidden gem signals, win the auctions that matter, and outscore the AI before the round ends.

Play the live game → Landing page
1 v 2
Human vs AI bidders
30
Gems · 5 types
15
Hidden at round start
200+
Simulated games verified

MegaGem Live began as a flat 2D auction dashboard — a port of Jane Street's board game MegaGems — and grew into a real-time game with AI opponents, an AI coach, and a full first-person 3D room, built from scratch with Python (Flask / Socket.IO) and vanilla JavaScript.

The core tension is hidden information. At the start of a round, half the gems are pulled from play and secretly split between the three players, so everyone holds a piece of the answer. A gem type's final value depends on how many of that type were removed — and the only way to learn more is to win auctions, which forces you to reveal one of your own secrets to the table.

How it plays

// scored once, at end of round gem value = removed_count[type] × 4 final score = coins + investments + bonuses − loans + gem worth

So the game is a constant balancing act: spend coins to win value and gather signals, but overpay early — or leak the wrong secret at the wrong moment — and you hand the round to the AI.

Three ways in

Inside the 3D room

The 3D upgrade was deliberately decoupled from the game so the graphics could be bolted on without touching a line of game logic. Four layers, each with one job — and because the backend broadcasts the exact same events it did for the original 2D dashboard, the whole room is effectively a presentation skin (a Flat 2D mode in settings switches it off entirely).

The Brain

Flask + Socket.IO

Runs all game logic, resolves bids, and broadcasts events. It has no idea the frontend is 3D.

The Stage

Three.js · WebGL

Renders the physical room — desk, lighting, and the spinning gems that mirror the live gem queue.

The Illusionist

CSS3DRenderer

Folds ordinary HTML — the bid form, leaderboard, and auction log — inside the 3D space as interactive panels, not flat textures.

The Messenger

Socket.IO client

The connective tissue: it listens to the Brain, then tells the Stage to animate and the Illusionist to update.

Tech stack

Engineering challenges

Reflection

The most valuable lesson wasn't any single technology — it was the payoff of clean separation of concerns. Because the backend broadcasts game events without caring how they're displayed, I could reimagine the frontend from flat HTML into a WebGL auction room without rewriting the game. That Brain / Stage / Illusionist / Messenger split is the thing I'd carry into every future project.

The bugs taught the rest: in a real-time app, identity has to be durable and the source of truth stable — tying a seat to a socket felt fine until the first refresh proved otherwise. And integrating Gemini was a lesson in designing for failure: build the fallback path first, so the game stays fun whether its opponents come from a language model or a simple heuristic.