Skip to content

Commit 0aa184a

Browse files
committed
Add code ensuring square patterns after CA filters
The Cellular Automata filters turned the blocky/square elevation patterns into rounded patterns. Adding new code to ensure that the squareness of the numbers is reverted before tile placement. Hydrology code causes the landscape to become blotchy & unusable. A new hydrology system will need to be implemented to resolve the path creation system.
1 parent fc14ad7 commit 0aa184a

File tree

4 files changed

+241
-140
lines changed

4 files changed

+241
-140
lines changed

demo/TerrainTiles/Grid_Meshes_Loader.tscn

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,24 @@
1212
[node name="GridMeshesLoader" type="Node3D"]
1313

1414
[node name="Water" parent="." instance=ExtResource("1_psiup")]
15+
visible = false
1516

1617
[node name="Water_Corner" parent="." instance=ExtResource("2_3qame")]
18+
visible = false
1719

1820
[node name="Water_Edge" parent="." instance=ExtResource("3_cypba")]
21+
visible = false
1922

2023
[node name="Grass" parent="." instance=ExtResource("4_l5paj")]
24+
visible = false
2125

2226
[node name="Ramp" parent="." instance=ExtResource("5_0tn13")]
2327

2428
[node name="Ramp_Corner" parent="." instance=ExtResource("6_21lxm")]
29+
visible = false
2530

2631
[node name="Cliffs" parent="." instance=ExtResource("7_1ubri")]
32+
visible = false
2733

2834
[node name="Cliffs_Corner" parent="." instance=ExtResource("8_2ix0w")]
35+
visible = false

demo/terrain_gen_script.gd

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func _ready():
1919
#generate(grid_map, 128, 128, 4, seed_value, 12, NoiseType.VALUE, 0.79, 0.1);
2020

2121
# Simplex Noise Based
22-
var result: Dictionary = generate(grid_map, 128, 128, 4, seed_value, 12, NoiseType.SIMPLEX, 0.3, 0.2, 0.02);
22+
var result: Dictionary = generate(grid_map, 128, 128, 4, seed_value, 12, NoiseType.SIMPLEX, 0.6, 0.01, 0.02);
2323

2424
#
2525
#
@@ -28,14 +28,14 @@ func _ready():
2828
# Returns World Points for object placement
2929
#
3030

31-
var elevation_map: Array = result["elevationMap"]
32-
print("Elevation at (0,0): ", elevation_map[0][0])
33-
34-
var flat_zones: Array = result["flatZones"]
35-
for zone in flat_zones:
36-
print("Flat zone at (%d, %d) with elevation %d" % [zone["x"], zone["y"], zone["elevation"]])
37-
38-
# Access Poisson samples
39-
var poisson_points: Array = result["poissonPoints"]
40-
for point in poisson_points:
41-
print("Poisson sample at: ", point)
31+
#var elevation_map: Array = result["elevationMap"]
32+
#print("Elevation at (0,0): ", elevation_map[0][0])
33+
#
34+
#var flat_zones: Array = result["flatZones"]
35+
#for zone in flat_zones:
36+
#print("Flat zone at (%d, %d) with elevation %d" % [zone["x"], zone["y"], zone["elevation"]])
37+
#
38+
## Access Poisson samples
39+
#var poisson_points: Array = result["poissonPoints"]
40+
#for point in poisson_points:
41+
#print("Poisson sample at: ", point)

funding.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
github: kthecoder
2+
ko_fi: aveyrin
3+
patreon: aveyrin

0 commit comments

Comments
 (0)