a1essandro/diamond-and-square

Algorithm for generating heightmaps

Maintainers

👁 A1essandro

Package info

github.com/A1essandro/Diamond-And-Square

pkg:composer/a1essandro/diamond-and-square

Statistics

Installs: 202

Dependents: 0

Suggesters: 0

Stars: 21

Open Issues: 0

v2.3.0 2017-01-09 12:30 UTC

Requires

  • php: >=5.3.0

Requires (Dev)

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT 69626d65715628873ddf2ffa6715d863a96c4c01

  • A1essandro <alexander.yermakov.1990.woop@gmail.com>

This package is not auto-updated.

Last update: 2026-06-21 04:00:16 UTC


README

👁 Build Status
👁 Coverage Status
👁 Latest Stable Version
👁 Total Downloads
👁 Latest Unstable Version
👁 License

Algorithm for generating heightmaps on PHP.

See also Perlin-Noise algorithm with the similar API.

Algorithm

Steps

👁 Steps

Image source

See more about diamond-square algorithm on wiki

Requirements

This package is only supported on PHP 5.3 and up.

Installing

Installing via Composer

See more getcomposer.org.

Execute command

composer require a1essandro/diamond-and-square ~2.0

Usage example

Standart

$gen = new DiamondAndSquare();
$gen->setSize(7); //real size equal 2 ^ 7 + 1, i.e. 129
$gen->setPersistence(1.7);
$gen->setMapSeed("1hCaHs5hZ");

$map = $gen->generate();