๐Ÿ“Diamond-square terrain generation

tags

ยง Procedural Map Generation

Algorithm:

  1. Set random heights to corners

  2. Square step: now pick center tile and set its height to the average of corners (diagonals from tile) + random offset

  3. Diamond square: pick centers of each side, set their heights to average of neighbor tiles (horizontal and vertical) + random offset

  4. decrease range of random offset, recurse into sub-squares starting from step 2

References

Backlinks