Skip to content

Batch map generation example

  • By opening this merge request, you agree to release your code and all other changes under the GPL 3 license and to abide by the terms set by this license.
  • Migrations have been added if applicable (migrations are always necessary for removing/renaming item asset files)
  • Significant changes of this merge request have been added to the changelog.

Adds an example in the world crate to mass-generate maps (with multiple threads!).

Usage

cargo run -F cli --example batch_generate batch --threads 8 batch_config.ron

Example config:

(
    scale: ( start: 2.0, end: 2.5 ),
    size: ( 10, 10 ),
    kind: Circle,
    erosion_quality: ( start: 1.0, end: 1.0 ),
)

This creates a maps/ folder with the following structure:

maps/
 {seed}.png
 {seed}.ron
 {seen}.bin # If --save-bin was passed to the generate command
 ...

To regenerate a map from a {seed}.ron file run: cargo run -F cli --example [--save-bin] regenerate [--erosion-quality 1.0] {seed}.ron

Edited by crabman

Merge request reports