GuideCodex + ModRetro Chromatic pluginBeginnerAbout 25 min7 steps
Build a Game Boy Color game with a single prompt in Codex
This guide is for beginner developers and creators who want to build a Game Boy Color game from one prompt in Codex. You end with a playable game in the Codex preview, and optionally on a Chromatic.
CodingFor developers, creators
Before you start
- Use the ChatGPT desktop app, with Codex available in the ChatGPT dropdown.
- Have a local project folder ready to work in.
- Optional, to play on hardware: a ModRetro Chromatic, a compatible rewritable homebrew cartridge and a USB data cable.
- Optional: GB Studio, if you want to edit scenes, actors and events visually.
In the ChatGPT desktop app, select Codex from the ChatGPT dropdown. Open Plugins and search for ModRetro Chromatic. Select ModRetro Chromatic Plugin by ModRetro, then click Install.
Open a local project folder and start a chat. Type @ and choose the plugin so Codex knows which tools to use. Then ask Codex to set up the plugin and check for any missing build tools.
Paste into Codex Set up the ModRetro Chromatic plugin and check for any missing build tools.With the plugin selected in your chat, describe the game you want. To follow along with the video, use the example prompt. Then ask Codex to build the game and open the preview. You can also ask it to point you to the files in your GB Studio project folder.
Paste the example prompt Build a top-down adventure game called Lodge Podge where a pixel beaver must chew down small trees to gather sticks to build a lodge in the center of the level.Ask Codex to open the game preview in its built-in browser. Use the arrow keys for the D-pad, Z for A, X for B and Enter for Start. Use the toolbar above the emulator to pause or resume. Play a few rounds, then tell Codex what would make the game more fun.
Choose Annotate game in the preview toolbar, then click the game display to freeze a frame. Select the sprite, tile or area you want to change and describe the edit. Choose Resume game to return to the emulator. After Codex makes the change, ask it to rebuild the ROM and reopen the preview.
Open your project's .gbsproj file in GB Studio and choose Game World. Select a scene in the navigator to see its properties in the sidebar. Drag an actor to a new tile or edit collisions on the scene, then save. Return to your Codex chat and ask it to rebuild and open the preview. Sprite sheets, backgrounds and audio are in the assets/ folder, and you can run the compiled .gbc file in an emulator or install it on a cartridge.
Follow ModRetro's quickstart to update the firmware and activate Developer Mode, using the computer you will connect to the handheld. Insert the cartridge, connect the Chromatic and open the game preview in your local Codex chat. Choose Install on Chromatic, select your device and click Install. Read the confirmation carefully, choose Confirm Install when ready, and leave the cable connected until the plugin reports success. Then start the game on the Chromatic.
It worked if: The plugin reports success, and then the game starts on the Chromatic.
Watch out for
- Writing the new ROM erases the game on that cartridge and can erase its saves. The installer does not back up the cartridge.
- Keep the USB cable connected until the plugin reports success.
- Do the firmware update and Developer Mode on the same computer you will connect to the Chromatic.
- For an assembly project, build the ROM with a separately installed toolchain such as RGBDS. Then give the .gb or .gbc file to the plugin to inspect and playtest.
Questions
- Do I need a Chromatic to try this?
- No. You can build and play your first game on your computer in the Codex preview. You only need the Chromatic, a rewritable homebrew cartridge and a USB data cable to deploy to the device.
- Can I animate characters or change the map with Codex?
- Yes. Ask Codex to create a sprite sheet and show the frames side by side, or to show a scene's background and collision map side by side. The collision map marks which tiles block movement, so tell Codex which tiles to mark as blocked or walkable.
- Can Codex test the game for me?
- Yes. Ask it to run the ROM, send a sequence of button presses and capture a frame after each step, shown side by side.
- What if GB Studio's built-in events don't cover my mechanic?
- Add a custom event in GBVM, GB Studio's virtual-machine language, or extend the engine in C. You can also write standalone C with GBDK-2020, compiled with GBDK's lcc, or have Codex write your own engine.