Skip to main content
Under Active Development

Allegory.js
Allegory.js

A Web-Native Interactive Fiction Engine

Bridge the gap between parser-based narratives and systemic game design. Write living simulations with natural language, managed by a modern ECS, directly in the browser.

Questions? Reach out at hello@allegoryjs.com

How It Works

Allegory.js reimagines interactive fiction by treating stories as living simulations rather than branching trees.

Simulation-First

World state is managed by a physics/logic simulation, not a narrative tree. Every object, character, and rule exists in a living, reactive world.

Event-Driven

No 60fps game loop. The engine idles until a user input or system event occurs, making it perfect for narrative-focused experiences.

Web-Native

Built on standard TypeScript/ESM. Leverage the browser ecosystem—CSS, WebGL, Web Audio—without proprietary compilers or tools.

Under the Hood

ECS Data Model

Entities, Components, and Systems treat your world as a relational database.

Semantic NLP

Intent classification via embeddings, not rigid string parsing.

Laws & Middleware

Decoupled logic with automatic specificity scoring and conflict resolution.

Reactive Event Bus

NPCs and systems respond to world changes, enabling emergent behavior.

example.js
// "Open box", "Lift lid", or "Check chest" all map to this handler automatically:
ThereIsAContainer('chest')
    .withCapacity(10)
    .containing('golden-key')
    .onIntent('OPEN', ({ entity }) => {
        if (entity.isLocked) {
            return Failure("The chest is locked tight.");
        }
        return Success("The lid creaks open, revealing treasures within.");
    });
Blog

From the Blog

Thoughts on interactive fiction, engine architecture, and the craft of game development.

How to Build a Cyberpunk Saloon Without Losing Your Mind

There's one thing most game devs can agree on: **making a game is really damn hard**. It's difficult enough to come up with a cohesive idea for a game; having to translate your vision into engine API…

Read more
Roadmap

Development Roadmap

Track our progress from kernel to launch — pulled live from the GitHub repository.

allegoryjs/allegoryjs — README.md
Active Development

Recent Activity

Follow along as we build Allegory.js in the open.

allegoryjs/allegoryjs

Stay up to date

Get occasional updates on Allegory.js development, new features, and insights into building interactive fiction for the web.

No spam, ever. Unsubscribe anytime.

Prefer direct contact? Email us at hello@allegoryjs.com