Crates.io | magrathea |
lib.rs | magrathea |
version | 0.0.3 |
source | src |
created_at | 2020-09-23 03:44:34.895629 |
updated_at | 2021-02-23 05:05:09.25053 |
description | A pixel-art procedural planet generation library and tool |
homepage | |
repository | https://github.com/khonsulabs/magrathea |
max_upload_size | |
id | 291951 |
size | 134,337 |
And thus were created the conditions for a staggering new form of specialist industry: custom-made luxury planet building. The home of this industry was the planet Magrathea, where hyperspatial engineers sucked matter through white holes in space to form it into dream planets—gold planets, platinum planets, soft rubber planets with lots of earthquakes—all lovingly made to meet the exacting standards that the Galaxy’s richest men naturally came to expect. From the Hitchhiker's Guide to the Galaxy
Magrathea is a procedural planet generator, focused on generating pixel-art style planets. It is written in Rust and can be used either as a standalone executable or as a crate.
This will print the help output for the command:
cargo run --features cli -h
If you wish to also see commands relating to launching the GUI editor, pass the editor
feature instead of cli
:
cargo run --features editor -h
./planet.png
cargo run --features cli generate -o ./planet.png
cargo run --features editor edit
Add magrathea to your Cargo.toml:
magrathea = "0.0.1"
Create a 128x128 rendering of a random Planet:
let planet = magrathea::Planet {
seed: Uuid::new_v4(),
origin: Point2D::new(x_km, y_km),
radius: Length::new(radius_km),
colors: Coloring::earthlike(),
};
let image = planet.generate(128, &Light::defaulFt())
This is being developed for use in a game that is TBA, by Khonsu Labs. Stability for this crate means being able to input the same values into the generation functions and receive the same outputs. As such, any minor version upgrade (e.g., 0.1 to 0.2) will be done whenever any changes break existing seed compatibility. Until v0.1, however, no stability is guaranteed between updates.
Magrathea is licensed under the MIT License.