Skip to content

Commit b6de727

Browse files
committed
Change Hydrology to Height Map
Hydrology used raw noise which caused the river system to not produce river's and basins across the entire map. By switching the Hydrology code to height map we can achieve walkable pathing across the entire terrain set.
1 parent 7432f1e commit b6de727

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

src/TerrainGen/Terrain_Gen.cpp

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ Dictionary TerrainGen::generate(
494494

495495
for (int x = 1; x < widthx2 - 1; x++) {
496496
for (int y = 1; y < heightx2 - 1; y++) {
497-
float currentElevation = rawNoise[x][y];
497+
float currentElevation = heightMap[x][y];
498498
float lowestElevation = currentElevation;
499499
int targetX = x;
500500
int targetY = y;
@@ -507,7 +507,7 @@ Dictionary TerrainGen::generate(
507507

508508
int nx = x + dx;
509509
int ny = y + dy;
510-
float neighborElevation = rawNoise[nx][ny];
510+
float neighborElevation = heightMap[nx][ny];
511511

512512
if (neighborElevation < lowestElevation) {
513513
lowestElevation = neighborElevation;
@@ -1217,14 +1217,13 @@ Dictionary TerrainGen::generate(
12171217

12181218
// Decide which tile types count as "edge" for the current corner type
12191219
auto is_edge_for_corner = [&](TileType t) -> bool {
1220-
return t == RAMP || t == WATER_EDGE || t == CLIFF;
1221-
// if (tile_id == WATER_CORNER) {
1222-
// return t == WATER_EDGE;
1223-
// } else if (tile_id == CLIFF_CORNER) {
1224-
// return t == CLIFF;
1225-
// } else {
1226-
// return t == RAMP;
1227-
// }
1220+
if (tile_id == WATER_CORNER) {
1221+
return t == WATER_EDGE;
1222+
} else if (tile_id == CLIFF_CORNER) {
1223+
return t == CLIFF;
1224+
} else {
1225+
return t == RAMP;
1226+
}
12281227
};
12291228

12301229
// Convenience flags for cardinal neighbors

0 commit comments

Comments
 (0)