Skip to content

A data-oriented game engine written in Rust with a custom ECS πŸ¦€ Works on Windows/Linux/MacOS/Web/OpenXR

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

matthewjberger/nightshade

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

nightshade

github crates.io docs.rs

Nightshade is a data-oriented game engine written in rust πŸ¦€

demo Screenshot 2025-12-28 121420

Gallery

View the gallery here πŸ”Ž

image

Getting Started

The fastest way to get started is with the nightshade-template.

It is also possible to host a webview with bidirectional IPC, demonstrated in nightshade-webview.

Examples

For a collection of example projects showcasing Nightshade's features, see the nightshade-examples repository.

Features

Nightshade uses a modular feature system for fine-grained dependency control.

Feature Hierarchy

nightshade features:
β”œβ”€β”€ core ─────────────── Minimal: windowing, math, ECS, time
β”œβ”€β”€ text ─────────────── 3D text rendering (fontdue)
β”œβ”€β”€ behaviors ───────────Built-in entity behaviors (stateless, WASM-compatible)
β”œβ”€β”€ assets ───────────── Asset loading (gltf, image, half, bincode)
β”œβ”€β”€ runtime ──────────── core + text + behaviors (minimal runnable app)
β”œβ”€β”€ engine (default) ─── runtime + assets + scene_graph + picking + more
└── full ─────────────── Everything including audio, physics, navmesh, scripting

Binary Size by Feature

Configuration Size Delta
runtime+wgpu (baseline) 9.71 MB -
+egui 15.82 MB +6.11 MB
+physics (rapier3d) 10.95 MB +1.24 MB
+assets 10.28 MB +0.57 MB
+gamepad 10.21 MB +0.50 MB
+terrain 10.21 MB +0.50 MB
+audio (kira) 10.11 MB +0.40 MB
+navmesh 9.71 MB +0.00 MB
engine (default) 10.79 MB +1.08 MB
full 22.63 MB +12.92 MB

Minimal Build

For a lightweight egui app without asset loading:

nightshade = { default-features = false, features = ["runtime", "wgpu", "egui"] }

Quickstart

# native
just run

# wasm (webgpu)
just run-wasm

# serve site
cd site && just serve

All chromium-based browsers like Brave, Vivaldi, Chrome, etc support WebGPU. Firefox also supports WebGPU now starting with version 141. Run just with no arguments to list all commands

Prerequisites

  • just
  • trunk (for web builds)
  • git-cliff (for changelog generation)
  • gh (GitHub CLI, for creating releases)

Platform Guides

Native (Windows/macOS/Linux)

Build and run natively using cargo:

just run [project]  # defaults to nightshade-editor
just build          # release build

WebAssembly (WASM)

Build for web browsers with WebGPU support:

just run-wasm [project]   # defaults to editor
just build-wasm [project]

Steam Deck

See STEAM_DECK.md for deployment instructions.

Steam Integration

See STEAM.md for Steam integration (achievements, stats, friends).

Profiling & Logging

See PROFILING.md for detailed profiling and logging documentation.

Plugins

See PLUGINS.md for runtime WASI plugin support.

Scripting

See SCRIPTING.md for Rhai scripting support.

MCP Integration (Native Only)

The mcp feature exposes an MCP (Model Context Protocol) server for AI-assisted scene manipulation. When enabled, the engine automatically starts an MCP server on http://127.0.0.1:3333/mcp.

nightshade = { features = ["mcp"] }

Connect Claude Code:

claude mcp add --transport http nightshade http://127.0.0.1:3333/mcp

Available tools: list_entities, query_entity, spawn_entity, despawn_entity, set_position, set_rotation, set_scale, set_material_color, set_behavior, add_behavior, remove_behavior, get_behavior, load_asset, spawn_prefab, list_loaded_assets, clear_scene, batch

Asset loading: Use load_asset to load .glb, .gltf, or .fbx files, then spawn_prefab to instantiate them.

Batch operations: Use batch to execute multiple operations atomically in a single frame, reducing round-trip latency. Supports: spawn_entity, despawn_entity, set_position, set_rotation, set_scale, set_material_color, add_behavior, remove_behavior, set_behavior, get_behavior, query_entity, list_entities, clear_scene.

The editor enables MCP by default for AI-assisted development workflows.

Contributing

Nightshade is currently in its early stages of development. The project is not accepting external contributions at this time as the architecture and core systems are still being established. Once the engine reaches a more mature and stable state, I will open up contributions and provide contributor guidelines.

License

Nightshade is free, open source and permissively licensed! All code in this repository is dual-licensed under either:

at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in nightshade by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

About

A data-oriented game engine written in Rust with a custom ECS πŸ¦€ Works on Windows/Linux/MacOS/Web/OpenXR

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Contributing

Stars

Watchers

Forks

Sponsor this project