Epitaph Documentation
Epitaph is a bytecode-compiled scripting language for the NetSlum game engine. It replaces standard programming keywords with thematic terminology inspired by .hack, making scripts read like in-world programs. The language is game-agnostic – any project can embed Epitaph for its logic layer.
Table of Contents
| Document | Description |
|---|---|
| Getting Started | Project setup, hello-world game, compile and run |
| Language Reference | Complete syntax, types, control flow, coroutines |
| Standard Library | math, time, color, fmt, json, bytes, string, list |
| Engine API | Graphics, audio, input, save, window, tilemap, ECS |
| Networking | Optional TCP, HTTP, and WebSocket modules |
| Build System | ns CLI, build.toml, game.toml, asset pipeline |
What is NetSlum?
NetSlum is a modular game engine written in Rust. It ships as a collection of
crates that handle rendering, audio, input, scripting, asset packing, and
networking. Games are written primarily in Epitaph scripts (.ep files) that
the engine compiles to bytecode and executes inside a lightweight stack-based VM.
Crate Map
ns (workspace)
├── epitaph Language: lexer, parser, compiler, VM, stdlib
├── ns-core Engine runtime: game loop, rendering, input, scripting host
├── ns-audio Audio subsystem: sink trait, backends (rodio), AudioRuntime plugin
├── ns CLI: compile .ep → .epc, bundle into .pak, scaffold, run
├── ns-assets PAK format, content loading, asset providers
├── ns-world Minimal ECS (sparse sets, dense iteration)
├── ns-network Optional networking: TCP, HTTP, WebSocket
├── ns-epd Epitaph Data format (.epd) for structured game data
├── ns-build-plugin WASI plugin ABI for build-time asset transforms
└── ns-shell-minifb Reference platform shell (minifb window + input, no audio)
How the pieces fit together
┌─────────────┐ ┌───────────┐
│ .ep scripts │──► │ ns │──► scripts.pak (.epc bytecode)
└─────────────┘ │ CLI │──► game.pak (processed assets)
┌─────────────┐ │ │──► game.toml (runtime config)
│ raw assets │──► └───────────┘
└─────────────┘
│
▼
┌──────────────────────────────────────────┐
│ ns-core (Engine) │
│ ┌──────────┐ ┌──────────┐ ┌────────┐ │
│ │ epitaph │ │ ns-assets│ │ns-world│ │
│ │ VM │ │ loaders │ │ ECS │ │
│ └──────────┘ └──────────┘ └────────┘ │
│ ┌──────────┐ │
│ │ ns-audio │ AudioSink (rodio, etc.) │
│ └──────────┘ │
└──────────────────────────────────────────┘
│
▼
┌──────────────┐
│ ns-shell-* │ Platform layer (window + input only)
└──────────────┘
Quick Links
- Install globally:
cargo install --path crates/ns - Scaffold a new project:
ns init my-game - Compile a script:
ns compile main.ep -o main.epc - Pack all scripts:
ns pack scripts/ -o scripts.pak - Full manifest build:
ns build --manifest build.toml - Manifest + Rust binary:
ns build --full(or--full --release) - Run (dev, no pack):
ns run(runscargo runin thebuild.tomldirectory) - Build + run release:
ns run --release - Rust workspace:
ns run -p your-game-crate(andns build --full -p …when using--full)