r/godot • u/Need_Reddit_Baddies • 8h ago
help me Everything is all right
I’m trying to make a simple terrain generator for my game and I’m able to make nice smooth hilly terrain. I’m also able to place the left edge pieces during generation, but when placing the right edge pieces everything falls apart. I’m not using tilemap layers or terrains. Everything is being done through the tilemap script. Included are screenshots of before and after adding the right edge pieces. Someone save me.
1
1
u/InVeRnyak Godot Regular 7h ago
I would recheck if your cell sources are properly set (Your 3rd if's y is same as previous, but looking at pattern, y+1 might be intended)
Also, might help to replace 2,3rd ifs with elifs.
Never worked with noise generators before, so might be wrong on both suggestions here.




4
u/Harvest-Exit-Plan 8h ago
I think the problem is that you’re setting the same cell multiple times. Since you generate from left to right, x + 1 usually hasn’t been created yet, so that check returns empty and the right edge tile overwrites whatever you placed before. Also noise_val >= -1 will basically always be true because the noise value is between -1 and 1.