What is Ktory
Positioning and core philosophy of the Ktory narrative script system
Ktory is an authoring and integration system for dialogue-driven games. A Ktory script is like a scene in a play: it unifies text, dialogue sequence, choices, and branching, annotated with cues for music and visual performance. Meanwhile, the game engine acts as the stage director—responsible for concrete presentation, world state, and the evaluation of real in-game events.
The current contract uses one Main and automatic auxiliary playheads. Main owns input and auxiliary creation, stopping and awaiting. Auxiliaries follow Core control flow and at gates without waiting for typing or display lifetime. There is no implicit join, and execution completion is separate from display. Built-ins use named arguments; clocks are global named instances or local anonymous defaults. Primary/secondary language rules remain unchanged. Implementation was authorized on 2026-10-22 and validation is in progress; deployed sites and packages are separate. See the design principles.
Compared to traditional scripting solutions, Ktory is better suited for developing games with rich and complex narratives.
Organize Content Like a Play
Section titled “Organize Content Like a Play”@defaultLang: en@speaker alice: en="Alice" | zh="爱丽丝"
alice: @en: The wind feels different today. @zh: 今天的风,似乎有点不同寻常。 .expression(pensive)
#.sfx("wind.ogg").wait(seconds=1).next()
#choice.loop * [Depart] alice: Let's go. -> break + [Look around] : Leaves swirl outside the window.Dialogue and narration form beats, with decorators attached to them. A beat is a logical output or stopping boundary, advanced through input or an automatic policy; it need not require user interaction. In multi-track execution, a beat belongs to its playhead.
One Core, Countless Hosts
Section titled “One Core, Countless Hosts”Ktory uses C# as its parsing and runtime core, yet it can be used across environments of all sizes. From complex, feature-rich engines like Unity and Godot, to lightweight and flexible contexts like web browsers and VS Code extensions—even the command line can read and run Ktory scripts.
The C# core manages branching, calls, loops, session history, and explicitly declared logical clocks. The host environment manages presentation, resources, actual time sources, player input, and game state.
Ktory is still in early development. Currently, Ktory supports the following platforms:
- Unity: Use “Install Package from git URL” and enter
https://github.com/Kutinana/Ktory.git#upm. - VS Code: VS Code Extension.
- Web: Web Reader.
A portable core does not imply that ready-made adapters have been delivered for every engine. Support for additional platforms is under active development.
