TextNovelEngine is a Java desktop engine for building and playing text-based visual novels.
The project has moved past the early prototype phase and is now close to its first complete usable version. The current engine already supports external story loading, hierarchical story flow, branching choices, action-based jumps, a custom Swing reader window, and a stable gameplay/menu loop. The main missing gameplay feature is persistent save/load.
- Project renamed from
Visual Novel EnginetoTextNovelEngine - Core architecture is already in place and playable
- Stories are now loaded from external
.javafiles outside the source tree - The engine is designed as a reusable runtime, not as a single bundled demo story
- Save and load buttons exist in the UI, but their implementation is still pending
- Hierarchical story model:
Story -> Day -> Section -> Scene -> Block - Supported block types:
Narrative,Dialogue,Monologue,Choice,Action - Branching choices through
Option - Scene jumps by
sceneId - Structured jumps to day, section, scene or block through
JumpandJumpTarget - External story discovery, runtime compilation and loading
- Main menu with story selection
- Settings and creator screens managed by the engine state machine
- Toolbar-based desktop UI built with Swing
- Typewriter-style text rendering and controlled input flow
src/main/java/engine/core
Core runtime, state flow and progress-related classes.
src/main/java/engine/story/model
Story hierarchy: Story, Day, Section, Scene.
src/main/java/engine/story/blocks
Playable content blocks and branching primitives.
src/main/java/engine/story/controller
Navigation and active story position management.
src/main/java/engine/story/external
Discovery, compilation and loading of external stories.
src/main/java/engine/story/jump
Helpers for structured navigation across the story hierarchy.
src/main/java/engine/ui
Custom console-style Swing window and rendering support.
The engine scans the user's documents directory and looks for external story source files in:
~/Documents/TextNovelEngine/stories- or
~/Dokumenty/TextNovelEngine/storieson systems that use the localized Polish folder
Each playable story should be a .java file that exposes:
createStory()- optionally
getStartScene()orgetStartSceneId()
At startup, the engine:
- finds
.javastory files in the stories directory, - compiles them,
- loads the selected story class dynamically,
- creates a
Storyinstance, - starts from the declared start scene or from the default beginning.
import engine.story.blocks.Dialogue;
import engine.story.blocks.Narrative;
import engine.story.model.Day;
import engine.story.model.Scene;
import engine.story.model.Section;
import engine.story.model.Story;
public class HelloStory {
public static Story createStory() {
Story story = new Story();
Day day = new Day(0);
Section section = new Section(0);
Scene intro = new Scene(
"intro",
new Narrative("A cold wind moves through the empty street."),
new Dialogue("Narrator", "Welcome to TextNovelEngine.")
);
section.addScene(intro);
day.addSection(section);
story.addDay(day);
return story;
}
public static String getStartScene() {
return "intro";
}
}TextNovelEngine is being built as a clean and expandable base for interactive storytelling in Java. The current direction focuses on:
- keeping story authoring code straightforward,
- separating engine runtime from story content,
- supporting branching narrative flow without overcomplicating the API,
- preparing the codebase for save/load and richer game state in the next iteration.
Maciej Serafin
Computer Science student at PJATK Gdansk.
This project is open-source and currently shared for educational, creative and experimental purposes.