Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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

DocumentDescription
Getting StartedProject setup, hello-world game, compile and run
Language ReferenceComplete syntax, types, control flow, coroutines
Standard Librarymath, time, color, fmt, json, bytes, string, list
Engine APIGraphics, audio, input, save, window, tilemap, ECS
NetworkingOptional TCP, HTTP, and WebSocket modules
Build Systemns 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)
 └──────────────┘

  • 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 (runs cargo run in the build.toml directory)
  • Build + run release: ns run --release
  • Rust workspace: ns run -p your-game-crate (and ns build --full -p … when using --full)