so I’m making world generation in gdevelop by watching tutorials but I have tile randomly spawn where I don’t want it to be, for example sometimes diamonds spawn on the surface and instead I only want grass to spawn on the surface or dirt exposed to air, and I want stone to spawn a bit deeper like several blocks below the surface and maybe diamonds spawn like 30 blocks below the surface and then bedrock spawn all the way at the bottom
I think the problem is with the Noise2d usage. This is a Simplex‑style gradient noise algorithm, kind-of like Perlin noise. It’s a way to make smooth, natural randomness that changes gently instead of jumping around. Think of it like a landscape littered with smooth hills.
The opacity is set by the height of the hill values. Using the image below, if each pixel represents a block then the brightness represents the opacity of each block. And the opacity determines the type of block.
Take a horizontal line anywhere in that picture and imagine that’s the top row of tiles. This means the top row of tiles are also of various opacity and will be replaced with a different block depending on each tile’s opacity.
Instead, consider setting the surface tiles first (grass or dirt) and deleting the placeholder red tiles that they replace.
Then work with the remaining tiles, which will be all those below the top row.
Add events with conditions:
if the Tile.Y() > Origin.Y() + 64 * 3 and opacity > 210 create a stone.
and another
if the Tile.Y() > Origin.Y() + 64 * 30 and opacity <20 create a diamond.
BTW, those world generation and building events are being run every single game frame. I’m assuming it’s meant to be run once at the start of the scene. If so, drag them across to the right so they become subevents of the second “At the beginning of scene” event.

