A downloadable Generator

A small island generator written in rust.

This generator uses the following algorithm:

1) Generate (NxN)/100 points over a grid of NxN points (N = 100)
2) Generate the Voronoi diagram from those points
3) Relax the Voronoi diagram
4) For each Voronoi cell, choose a biome. If the cell touch the border of the grid, the biome is forced to sea.
5) Generate a covering graph for the cells whose biome is not sea.
6) Place mountains or lakes on the border of neighbouring cells that are not connected in the graph.
7) Trace roads between neighbouring cells that are connected in the graph. If the road cross an obstacle (sea, lake, river), do not trace the road.
8) Place a city on the center of the Voronoi cell whose biome is not sea.


Install instructions

Extract the archive and run cargo: 

cargo run --release

The program will output the image island.png.

Download

Download
gener-ile.zip 138 kB

Comments

Log in with itch.io to leave a comment.

Hey! Very cool! What inspired you to create this in Rust? Also, you should message @redblobgames on the procjam discord. He is very into this type of proc gen. You will probably love his stuff as well, if you haven't seen it already: https://www.redblobgames.com/

Sorry for the very late reply (I don't check itch.io often, and I didn't check the mail adress I'm using for itch.io for a while). I'm already on the procjam discord for several months, so I know about @redblobgames.

Why Rust ? I wanted to try Rust for a while, so I took the opportunity of the jam to do it.  I already coded map generators with some similitudes to this one, so this was more about testing Rust. However, I also wanted to check the complexity of writing that generator, to check if it could be done in coding dojos.

No worries! Cool, always exciting to learn a new language. Everyone I know who's tried Rust loves it :)

I have mixed feelings about it. I found it user-unfriendly because of the ownership concepts breaking many way of thinking when you come from object-oriented grounds. I'm unsure if I'll use it again for other procedural projects.

Interesting, that makes sense!