Skip to content

Procedurally generate world with a weather simulation

Notifications You must be signed in to change notification settings

0xdewy/terraflow

Repository files navigation

Terraflow

Terraflow is a basic weather simulation built with Bevy. The idea of the game is to control the weather to terraform different planets.

Terraflow

World Generation

The world is procedurally generated by placing random volcano points across a hex grid. Elevation is incremented around these volcano points in a pseudorandom manner until a max elevation is reached. Any tiles remaining below the ocean level are made to be an ocean tile. Temperature attributes are then given to tiles according to their latitude and altitude. From these attributes, tiles are given a tile type.

There are currently the following tile types:

  • Ocean
  • Water
  • Mountain
  • Grass
  • Hills
  • Desert
  • Dirt
  • Rocky
  • Forest
  • Ice
  • Jungle
  • Swamp
  • Waste

Weather System

Every turn, there is a basic weather system that will change the current humidity and groundwater levels of each tile. If the tile has a higher temperature, it will experience more evaporation, which adds to the humidity of the tile. If there are lower elevation tiles around the tile, then some groundwater will overflow to the lower tiles. Humidity travels to neighbors that are higher in altitude until it reaches mountain tiles where it falls and becomes groundwater. If humidity/temperature/water levels change too much, the tile type will morph into a different tile.

How to Play

There isn't much of a game, just a simulation of the weather patterns and how they affect the terrain. You can watch the weather change the tile types by pressing spacebar to move 1 epoch forward or enter to move 10 epochs.

How to Build and Run

  1. Install Rust for your operating system.
  2. Install Bevy dependencies.
  3. Run the project
    cargo run

About

Procedurally generate world with a weather simulation

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages