Inspiration
Codexia was inspired by two ideas: the exploration, building, and multiplayer freedom of games like Terraria, and the reality that developers often wait for long-running Codex tasks to finish. We wanted to turn that downtime into playtime by making Codex an intelligent in-game companion inside Codex’s native browser.
What it does
Codexia is a browser-playable multiplayer sandbox where players explore, gather resources, craft equipment, build structures, fight enemies, and persist their world through an authoritative server.
Each player has a Codex companion that can follow them and receive natural-language instructions. Codex converts requests—such as “defend this area,” “collect that resource,” or “help me build”—into validated game actions, while deterministic game AI handles movement, combat, inventory, and task execution.
How we built it
The core game is written in C++20 using Raylib. The same deterministic simulation code compiles natively for the authoritative server and through Emscripten into WebAssembly for the browser client.
Multiplayer uses a dedicated WebSocket server that owns world state, validates player and companion actions, handles persistence, and replicates results to connected clients. JavaScript handles browser startup, networking APIs, deployment configuration, and the player-local Codex bridge.
The companion architecture keeps Codex credentials on the player’s computer. Model responses are converted into narrow, typed intents before entering the authoritative simulation—Codex never directly edits game memory.
Challenges we ran into
Our biggest challenges included:
- Reproducing detailed sandbox behavior and presentation faithfully in a browser.
- Maintaining smooth 60 Hz animation across different refresh rates, resolutions, and window sizes.
- Sharing deterministic simulation behavior between native and WebAssembly builds.
- Combining responsive client prediction with authoritative multiplayer state.
- Designing an AI companion that feels capable without giving a language model unsafe or nondeterministic control.
- Recreating production-ready original artwork while preserving the required silhouettes, animation frames, pivots, and visual roles.
- Testing the complete path from real browser input through WebAssembly, networking, persistence, and rendering.
Accomplishments that we're proud of
We built a working two-player browser sandbox backed by a native authoritative server, including movement, mining, crafting, construction, combat, death and recovery, storage, reconnect handling, and persistent saves.
We are especially proud of the companion boundary: Codex selects understandable typed goals while deterministic game systems execute them safely. Companion actions are permission-checked, budgeted, cancellable, replayable, and able to fall back to offline behavior if the model is unavailable.
We also established a shared native/WebAssembly simulation architecture and a detailed browser testing system covering multiplayer, performance, visual behavior, and multiple resolutions.
What we learned
We learned that an AI game companion works best when the model acts as a planner, not as the game engine. Natural language is excellent for choosing goals, but navigation, combat, inventory, and building need deterministic rules.
We also learned that browser game depends on camera transforms, animation clocks, pixel sampling, layer order, server cadence, and window scaling can all change how the game feels. Reference-first tracing and side-by-side testing saved us from repeatedly treating symptoms instead of underlying systems.
What's next for Codexia
Next, we are completing the remaining visual and behavioral work, polishing player and companion animation, expanding world generation and content, and moving all companion conversation into the in-game chat experience.
After that, we plan to expand the companion’s practical abilities—gathering, crafting, building, defending, explaining the world, and coordinating with players—before completing controller, mobile, audio, voice, and public deployment work.

Log in or sign up for Devpost to join the conversation.