#2d #bsp #procedural-generation

map-gen-2d

2D map generation algorithms implementaion

3 releases

0.1.15 Jan 17, 2023
0.1.1 Jan 17, 2023
0.1.0 Jan 16, 2023

#2255 in Algorithms

MIT/Apache

21KB
467 lines

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.

Dependencies

~440KB