Expand description

Cellular automata map filter.

Check this article for more information about the algorithm behind this generator.

This algorithm requires that map first is filtered with some noise. For example UniformNoise. It can also be apply to any other non empty map.

Example usage:

use rand::prelude::*;
use mapgen::{MapBuffer, MapFilter};
use mapgen::filter::CellularAutomata;
 
let mut rng = StdRng::seed_from_u64(100);
let gen = CellularAutomata::new();
let map = gen.modify_map(&mut rng, &MapBuffer::new(80, 50));
 
assert_eq!(map.width, 80);
assert_eq!(map.height, 50);

Structs