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

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:

CrateDescriptionStatus
runeforge-algorithmsProcedural map generation (BSP, Caves, etc.)โœ… Complete
runeforge-colorRGB/HSV color manipulationโœ… Complete
runeforge-directionGrid-based direction handlingโœ… Complete
runeforge-fovField-of-view algorithmsโœ… Complete
runeforge-geometry2D primitives (IVec2, Rect)โœ… Complete
runeforge-inputKeyboard and mouse inputโœ… Complete
runeforge-noiseProcedural noise generationโœ… Complete
runeforge-pathfindingA* and Dijkstra pathfindingโœ… Complete
runeforge-randomRNG with dice notationโœ… Complete
runeforge-terminalConsole rendering (CPU/GPU/ANSI)โœ… Complete
runeforge-tilesetFont 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 pathfinding crate
  • โœ… Procedural Generation: BSP dungeons, Cellular Automata caves, and Drunkardโ€™s Walk tunnels
  • โœ… Noise Generation: 2D Perlin noise maps
  • โœ… Rendering:
    • Abstract Console trait for backend-agnostic code
    • Software backend (CPU buffer, PNG export)
    • Terminal backend (ANSI escape codes)
  • โœ… 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.