Skip to content

About

Modular visual novel framework for Unity. C# | Branching dialogue, save/load, localization-ready, designer-friendly editor tooling.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

ย 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ“– NovellaEngine

A Modular Visual Novel Framework for Unity | C# | Branching Narrative & Save Systems

Unity C# Narrative License

A lightweight, extensible framework for building visual novels and interactive storytelling experiences in Unity. Features modular dialogue parsing, save/load serialization, choice-driven branching, and designer-friendly toolingโ€”built for rapid iteration and cross-platform deployment.

Editor Preview


โœจ Core Features

  • ๐Ÿงฉ Modular Dialogue System: YAML/JSON-based script parsing with conditional logic, variables, and tags
  • ๐Ÿ’พ Robust Save/Load: Serializable game state with chapter checkpoints, player choices, and inventory tracking
  • ๐Ÿ”€ Branching Narrative Engine: Graph-friendly structure for non-linear stories; visualizable via custom editor tools
  • ๐ŸŽจ Designer-Friendly Workflow: Custom Unity Editor windows for script editing, character management, and scene linking
  • ๐ŸŒ Localization-Ready: Externalized text tables with runtime language switching (7+ language pattern support)
  • ๐Ÿงช Testable Architecture: Decoupled logic layers enable unit testing for narrative flow and state management

๐Ÿ—๏ธ Technical Architecture

Assets/
โ”œโ”€โ”€ NovellaEngine/
โ”‚   โ”œโ”€โ”€ Core/
โ”‚   โ”‚   โ”œโ”€โ”€ NovelManager.cs        # Main controller: scene flow, state persistence
โ”‚   โ”‚   โ”œโ”€โ”€ DialogueParser.cs      # YAML/JSON parser with conditional evaluation
โ”‚   โ”‚   โ”œโ”€โ”€ SaveSystem.cs          # JSON serialization + checkpoint management
โ”‚   โ”‚   โ””โ”€โ”€ VariableStore.cs       # Runtime variable tracking for branching logic
โ”‚   โ”œโ”€โ”€ Editor/
โ”‚   โ”‚   โ”œโ”€โ”€ ScriptEditorWindow.cs  # In-editor dialogue script editor
โ”‚   โ”‚   โ”œโ”€โ”€ CharacterManager.cs    # Sprite/voice assignment UI
โ”‚   โ”‚   โ””โ”€โ”€ BranchVisualizer.cs    # Optional node-graph preview (WIP)
โ”‚   โ”œโ”€โ”€ UI/
โ”‚   โ”‚   โ”œโ”€โ”€ DialogueBox.cs         # Responsive text display + typewriter effect
โ”‚   โ”‚   โ”œโ”€โ”€ ChoicePanel.cs         # Dynamic button generation for player choices
โ”‚   โ”‚   โ””โ”€โ”€ SaveLoadMenu.cs        # Checkpoint selection UI
โ”‚   โ””โ”€โ”€ Data/
โ”‚       โ”œโ”€โ”€ Scripts/               # Example .novel YAML/JSON files
โ”‚       โ”œโ”€โ”€ Characters/            # ScriptableObject character definitions
โ”‚       โ””โ”€โ”€ Configs/               # Localization tables, theme settings
โ””โ”€โ”€ Tests/
    โ”œโ”€โ”€ DialogueParserTests.cs
    โ””โ”€โ”€ SaveSystemTests.cs

Key Design Patterns

  • Data-Driven Scripting: Story logic lives in external filesโ€”no code recompilation for content updates
  • Event-Driven Flow: DialogueAdvancedEvent, ChoiceSelectedEvent decouple UI, logic, and audio
  • State Isolation: Save data is serializable POCO classes, independent of Unity MonoBehaviour lifecycle
  • Extensibility Hooks: Virtual methods and interfaces allow custom effects, transitions, and integrations

๐Ÿš€ Getting Started

Requirements

  • Unity 2022.3 LTS or newer
  • .NET Standard 2.1 compatibility
  • Basic familiarity with Unity ScriptableObjects and JSON serialization

Setup

  1. Clone this repo into your Unity Projects/ directory
  2. Open the project in Unity Hub โ†’ Editor
  3. Import the NovellaEngine package via Package Manager or drag the folder into Assets/
  4. Open Scenes/DemoScene.unity and press Play to see the framework in action

Quick Start: Writing Your First Scene

# example.novel
scene: intro
background: bg_bedroom
characters:
  - id: protagonist
    name: "You"
    sprite: sprite_hero
  - id: friend
    name: "Alex"
    sprite: sprite_alex

dialogue:
  - character: friend
    text: "Hey! Ready for the adventure?"
    choices:
      - text: "Absolutely!"
        next: scene_adventure_start
        set: { enthusiasm: +1 }
      - text: "Maybe later..."
        next: scene_postpone
        set: { enthusiasm: -1 }
// Load and play in your MonoBehaviour:
var novelManager = FindObjectOfType<NovelManager>();
novelManager.LoadScript("example.novel");
novelManager.StartDialogue();

๐Ÿ’ก Example: Adding a Custom Effect

// Create a new dialogue effect (e.g., screen shake on dramatic lines):
public class ScreenShakeEffect : IDialogueEffect
{
    public void OnLineStart(DialogueLine line, NovelContext context)
    {
        if (line.HasTag("dramatic"))
        {
            Camera.main.GetComponent<CameraShake>().Shake(0.3f, 0.5f);
        }
    }
}

// Register in NovelManager:
novelManager.RegisterEffect("shake", new ScreenShakeEffect());

๐Ÿ™ Acknowledgements

  • Inspired by visual novel engines like Naninovel, Fungus, and Ren'Pyโ€”built with a focus on modularity and C# purity
  • Built for educational and portfolio purposes; not intended for commercial deployment without further testing
  • All original code authored by Nicholas Wilson Kurniawan; design patterns learned from public Unity documentation and community resources

Note: This framework is a learning project. For production use, always validate serialization security, memory management, and platform-specific behavior.


๐Ÿค Contributing

This is a reference implementation and learning tool. Feel free to:

  • ๐Ÿด Fork and extend with your own effects, parsers, or UI themes
  • ๐Ÿ› Report bugs or suggest architecture improvements via Issues
  • ๐Ÿ’ฌ Discuss narrative design patterns or engine extensions in Discussions

For educational use: please credit the original author and link back to this repo.


๐Ÿ“ฌ Connect & Explore More

Portfolio LinkedIn Discord

๐Ÿ“ง nwkemail@gmail.com | ๐ŸŽ“ B.Eng. Computer Science, HKU | ๐ŸŽฎ Gameplay Engineer (UE5/Unity)


๐Ÿ’ก Tip for recruiters: This project demonstrates data-driven design, serialization patterns, and editor toolingโ€”skills directly transferable to narrative systems, quest editors, or content pipeline tools in AAA studios.

Built with clean C#, player-first narrative design, and a passion for interactive storytelling. ๐Ÿ“–โœจ

About

Modular visual novel framework for Unity. C# | Branching dialogue, save/load, localization-ready, designer-friendly editor tooling.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages