BiomeGenerator

by StarNightFlower

14

BiomeGeneratorDemo

Procedural Biome Map Generation Demo This demo shows how to use the Midpoint Displacement Algorithm to create natural and random biome maps.

Alt text Alt text Alt text

The Midpoint Displacement Algorithm is a fractal algorithm that can generate natural-looking shapes by recursively subdividing a rectangle into smaller parts and displacing the midpoint randomly.

Algorithm Principles Given an initial line segment or rectangle, recursively subdivide it and displace the midpoint or center point at each step, causing the curve or surface to take on an irregular shape. As the number of subdivisions increases, the curve or surface approaches a realistic natural landscape. Specifically, the Midpoint Displacement Algorithm involves the following steps:

  1. Start with an initial square grid, with preset height values at the four corner vertices, forming a rectangle composed of (2*n + 1)^2 squares, where n is the number of preset iterations. The corner vertices can have arbitrary random attribute values and heights, as shown (black indicates empty): Alt text

  2. Calculate the height values and attributes of the midpoints on the four sides of the rectangle. The attribute of a midpoint is randomly chosen from one of its two adjacent corners, while the height is the average of the two corners. After the midpoints of the four sides are computed, calculate the height and attribute of the center point of the rectangle as the average of the four corners plus a random offset:

Alt text

  1. Subdivide the rectangle into four smaller rectangles again, and repeat steps 2 and 3 until every square is filled. The final effect:

Alt text

Version

1.0

Engine

4.1

Category

Demos

Download

Version1.0
Download

Support

If you need help or have questions about this plugin, please contact the author.

Contact Author