Inky

Visual Novel Engine

Inky

A Ren'Py-inspired Visual Novel Engine built with TypeScript and React, featuring its own scripting language InkyScript for interactive stories.

1 stars0 forksUpdated last month

Tech Stack

TypeScriptReactViteTailwind CSSInkyScript DSLLexer/Parser

Inky is a complete Visual Novel/Narrative Engine for the web, inspired by Ren'Py. Built in an afternoon as a learning project, it features its own scripting language InkyScript (.inky files) for writing interactive stories with choices, variables, and conditions.

✨ Key Features

šŸ“

Labels & Jumps

Story sections and navigation for organizing your narrative structure.

šŸ’¬

Dialogues

Character conversations with smooth typewriter effects for immersion.

šŸŽÆ

Choices

Player decisions with branching paths that shape the story.

šŸ”¢

Variables

Dynamic story state management for complex narratives.

⚔

Conditions

If/else logic for branching narratives based on player choices.

šŸŽØ

Commands

Scene management, character sprites, and audio control.

šŸ‘¤

Character System

Character definitions with sprites and custom colors.

šŸ–¼ļø

Sprite System

Dynamic character expressions with placeholder support.

šŸ“š InkyScript Syntax

InkyScript is a custom DSL designed specifically for visual novels:

// Character Definitions
@char MC
    name: "Player"
    sprite: "Player.png"
    color: "#4A90E2"

@char Sayori
    name: "Sayori"
    sprite: "sayori/{expression}.png"
    color: "#FF69B4"

// Story Start
== Start ==
scene school_hallway
~ affection = 0

Narrator "Welcome to Inky!"
Sayori "Hi! How are you?"

* Say something nice -> NicePath
* [affection > 5] Be romantic -> RomancePath
* Ignore her -> IgnorePath

== NicePath ==
~ affection += 10
show sayori happy at center
Sayori "That's so sweet!"

{ affection >= 10 }
    Sayori "I really like you!"
    -> GoodEnding

šŸ—ļø Architecture

1

Lexer (Tokenizer)

Converts .inky script text into tokens (Label, Dialogue, Choice, etc)

2

Parser (AST Builder)

Converts tokens into an Abstract Syntax Tree (AST) for execution

3

StepInterpreter (Runtime)

Executes AST step-by-step for UI integration with state management

4

InkyPlayer (React UI)

Renders the visual novel with scenes, characters, and dialogue boxes

āš™ļø Engine Components

āš”ļø
Vite - Lightning fast development
āš™ļø
React - Modern UI framework
šŸŽØ
Tailwind CSS - Modern UI styling
šŸ“˜
TypeScript - Type-safe codebase
šŸ”§
Lexer + Parser - Custom DSL compiler
šŸŽ­
Interpreter - Runtime execution engine
šŸŽ®
Visual Novel Player - Complete React UI
šŸ–¼ļø
Scene System - Background rendering

šŸ“– Documentation

šŸ“š

InkyScript Documentation

Complete language documentation with syntax and examples

šŸš€

Getting Started Guide

Learn InkyScript in 10 minutes with hands-on examples

šŸ‘¤

Character System

Character definition and sprite system documentation

šŸ—ļø

Project Structure

Codebase architecture and organization guide

šŸ“‚ Project Structure

Inky/
ā”œā”€ā”€ public/
│   ā”œā”€ā”€ inks/                  # InkyScript files
│   │   └── demo-school-day.inky
│   └── assets/
│       ā”œā”€ā”€ backgrounds/       # Scene backgrounds
│       └── characters/        # Character sprites
ā”œā”€ā”€ src/
│   ā”œā”€ā”€ core/
│   │   ā”œā”€ā”€ inkyscript/
│   │   │   ā”œā”€ā”€ Lexer.ts       # Tokenizer
│   │   │   ā”œā”€ā”€ Parser.ts      # AST Generator
│   │   │   ā”œā”€ā”€ StepInterpreter.ts
│   │   │   ā”œā”€ā”€ Runtime.ts     # State management
│   │   │   └── types.ts       # Type definitions
│   │   └── UI/
│   │       ā”œā”€ā”€ InkyPlayer.tsx
│   │       ā”œā”€ā”€ DialogueBox.tsx
│   │       ā”œā”€ā”€ ChoiceBox.tsx
│   │       └── Character.tsx
│   └── main.tsx               # React entry point

šŸŽÆ Current Status

āœ… Completed Features

  • āœ“InkyScript DSL specification
  • āœ“Lexer & Parser - Complete AST generation
  • āœ“StepInterpreter - Step-by-step execution
  • āœ“Character & Sprite System
  • āœ“React UI - Complete visual novel player
  • āœ“Scene & Dialogue System
  • āœ“Choice System - Interactive branching
  • āœ“Conditional Logic - Dynamic story flow

🚧 Potential Improvements

  • ā—‹Save/Load System
  • ā—‹Rollback/History
  • ā—‹Transitions & Animations
  • ā—‹Audio System
  • ā—‹Dev Tools (Debugger, Script Editor)

šŸŽ® Inspiration

Inspired by industry-leading visual novel tools:

šŸ’–
Ren'Py - The industry-standard Visual Novel engine
✨
Inky - Write Stories, Not Code

šŸ”§ Built With

ViteReactTypeScriptTailwind CSSCustom DSLLexer/Parser

"A personal learning project built in an afternoon. Made with ā¤ļø for visual novel enthusiasts!"