Nightshade is a data-oriented game engine written in rust π¦
π Read the Book - Comprehensive guide covering all engine systems, from getting started to advanced features like SDF sculpting and audio-reactive effects.
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.
For a collection of example projects showcasing Nightshade's features, see the nightshade-examples repository.
Nightshade uses a modular feature system for fine-grained dependency control.
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, bincode, lz4)
βββ runtime ββββββββββββ core + text + behaviors
βββ engine (default) βββ runtime + assets + scene_graph + terrain + picking + file_dialog + more
βββ full βββββββββββββββ engine + egui + audio + physics + scripting + fbx + editor + more
β
β Add-on features:
βββ wgpu βββββββββββββββ GPU rendering (dx12, metal, vulkan, webgpu)
βββ egui βββββββββββββββ Immediate mode UI (egui + tiles)
βββ audio ββββββββββββββ Audio playback (kira)
βββ fft ββββββββββββββββ FFT audio analysis (rustfft)
βββ physics ββββββββββββ 3D physics (rapier3d)
βββ gamepad ββββββββββββ Controller input (gilrs)
βββ navmesh ββββββββββββ Navigation mesh (rerecast)
βββ scripting ββββββββββ Rhai scripting
βββ fbx ββββββββββββββββ FBX asset format (ufbx)
βββ lattice ββββββββββββ Lattice deformation
βββ sdf_sculpt βββββββββ SDF sculpting
βββ mosaic ββββββββββββ Multi-pane desktop app framework (egui_tiles)
βββ editor ββββββββββββ Scene editor infrastructure (gizmo, undo, inspector, picking)
βββ openxr βββββββββββββ VR/AR support
βββ steam ββββββββββββββ Steam integration
βββ mcp ββββββββββββββββ AI scene manipulation (MCP server)
βββ claude ββββββββββββ Claude Code CLI integration
βββ webview ββββββββββββ Embedded webview with IPC
βββ plugins ββββββββββββ WASI plugin system
For a lightweight egui app without asset loading:
nightshade = { default-features = false, features = ["runtime", "wgpu", "egui"] }# native
just run
# wasm (webgpu)
just run-wasm
# serve site
cd site && just serveAll chromium-based browsers like Brave, Vivaldi, Chrome, etc support WebGPU. Firefox also supports WebGPU now starting with version
141. Runjustwith no arguments to list all commands
- just
- trunk (for web builds)
- git-cliff (for changelog generation)
- gh (GitHub CLI, for creating releases)
Build and run natively using cargo:
just run [project] # defaults to nightshade-editor
just build # release buildBuild for web browsers with WebGPU support:
just run-wasm [project] # defaults to editor
just build-wasm [project]See STEAM_DECK.md for deployment instructions.
See STEAM.md for Steam integration (achievements, stats, friends).
See PROFILING.md for detailed profiling and logging documentation.
See PLUGINS.md for runtime WASI plugin support.
See SCRIPTING.md for Rhai scripting support.
Nightshade has two features for AI integration: mcp for exposing the engine as an MCP server, and claude for spawning and communicating with Claude Code CLI as a subprocess.
The mcp feature starts an HTTP-based Model Context Protocol server on http://127.0.0.1:3333/mcp when the application launches. Any MCP client (Claude Code, Claude Desktop, or custom tooling) can connect and manipulate the running scene in real time.
nightshade = { features = ["mcp"] }Connect Claude Code:
claude mcp add --transport http nightshade http://127.0.0.1:3333/mcpAvailable tools (50+):
| Category | Tools |
|---|---|
| Entities | list_entities, query_entity, spawn_entity, despawn_entity, clear_scene |
| Transforms | set_position, set_rotation, set_scale, set_parent, set_visibility |
| Materials | set_material_color, set_emissive, set_material, set_casts_shadow |
| Lighting | spawn_light, set_light |
| Camera | set_camera |
| Assets | load_asset, spawn_prefab, list_loaded_assets |
| Environment | set_atmosphere, load_hdr, set_graphics |
| Effects | spawn_water, spawn_particles, set_particles, spawn_decal |
| Text | spawn_hud_text, set_hud_text, spawn_3d_text |
| Physics | add_rigid_body, add_collider, apply_impulse, apply_force, set_velocity |
| Animation | play_animation, stop_animation, list_animations |
| Scripting | set_script, remove_script, set_game_state, get_game_state |
| Debug | add_line, add_lines, clear_lines, get_input, get_time |
| Batch | batch (atomic multi-operation), run (concise text commands) |
Batch operations: Use batch to execute multiple operations atomically in a single frame, reducing round-trip latency.
Concise commands: Use run for shorthand text commands (e.g. spawn sun Sphere 0,0,0 scale:2 emissive:5,4,0).
State hook: Applications can intercept MCP commands before the engine processes them by implementing handle_mcp_command on the State trait. Return Some(response) to handle a command yourself, or None to let the engine handle it with default behavior.
The claude feature provides types and a worker thread for spawning Claude Code as a subprocess and streaming its output. This lets applications embed an AI assistant panel that can send queries, receive streamed responses (text, thinking, tool use events), and optionally auto-configure MCP so Claude can manipulate the scene.
nightshade = { features = ["claude"] }Key types: ClaudeConfig (system prompt, allowed/disallowed tools, MCP config, custom CLI args), CliCommand (StartQuery, Cancel), CliEvent (SessionStarted, TextDelta, ThinkingDelta, ToolUseStarted, ToolUseFinished, TurnComplete, Complete, Error).
When both claude and mcp features are enabled, McpConfig::Auto automatically configures Claude Code to connect to the engine's MCP server β no manual mcp add step needed.
The editor enables both features by default for AI-assisted development workflows.
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.
Nightshade is free, open source and permissively licensed! All code in this repository is dual-licensed under either:
- MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT)
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
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.
