Skip to content

Masterhack3r69/Island-Terrain-Generator-in-ZIG

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Island Terrain Generator

A procedural terrain generation tool built using Zig and raylib. Create unique, beautiful islands with real-time controls and advanced simulation features.

Island Terrain Generator Screenshot

Features

  • Multi-Layer Procedural Generation: Uses a combination of Continental, Island, and Detail Perlin noise layers to create organic archipelagos.
  • Advanced River Simulation: Features hydraulic logic including:
    • Meandering Paths: Natural winding based on terrain slope.
    • Lake Filling: Rivers realistically fill depressions and "spill" over to continue their path.
    • Dynamic Widening: River width increases downstream, with deep-water centers for larger flows.
  • Hex-Staggered Rendering: A unique staggered grid layout providing a high-quality "hex-like" visual aesthetic.
  • Real-time UI: A custom-built UI system with sliders, buttons, and informative tooltips for every parameter.
  • Interactive Map:
    • Zoom & Pan: Smooth navigation around the generated terrain.
    • Dynamic Legend: Clear visual guide for all 7 terrain types.
  • Export: Save your creations directly to high-quality .png files.

Controls

  • Left Mouse / Right Mouse / Middle Mouse: Click and drag to pan the camera.
  • Scroll Wheel: Zoom in and out of the map.
  • [R] Key: Quickly regenerate the map with current settings.
  • UI Sliders: Tweak noise scale, octaves, island radius, falloff, and more in real-time.

How to Run

Ensure you have the latest Zig compiler (tested on 0.15.2+) installed.

  1. Clone the repository.
  2. Run the following command in the project root:
    zig build run

Project Structure

  • src/main.zig: Application entry point and main UI loop.
  • src/core/map.zig: Core map data structures and rendering logic.
  • src/gen/: Procedural generation algorithms (Island and River).
  • src/ui/: Custom UI framework with tooltip support.

Built with using Zig and raylib.

About

A procedural terrain generation tool built using Zig and Raylib

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages