nxeu/nerune-engine
A visual novel engine built with Rust + wgpu, powered by the neru scripting language.
- Rust 98%
- WGSL 2%
| .forgejo/workflows | chore: switch CI to mise-action, rename to mise.toml | |
| assets | feat: text engine | |
| crates | fix: add font_family arg to draw_text | |
| docs/specification | chore: uncheck texture atlas | |
| .gitignore | feat: add CI, mise tasks, rustfmt and clippy config | |
| Cargo.lock | feat: draw text | |
| Cargo.toml | feat: text engine | |
| clippy.toml | feat: add CI, mise tasks, rustfmt and clippy config | |
| LICENSE | add: LICENSE | |
| mise.toml | feat: simple window | |
| README.md | docs: add npack alt ext | |
| README_ja.md | docs: add npack alt ext | |
| rustfmt.toml | feat: add CI, mise tasks, rustfmt and clippy config | |
Nerune Engine
A visual novel engine built with Rust + wgpu, powered by the neru scripting language.
Warning
This project is under active development. APIs are subject to breaking changes without notice. Do not use in production.
Overview
nerune-engine is a runtime engine for neru — a two-layer scripting language designed for visual novels. The engine interprets events emitted by the neru VM (text display, visual effects, choices, audio, etc.) and renders them using wgpu.
The neru scripting language (neru-rs) is included in this repository as a Cargo workspace crate.
Tech Stack
| Component | Crate |
|---|---|
| Language | Rust |
| Graphics | wgpu |
| Windowing | winit |
| Audio | kira |
| Text Rendering | cosmic-text |
| Debug UI | egui (egui-wgpu) |
| Serialization | serde + rmp-serde (MessagePack) |
| Scripting | neru-rs (workspace crate) |
All dependencies are pure Rust — zero C dependencies for simplified builds and cross-compilation.
Features
Rendering
- Batch-rendered 2D sprite system
- Background and character sprite management with layering
- WGSL shader-based transitions (fade, dissolve, wipe, custom)
- Custom post-processing pipeline (blur, vignette, color grading)
- GPU compute particle system (snow, rain, sakura, etc.)
- Rich text with inline tags (
[b],[color],[shake], etc.)
Audio
- BGM / SE / Voice playback with independent tracks (kira)
- Fade-in, fade-out, crossfade, tweening, effect chains
- Supported formats: OGG Vorbis, MP3, WAV
Video
- WebM (VP9 + Opus) playback for OP/ED movies and cutscenes
UI
- Built-in UI components (message window, choices, menus, config)
.nerui(.nui) styling DSL with Flexbox-like layout- Theme variables and state transitions
- egui integration for development/debug
Game Systems
- Save / Load with MessagePack serialization (serde)
- Backlog with jump-back support
- Read/unread tracking and skip control
- CG gallery and scene recollection
- Flowchart visualization of scenario branches
Developer Experience
- Hot reload for scripts, assets, and UI styles (notify crate)
- Dev mode with direct directory asset loading
- Crash reports with stack traces (panic hook)
- egui debug inspector (scene, VM state, performance)
Accessibility
- Screen reader support (OS accessibility API)
- Full keyboard navigation
- Adjustable font size and text speed
Project Structure
nerune-engine/
Cargo.toml # Workspace definition
crates/
neru-core/ # Compiler, VM, AST, bytecode
neru-cli/ # neru CLI tool (compile / run / build)
nerune-renderer/ # wgpu renderer
nerune-audio/ # kira audio
nerune-text/ # cosmic-text text rendering
nerune-ui/ # UI system + .nerui (.nui) parser
nerune-engine/ # Integration crate (entry point)
docs/
specification/
requirements.md # Requirements specification
implementation-plan.md # Implementation plan
Build from Source
Requires Rust (stable).
cargo build # Build
cargo run # Build and run
cargo test # Run all tests
Game Project Structure
my_game/
neru.toml # Project configuration
scripts/ # Scenario files (.neru / .nr)
logic/ # Logic files (.nerul / .nl)
themes/ # UI styles (.nerui / .nui)
assets/
bg/ # Backgrounds
character/ # Character sprites
bgm/ # Music
se/ # Sound effects
voice/ # Voice files
video/ # Movies (WebM)
Roadmap
| Phase | Status | Description |
|---|---|---|
| 1. Window + Renderer | Planned | winit window, wgpu init, sprite batch renderer |
| 2. Sprite + Text | Planned | Texture loading, sprite drawing, cosmic-text |
| 3. neru VM Integration | Planned | neru-core crate, VM hosting, event dispatch |
| 4. Audio | Planned | kira integration, BGM/SE/voice, mixer |
| 5. UI System | Planned | Message window, choices, menus, .nerui (.nui) parser |
| 6. Effects + Particles | Planned | WGSL transitions, post-process, GPU particles |
| 7. Save/Load + History | Planned | Save system, backlog, CG gallery, flowchart |
| 8. Distribution | Planned | .npack (.npk) build, cross-compile, crash reports, video |
| 9. Polish | Planned | Accessibility, DPI, config screen, optimization |