Visual Novel Script Library (Go)
A Go library for parsing and executing Hikarin Framework visual novel scripts.
Inspired by the VisualNovelEngine.java from the openβsource MinecraftHikarinMod, this project translates the same ideas into idiomatic Go.
The JSON script format is exported from the Iteranya/hikarin-framework, a platformβagnostic scripting system for visual novels.
β¨ Features
- Parse Hikarin JSON scripts into Go structs (
ScriptEntry)
- Iterate through script entries one by one
- Handle dialogue, sprite management, labels, and game actions
- Flexible API: load from file path, raw bytes, or any
io.Reader
- Designed as a reusable library for embedding into Go game engines (e.g. Ebitengine)
π¦ Installation
go get github.com/aclaputra/go-hikarin
π Folder Structure
visualnovel/
βββ go.mod
βββ vnlib/
β βββ model.go # ScriptEntry struct
β βββ extract.go # ExtractFromBytes, ExtractFromFile, ExtractFromReader
β βββ parser.go # Helpers for handling entries
βββ scripts/
β βββ status_quo_script.json # Example script
βββ examples/
βββ main.go # Demo program
π§βπ» Usage
Example Script
[
{ "type": "dialogue", "action": "say", "label": "Conductor", "content": "Evening again, miss.", "id": 3 },
{ "type": "remove_sprite", "action": "remove_character", "sprite": "conductor", "id": 4 }
]
See more on examples and scripts folder
π Inspirations
MinecraftHikarinMod (github.com) β original Java implementation of a VN engine.
Hikarin Framework β JSON scripting format exported and consumed by this library.
βοΈ License
This library is open source under the MIT License.
It builds upon ideas from the Hikarin Framework and MinecraftHikarinMod, both of which are open source projects.
π Roadmap
[ ] Add support for branching choices
[ ] Integrate with Ebitengine rendering
[ ] Provide unit tests for script parsing
[ ] Expand documentation with advanced examples