Inspiration
RetroGameFriend began with a simple question: what if ordinary ChatGPT users could use their own account and Codex access inside a desktop game, without the developer embedding a shared API key or paying for every player's AI usage?
I wanted to explore Codex App Server not as a developer-facing terminal tool, but as the execution layer behind a conventional game interface. The player should only see a familiar visual novel-style experience: a character, dialogue, quizzes, reactions, relationship growth, and saved progress.
The project also reflects my long-standing interest in retro games, chiptune music, and Japanese retro computers such as the X68000.
What it does
RetroGameFriend is a functional proof of concept for a retro-style AI conversation and quiz game.
The game includes two main modes:
• PLAY mode provides a 65-question retro game quiz that also works offline.. • TALK mode lets the player have free-form conversations with the character through Codex App Server..
The character has a locally defined personality, speaking style, interests, boundaries, and approved topic knowledge. Relationship state, affection, growth progress, conversation history, and game progress are stored locally.
As affection increases, the character's reactions and presentation change. When affection reaches its maximum, an ending event is unlocked in which the player visits a game arcade with the character. The TALK scene music also changes to a NES-style arrangement as the relationship develops.
Pre-produced character voice assets provide immediate reactions while AI-generated dialogue is processed in the background.
How we built it
RetroGameFriend is built as an Electron desktop application using TypeScript, Node.js, HTML, and CSS.
The application is divided into three main layers:
- The Electron renderer provides the visual novel UI, character presentation, dialogue box, quiz interface, and player input..
- The Electron main process manages character data, save data, prompt construction, response validation, and communication with Codex App Server..
- Codex App Server runs locally and communicates with the application through stdio JSON-RPC, using the player's own ChatGPT and Codex account..
The renderer is isolated from Node.js and the local file system using:
• contextIsolation: true.
• nodeIntegration: false.
• sandbox: true.
Character definitions, reaction rules, and approved conversation knowledge are stored in local JSON files. Only short, relevant knowledge is added to each request. When reliable information is unavailable, the game uses prepared fallback responses rather than encouraging the character to invent facts.
The current Build Week release is v0.2.5. It includes a packaged macOS build and has been tested with Codex CLI 0.144.6.
Challenges we ran into
The largest challenge was turning Codex App Server into a dependable runtime behind a normal desktop application.
This required handling:
• browser-based ChatGPT authentication. • Codex CLI discovery. • differences between Terminal and Finder launch environments. • child-process startup and shutdown. • stdio JSON-RPC communication. • response schema validation. • local save data and conversation history. • offline behavior when AI services are unavailable. • packaging and Gatekeeper behavior on macOS.
A particularly difficult issue was that the packaged application did not inherit the same environment variables and executable paths as the development Terminal session. We created a deterministic launcher and diagnostic flow to locate and start the compatible Codex runtime.
Another challenge was balancing free-form AI dialogue with a consistent authored character. The solution was to keep identity, personality, relationship rules, approved facts, and game state under local application control while using Codex to generate contextual dialogue within those boundaries.
Accomplishments that we're proud of
We completed a working end-to-end game rather than only a technical integration demo.
The Build Week version includes:
• free-form AI character conversation. • persistent conversation history. • local affection and relationship growth. • a complete 65-question quiz mode. • offline PLAY mode. • an unlockable ending event. • animated character reactions. • original BGM, sound effects, and character voice assets. • NES-style music changes linked to relationship progress. • a packaged macOS release. • a private GitHub repository with judging access. • validated bilingual documentation in English and Japanese.
We are also proud that the user does not need to interact with a terminal, write prompts, or understand Codex App Server during ordinary gameplay after the required runtime setup and authentication are complete.
What we learned
We learned that Codex App Server can serve as more than a coding assistant backend. It can act as a local AI execution layer behind games and other end-user desktop applications.
We also learned that successful integration requires more than sending text to a model. A usable product needs:
• controlled application state. • structured responses. • validation and fallback behavior. • secure renderer isolation. • authentication lifecycle management. • runtime detection. • clear offline behavior. • human-authored knowledge and boundaries.
The project reinforced the importance of separating AI-generated dialogue from authoritative game state. Codex can propose dialogue and affection changes, but the application remains responsible for validating and applying those results.
What's next for RetroGameFriend
The next major step is Windows support. The Electron application was designed with cross-platform expansion in mind, but Windows testing is still required for Codex CLI and Codex App Server startup, path handling, authentication, and child-process management.
Future plans include:
• Windows implementation and native testing. • speech input. • synthesized and streaming character speech. • synchronization between voice and facial expressions. • multiple characters. • improved conversation knowledge management. • simpler setup for non-technical users.
A broader improvement I would like to see is an official, application-friendly Codex runtime or reusable integration layer. Stable lifecycle management, authentication handling, cross-platform process control, versioned APIs, and an officially supported installation or redistribution path would make it much easier to embed Codex-powered workflows into games and general desktop applications.
RetroGameFriend is a functional proof of concept for that future.
Log in or sign up for Devpost to join the conversation.