DEV Community

Cover image for I tried writing an interactive novel. I accidentally ended up building a platform.
Santi Santamaría Medel
Santi Santamaría Medel

Posted on

I tried writing an interactive novel. I accidentally ended up building a platform.

A few months ago I tried to write an interactive fiction novel. I accidentally ended up building a platform instead.

I started writing but as the story grew, I quickly realised two things:

  1. First, I’m not a great writer — and even less so when it comes to an interactive novel with all its complexity.

  2. Second, the further I got, the harder it became to manage the structure: branches, conditions, narrative state… everything started getting messy pretty quickly.

The tools I tried didn’t really fit what I had in mind, so at some point I opened Visual Studio and tried to solve the problem myself.

The idea was simple: I wanted to find a way to separate the prose from the logic that drives the story.

That’s when the real experiment started.

Since frontend isn’t really my main area, instead of trying to do everything myself I decided to try something different: building the project with AI agents (Codex) as development partners.

What started as a small experiment quickly got out of hand. I got carried away and ended up building a small platform.

Working with Codex, as an not so small dev team

Working with Codex — and the workflow I gradually developed around it — turned out to be surprisingly effective. Instead of just asking for snippets, I started treating the AI more like a small development team: iterating on architecture, building components, debugging problems together and refining ideas step by step.

This AI-assisted workflow made it possible to move surprisingly fast across several areas at once: coding, UI design and architectural decisions.
It also became a really interesting learning experience about how to work with AI agents: improving context management, performance and model behaviour.

The IEPUB project

The result of that whole process is a small ecosystem called iepub:

  • a structured format for interactive books
  • a reader runtime that interprets that format
  • and a visual editor designed for writing interactive fiction

It had gone completely out of control…

The editor tries to feel like a normal writing tool — something closer to Google Docs — but designed for interactive storytelling. It allows things like:

  • defining narrative condition
  • attaching variables to sections of the story
  • configuring dice rolls or probabilistic events
  • creating narrative variants, based on both, declarative conditions and user behaviour while reading conditions (really cool!)
  • visualising the structure of the story as a graph
  • importing and transforming content from the most extended formats

If anyone is curious about the experiment — both the project itself and the AI-assisted development workflow — you can take a look at the article I published on Medium:

https://medium.com/@santi.santamaria.medel/interactive-fiction-platform-codex-ai-093358665827

And if you just want to explore the project itself, you can do that here:

https://iepub.io

I’d also love to hear how others are using AI in their development workflows, and learn!

The project is alive and keeps evolving, so every feedback will be a good feedback!

Top comments (0)