3 ms·
I did this for a project a while back with reasonable results. The algorithm was this: Test each tile for distance to water (you don't have to get this absolut
by antimagic 11y ago
I did this for a project a while back with reasonable results. The algorithm was this:
Test each tile for distance to water (you don't have to get this absolutely perfect, just check in about 8 different directions from the centre of the tile). The closer the tile is to water, apply a scaling factor to the elevation, such that at MAX_DISTANCE you scale by 1, at 0 (water's edge) you scale by a factor of 0 (ie you will always have 0 elevation. The exact curve of the scaling factor can be played around with to give you sharper or smoother coastlines... You can even slowly vary the scaling function so that you can have everything from river deltas to cliffs in different parts of the world.