A YAML-first 2D RPG, visual novel and strategy game framework for Go with a fast edit–play loop

Gozen is a YAML-first framework for 2D RPGs, visual novels and strategy games in Go and Ebitengine. You, or your coding agent, write the game as YAML: places, battles and skills for an RPG; lines, choices and staging for a novel, with roll back, skip and a second language; regions, generals and orders for a campaign. gozen check, gozen sim battle and gozen sim campaign catch broken references and bad balance before anyone plays. While you play, you leave a note on the exact moment, watch live win rates, and reload the YAML without restarting.

The name: Ebitengine is named after ebiten (海老天), shrimp tempura. In Japan, an ebiten gozen (御膳) is a set meal on one tray: shrimp tempura with soba, small side dishes, and a sweet such as dango. Gozen is that tray for Ebitengine: the engine served with everything a game needs. The name also starts with Go.

RPG: Go ZenNovel: After the Pass
Go Zen, the Gozen sample game: the town map, a dungeon, a battle with a cut-in, and a talkAfter the Pass, the novel sample: a line, a choice, Back over the choice, and Skip to the first line not read
Campaign: Five Banners (play in browser)
Five Banners, the campaign sample: the war map, the sortie screen, a clash of two armies, and the region in the Crown’s colour

Try it in 30 seconds #

With Go 1.26.10 or later, paste this. It needs no display and no assets:

go run github.com/nao1215/gozen/examples/minimal@latest
location=camp gold=2

That game is two YAML files and a 43-line Go host. The sample above is Go Zen, a module of its own. Play it from a clone:

git clone https://github.com/nao1215/gozen
cd gozen/examples/go-zen
go run . --mute

Or play Go Zen and After the Pass in the browser.

On Linux the window needs X11 and OpenGL; see Install.

The loop #

Making a game is mostly tuning: a line that reads wrong, a boss that is too hard, a dungeon that is too long, a war that one side always wins. Gozen shortens each round.

StepWhat you do
WritePut places, battles, skills, enemy tactics, events and dialogue in YAML. Text is easy to write, diff and review, for you and for an agent.
Checkgozen check game reports broken references, wrong expressions, missing pictures and text that overflows its window, with file and line.
Measuregozen sim battle fights a battle hundreds of times and prints the win rate. gozen sim dive plays a whole dungeon dive.
PlayRun the game with --dev: start anywhere, autoplay at high speed, record and replay a trace.
NotePress F9 to save a note with a screenshot and the game state. --from-memo starts the game again at that line.
FixEdit the YAML and press F5. The game reloads its definitions and keeps your place. F7 shows the win rates of the battles here.
data/world.yaml:26:5: locations.grotto.encounters: unknown troop "lessn" [GZN1101]

The rules are shared by the window, a headless driver and the command line, so a test in CI and a player see the same game.

Screens #

All from Go Zen at 1920x1080.

ConversationPainted scene
Maren talks, a moving portrait that blinks and changes its faceMaren walks the plaza and Ox says a line in a balloon
Town mapFirst-person dungeon
the party’s face walks the road to the wellsteps and turns in a brick corridor
BattleCut-in
four against the Brass Warden, with damage numbersOx’s Shield Rush cut-in
ShopSkill tree
the shop’s goodsMaren’s skill tree with Ink Burst chosen
Title
the title screen

Novel games #

ui.message: novel makes a visual novel. All from After the Pass, the novel sample, at 1920x1080 (Novel games).

Roll back (Q, wheel)Skip to the line not read (N)
Back goes over two lines and a choice, with the statethe option taken again, then Skip stops at the first line not read
Two languagesStaging (stand, effect)
the settings switch to Japanese, the line on the screen turns Japanese at once, and so does the nextBrenna slides in and her portrait shakes
Event picture with its line
Brenna’s ending: a picture of her cheering at the bar, with the line under it

Campaigns #

regions, factions and campaign (schema version 5) make a war of regions over turns, with generals, orders and clashes of armies. From Five Banners, the campaign sample.

The war mapA clash of armies
the picture map of the land with the regions in the owners’ colours, the band with the week, the window of a region and the generalstwo armies of soldiers lined up on the terrain, with the leaders’ cards in a row below

Playtesting #

Start the game with --dev and these keys work while you play.

F5: edit the YAML under --dir, the line changes in placeF9: a note with the screen and the state
Hedda’s line is edited in the YAML and F5 shows the new text at the same placeF9 opens a note, a comment is typed and saved
F7: win rates of the battles hereF8 State: flip a flag, step a number
win rates by troopflag.thanked_hedda and chose.toast in the development panel
F8 Flags: what each event sets and readsF8 Scenes: jump to an event
the flags each event sets and readsthe Scenes tab jumps to the late night
F8 Command: run a line of YAMLF8 Frames: ticks and frames a second, the slowest Update and Draw
a set typed into the Command tab, then the State tab shows the flagthe frame meter over the tavern
F6: the character book, every page open: each character’s profile, faces and relations
Wren’s page in the character book: her picture, fields, introduction and how she sees the others

More on each key in the edit–play loop.

Where to go #

Features #

Limitations #

Install #

go install github.com/nao1215/gozen/cmd/gozen@latest

As a library: go get github.com/nao1215/gozen@latest. The install page lists the graphics libraries for each OS.