Our friend Ravey changed the algorithm. If there are any savvy C++ coders out there, I have attached the source code in case you wanted to improve on the values generated by our present Diamond Square system:
void thecode ( void )
{
DiamondSquare ( 0,0,1024,1024,400,128 );
}
void DiamondSquare(unsigned x1, unsigned y1, unsigned x2, unsigned y2, float range, unsigned level)
{
if (level < 1) return;
// diamonds
for (unsigned i = x1 + level; i < x2; i += level)
{
for (unsigned j = y1 + level; j < y2; j += level)
{
float a = t.terrainmatrix[i - level][j - level];
float b = t.terrainmatrix[i][j - level];
float c = t.terrainmatrix[i - level][j];
float d = t.terrainmatrix[i][j];
float e = t.terrainmatrix[i - level / 2][j - level / 2] = (a + b + c + d) / 4 + ((float)Rnd(100) / 100.0f) * range;
}
}
// squares
for (unsigned i = x1 + 2 * level; i < x2; i += level)
{
for (unsigned j = y1 + 2 * level; j < y2; j += level)
{
float a = t.terrainmatrix[i - level][j - level];
float b = t.terrainmatrix[i][j - level];
float c = t.terrainmatrix[i - level][j];
float d = t.terrainmatrix[i][j];
float e = t.terrainmatrix[i - level / 2][j - level / 2];
float f = t.terrainmatrix[i - level][j - level / 2] = (a + c + e + t.terrainmatrix[i - 3 * level / 2][j - level / 2]) / 4 + ((float)Rnd(100) / 100.0f) * range;
float g = t.terrainmatrix[i - level / 2][j - level] = (a + b + e + t.terrainmatrix[i - level / 2][j - 3 * level / 2]) / 4 + ((float)Rnd(100) / 100.0f) * range;
}
}
DiamondSquare(x1, y1, x2, y2, range / 2, level / 2);
}
PC SPECS: Windows 8.1 Pro 64-bit, Intel Core i7-5930K (PASSMARK:13645), NVIDIA Geforce GTX 980 GPU (PASSMARK:9762) , 32GB RAM