Skip to content

HexSleeves/runeforge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

33 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Runeforge ๐Ÿ”ฅโš”๏ธ

A modern, modular roguelike library for Rust

Crates.io Documentation License

๐ŸŽฏ 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 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

Planned Features

  • ๐Ÿ”จ 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.

๐Ÿ“š Examples

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_demo

๐Ÿ”ง Development Status

Runeforge is now largely complete and documented. The core modules are stable and ready for use.

Current Progress: ~90%

  • โœ… 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.

๐Ÿค Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.

Areas Where Help Is Needed

  • GPU renderer integration and examples.
  • More advanced map generation algorithms.
  • UI framework design and implementation.
  • Example roguelikes and demos.
  • Performance benchmarks.

๐Ÿ“– Documentation

๐Ÿ—บ๏ธ Roadmap

Version 0.1 (Foundation) - Completed

  • โœ… Workspace structure
  • โœ… Color, geometry, random crates
  • โœ… Basic documentation

Version 0.2 (Algorithms) - Completed

  • โœ… FOV algorithms
  • โœ… Pathfinding
  • โœ… BSP trees

Version 0.3 (Rendering & Input) - Completed

  • โœ… Rendering backends (GPU, Soft, Term)
  • โœ… Tileset/Font loading
  • โœ… Input handling

Version 0.4 (Procedural Gen) - Planned

  • Noise generation
  • Advanced map generation
  • Line drawing / Geom utils

Version 1.0 (Full Release)

  • Complete example game
  • Comprehensive documentation
  • Tutorial and examples

See RUNEFORGE.md for the detailed roadmap.

๐Ÿ“„ License

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.

๐Ÿ™ Acknowledgments

  • 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

๐Ÿ”— Links


Built with โค๏ธ in Rust

About

A modern, modular roguelike library for Rust

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages