map-gen-2d

Crates.iomap-gen-2d
lib.rsmap-gen-2d
version0.1.15
sourcesrc
created_at2023-01-16 07:37:43.215921
updated_at2023-01-17 02:38:22.242051
description2D map generation algorithms implementaion
homepagehttps://github.com/theseatoad/map-gen-2d
repositoryhttps://github.com/theseatoad/map-gen-2d
max_upload_size
id759943
size35,826
TheSeaToad (theseatoad)

documentation

README

2D Map Generation Algorithms

Binary Search Partition (BSP)

Recursively divides the map into rooms.

Example:

$ cargo run --example bsp-map

Code example:

// BSPMap::new(position, size, min_room_size, max_room_size)
BSPMap::new(Point::new(20,50), SeedableRng::seed_from_u64(1), Point::new(2,5), Point::new(10,15))

Features

  • Custom size (Minimum size of 20,20)
  • Seedable rng

Credits

Credit to https://gamedevelopment.tutsplus.com/tutorials/how-to-use-bsp-trees-to-generate-game-maps--gamedev-12268 and https://github.com/whostolemyhat/dungeon for algorithm and rust implementation help.

Commit count: 10

cargo fmt