Runeforge is a pure Rust roguelike library inspired by libtcod, combining a familiar API with modern Rust best practices and GPU-accelerated rendering.
- ๐ฆ Pure Rust - No C dependencies, easier builds
- ๐ฆ Modular - Use only what you need
- โก Fast - GPU-accelerated rendering with wgpu
- ๐ Cross-platform - Windows, macOS, Linux, and WebAssembly
- ๐ Well-documented - Complete API docs and tutorials
- ๐ฎ libtcod-compatible - Familiar API for easy migration
Add Runeforge to your Cargo.toml:
[dependencies]
runeforge-rl = "0.1"use runeforge_rl::prelude::*;
fn main() {
let mut rng = Rng::new();
let point = IVec2::new(10, 20);
let color = Color::RED;
println!("Random d6 roll: {}", rng.roll_dice(1, 6));
println!("IVec2 at ({:?})", point);
println!("Color: {}", color);
}Runeforge is organized as a modular workspace:
| Crate | Description | Status |
|---|---|---|
runeforge-algorithms |
Procedural map generation (BSP, Caves, etc.) | โ Complete |
runeforge-color |
RGB/HSV color manipulation | โ Complete |
runeforge-direction |
Grid-based direction handling | โ Complete |
runeforge-fov |
Field-of-view algorithms | โ Complete |
runeforge-geometry |
2D primitives (IVec2, Rect) | โ Complete |
runeforge-input |
Keyboard and mouse input | โ Complete |
runeforge-noise |
Procedural noise generation | โ Complete |
runeforge-pathfinding |
A* and Dijkstra pathfinding | โ Complete |
runeforge-random |
RNG with dice notation | โ Complete |
runeforge-terminal |
Console rendering (CPU/GPU/ANSI) | โ Complete |
runeforge-tileset |
Font and tileset loading | โ Complete |
- โ Color System: RGB/HSV conversion, blending, named colors
- โ Geometry: IVec2 and Rect types with iterators
- โ
Random Numbers: Seedable RNG, dice notation parsing (
3d6+2), weighted selection - โ FOV Algorithms: Symmetric shadowcasting with precise fraction-based calculation
- โ
Pathfinding: A* and Dijkstra pathfinding via the
pathfindingcrate - โ Procedural Generation: BSP dungeons, Cellular Automata caves, and Drunkard's Walk tunnels
- โ Noise Generation: 2D Perlin noise maps
- โ
Rendering:
- Abstract
Consoletrait for backend-agnostic code - Software backend (CPU buffer, PNG export)
- Terminal backend (ANSI escape codes)
- Abstract
- โ Tilesets: Support for TrueType/OpenType fonts and bitmap tilesets
- โ Input: Action-based input mapping (keyboard/mouse) with support for vi-keys, WASD, arrows
- ๐จ GPU Renderer: A
wgpu-based renderer is available but needs integration into the main library. - ๐จ UI Framework: A simple UI toolkit for buttons, text boxes, etc. is a long-term goal.
- ๐จ Advanced Algorithms: More procedural generation and pathfinding options.
Check out the examples/ directory for complete examples:
cargo run --example hello_terminal
cargo run --example roguelike_demo
cargo run --example windowed_roguelike
cargo run --example fov_demo
cargo run --example pathfinding_demo
cargo run --example bsp_demoRuneforge is now largely complete and documented. The core modules are stable and ready for use.
- โ Core crates: color, geometry, random, direction, distance, utils
- โ Core Algorithms: FOV, Pathfinding, BSP, Caves, Drunkard's Walk, Noise
- โ Rendering system: Software and Terminal backends are stable.
- โ Input system: Action mapping for keyboard/mouse.
- โ Documentation: All public APIs are now documented with examples.
- ๐จ Example Game: A complete roguelike demo is in progress.
We welcome contributions! See CONTRIBUTING.md for guidelines.
- GPU renderer integration and examples.
- More advanced map generation algorithms.
- UI framework design and implementation.
- Example roguelikes and demos.
- Performance benchmarks.
- API Documentation: https://docs.rs/runeforge-rl
- Tutorial: Coming soon
- Architecture Guide: See RUNEFORGE.md
- Migration from libtcod: Coming soon
- โ Workspace structure
- โ Color, geometry, random crates
- โ Basic documentation
- โ FOV algorithms
- โ Pathfinding
- โ BSP trees
- โ Rendering backends (GPU, Soft, Term)
- โ Tileset/Font loading
- โ Input handling
- Noise generation
- Advanced map generation
- Line drawing / Geom utils
- Complete example game
- Comprehensive documentation
- Tutorial and examples
See RUNEFORGE.md for the detailed roadmap.
Runeforge is licensed under the BSD-3-Clause License, the same as libtcod.
This allows commercial use, modification, and distribution with minimal restrictions.
See LICENSE for details.
- libtcod - The inspiration for this library
- bracket-lib - Modular architecture inspiration
- doryen-rs - Pure Rust roguelike library by libtcod's creator
- The Rust gamedev community
- GitHub: https://github.com/yourusername/runeforge-rl
- Crates.io: https://crates.io/crates/runeforge-rl
- Discord: Coming soon
- r/roguelikedev: https://reddit.com/r/roguelikedev
Built with โค๏ธ in Rust