Runeforge ๐ฅโ๏ธ
A modern, modular roguelike library for Rust
๐ฏ About
Runeforge is a pure Rust roguelike library inspired by libtcod, combining a familiar API with modern Rust best practices and GPU-accelerated rendering.
Why Runeforge?
- ๐ฆ 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
๐ Quick Start
Installation
Add Runeforge to your Cargo.toml:
[dependencies]
runeforge-rl = "0.1"
Hello World
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);
}
๐ฆ Crate Structure
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 |
๐จ Features
Current Features (v0.1)
- โ 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
๐ License
Runeforge is licensed under the BSD-3-Clause License, the same as libtcod.
This allows commercial use, modification, and distribution with minimal restrictions.