Architecture
Crime Engine was extracted from a finished game rather than written from nothing, and that decision shapes everything on this page. A Detective Story was built against abstractions from the start, so the mechanics were already separable from the case; what held them together was a handful of hardcoded asset URIs, not a structural dependency. This page records the split and why it was made.
1. The split
Engine packages:
| Package | Contents |
|---|---|
Divooka.GameDev.CrimeEngine |
the case model: locations and travel, interrogation and question budgets, evidence and discovery, verdicts and endings, the knowledge and retrieval contracts, the project format |
Divooka.GameDev.CrimeEngine.Services |
the LLM-backed runtime: dialogue turns, retrieval, character actions and tool use |
Divooka.GameDev.CrimeEngine.ShadowGUI |
the playable front-end on ShadowGUI, taking a project rather than a compiled content pack |
Divooka.GameDev.CrimeEngine.Audio |
music and sound playback |
Divooka.GameDev.CrimeEngine.Nodes |
the Divooka nodes: open, describe, check, publish, play and capture a case |
The editor (in development): an Avalonia application, fully procedural with no XAML and no data binding, working on a project folder rather than a database, and hosting the runtime so a project can be play-tested without leaving the editor.
The game, staying in its own repository: the Case 1 content pack, Baytown's world data, the art, the content pipelines and the game's own documentation. It references the engine packages instead of carrying the mechanics. See A Detective Story.
2. Why the playable runtime is engine, not game
This is the one division that is not obvious, so it is worth stating plainly: the editor has to play-test any project, which means the playable front-end cannot belong to one game. If the runtime lived in A Detective Story, a second case could be authored but not played without someone writing a second front-end for it.
Putting it in the engine inverts the economics. A new project gets a map screen, a conversation screen, an evidence board, a clock, a save system and a court for free; what it supplies is content. That is also the test of whether the extraction worked — the runtime has to be parameterised by the project to the point where the game it was written for is just one project among others.
3. Layers
| Layer | What it is |
|---|---|
| A project | a folder of authored content: the case, characters, locations, evidence, knowledge |
| The editor | Avalonia, procedural, project-based; hosts the runtime for play-testing (in development) |
…CrimeEngine.ShadowGUI |
the playable front-end on ShadowGUI: map, conversation, evidence, clock, court |
…CrimeEngine.Services |
dialogue turns, retrieval, prompt assembly, character actions |
…CrimeEngine |
the case model, and the knowledge and retrieval contracts |
Divooka.LLM.Abstractions |
ICompletionProvider and IEmbeddingProvider, which the engine is written against |
The core knows nothing about any particular model, only about those two interfaces, which is why one case can be driven by a local GGUF model, by a scripted model in tests, or by anything else satisfying the contract. ICompletionProvider carries a CompleteAsync over a CompletionRequest; IEmbeddingProvider carries EmbedAsync and an AlgorithmIdentifier rather than a model name, because changing the algorithm changes the meaning of every stored vector. See The model runtime and Testing a case.
4. Novella is the precedent for the Divooka layer, not a base
Novella is a visual novel framework for Divooka: a toolbox, and an editor plugin that previews a node's result as a game. It is not a base for Crime Engine, whose runtime is a standalone application with its own editor.
It is the model for the Divooka-facing layer, though. A Divooka package splits its registration in two: a package plugin registers the toolbox, and an editor plugin carries the canvas previews and the game-window launch. The two halves have different lifetimes — the package is alive because a document references it, the editor half because a preview surface is running. Crime Engine's nodes follow that shape.
5. Decisions made
- Core and services moved first, because they were clean; the runtime followed once a project could name its pictures by paths relative to its own folder.
- The project file format is a folder, so that a project is diffable and an editor can be a file editor rather than a database. See Cases and projects.
- The Divooka-facing layer works on whole cases: a graph opens, checks, publishes, plays and captures a case; it does not build one node by node.
See also
- Concepts: the case model in detail