From 114c1631a8b954e5d3262fec1a3d3b7418863867 Mon Sep 17 00:00:00 2001 From: Jonathan Trottier Date: Mon, 27 Nov 2023 15:56:47 -0500 Subject: [PATCH 1/2] randomness no more random --- SQCSim-common/chunk.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/SQCSim-common/chunk.cpp b/SQCSim-common/chunk.cpp index 9fd6387..161775b 100644 --- a/SQCSim-common/chunk.cpp +++ b/SQCSim-common/chunk.cpp @@ -9,6 +9,10 @@ Chunk::Chunk(unsigned int x, unsigned int y, int64_t seed) : m_posX(x), m_posY(y //if (input.fail()) { OpenSimplexNoise::Noise simplex = OpenSimplexNoise::Noise(seed); m_blocks.Reset(BTYPE_AIR); + int ratio = 0; + + ratio = x * y % 7; + for (int ix = 0; ix < CHUNK_SIZE_X; ++ix) // Montagnes for (int iz = 0; iz < CHUNK_SIZE_Z; ++iz) { @@ -47,8 +51,8 @@ Chunk::Chunk(unsigned int x, unsigned int y, int64_t seed) : m_posX(x), m_posY(y } } - int rnd = rand() % 15; - if (rnd == 4) + //int rnd = rand() % 15; + if (ratio == 1) for (int ix = 0; ix < CHUNK_SIZE_X; ++ix) // structure for (int iz = 0; iz < CHUNK_SIZE_Z; ++iz) { for (int iy = 0; iy < 14; ++iy) { @@ -57,7 +61,7 @@ Chunk::Chunk(unsigned int x, unsigned int y, int64_t seed) : m_posX(x), m_posY(y Structure(ix, iy, iz, 2); } } - if (rnd == 3) + if (ratio == 3) for (int ix = 0; ix < CHUNK_SIZE_Z; ++ix) // structure for (int iz = 0; iz < CHUNK_SIZE_X; ++iz) { for (int iy = 0; iy < 14; ++iy) { @@ -66,7 +70,7 @@ Chunk::Chunk(unsigned int x, unsigned int y, int64_t seed) : m_posX(x), m_posY(y Structure(ix, iy, iz, 2); } } - if (rnd == 6) + if (ratio == 5) for (int ix = 0; ix < CHUNK_SIZE_X; ++ix) // structure for (int iz = 0; iz < CHUNK_SIZE_Z; ++iz) { for (int iy = 0; iy < 14; ++iy) { From 2f5579875e7425c6e7a914ea1e02c09c6e9477b3 Mon Sep 17 00:00:00 2001 From: Jonathan Trottier Date: Mon, 27 Nov 2023 15:57:31 -0500 Subject: [PATCH 2/2] little modif --- SQCSim-common/chunk.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SQCSim-common/chunk.cpp b/SQCSim-common/chunk.cpp index 161775b..9f2e6f7 100644 --- a/SQCSim-common/chunk.cpp +++ b/SQCSim-common/chunk.cpp @@ -67,7 +67,7 @@ Chunk::Chunk(unsigned int x, unsigned int y, int64_t seed) : m_posX(x), m_posY(y for (int iy = 0; iy < 14; ++iy) { if (iz == 4) if (GetBlock(ix, iy, iz) == BTYPE_AIR) - Structure(ix, iy, iz, 2); + Structure(ix, iy, iz, 1); } } if (ratio == 5)