Procedural Landmass Generation (E01: Introduction)
Why Stack Overflow recommends it
Stack Overflow users link it when asking about or answering Unity terrain generation, especially noise octaves, heightmaps and meshes, because it is the standard tutorial series they follow.
Recommended by 4 people across 4 different months, 2019 to 2024.
Why Game Development Stack Exchange recommends it
Game Development Stack Exchange answerers point people to it as a clear starting tutorial for procedural terrain and infinite world generation from noise.
Recommended by 3 people across 3 different months, 2018 to 2020.
What it is
The first episode of Sebastian Lague's Unity series on procedural landmass generation. It introduces layering several noise maps as octaves, with lacunarity controlling the frequency increase and persistence controlling the amplitude decrease, to get more natural-looking terrain.
What people said
Strong rec Jee · 2020-07 · Stack Overflow · on “Unity Terrain GameObject versus Custom Terrain”
I was recently exploring and working through parts of Sebastian Lague's Procedural Landmass Generation [this video] series. Absolutely excellent series and I would recommend it to anyone looking to learn more about Unity and Terrain in general. Anyways, I ran into a question that I can't seem to get an answer to. In his series, he walks the viewer through the process of making a Terrain asset in Unity from scratch. Therefore, almost entirely within your code, you're adding a mesh, textures, and adjusting the height and colors of the Terrain. All of which (correct me if I'm wrong) you can do with the Terrain Component on the built-in Unity Terrain GameObject, as seen in another tutorial I'm follow
Strong rec Krish Yadav · 2020-11 · Game Development Stack Exchange · on “Minecraft style world generation”
I would highly recommend you to watch Sam Hogan's I Made Minecraft in 24 Hours [LINK] . He has talked about how to procedurally generate trees and water, and also different terrain. And if you want to know more about Procedural Landmass Generation check out Sebastian Lague's playlist on Procedural Terrain Generation [this video] This is a part of the description from Sam's video which I think would be of help. It is like an overview of the video. I started off with basic terrain generation, using cube game objects arranged in a grid, whose heights are varied by a Perlin noise function. This, however, led to not great performance, but luckily I knew of a way to significantly optimize things. This
Recommends Dtb49 · 2018-05 · Game Development Stack Exchange · on “How can I make the terrain infinte?”
Take a look at this tutorial by Sebastian League. Procedural Terrain Generation is a pretty complicated process but this guy does a very good job explaining it. Link is Here [this video]
Recommends Nicholas Bucher · 2019-03 · Stack Overflow · on “What is the "correct" way of combining Voronoi Diagrams with Perlin Noise for Texture Generation?”
Most of the time when I've seen Voronoi algorithms in terrain generation, they're applied to a texture at runtime. Other types of noise can then be added/multiplied/etc to that texture to create a heightmap for your procedural terrain. If you have your Voronoi algorithm generating geometry already, one option is to make a shader for your terrain that samples Perlin noise in world space coordinates (this way you wouldn't run into any tiling issues on your polygonal mesh). If the noise was to be used as a heightmap, tesselation can increase your mesh resolution. However, if you haven't used shaders before you might see results faster using the texture approach. And it wouldn't make a lot of se
Recommends Nicholas Bucher · 2019-03 · Stack Overflow · on “Dynamic Multi-Dimensional array for 2D Procedural World Gen”
For your questions, 1) If you know the index of the element in the array, an array is fastest (O(1) time) . For example, if you're using world positions, you could use the floor of your world position coordinates for each voxel as their indices in the 3D array. Basically, when you generate your world from the 3D array, use the index as the world position and then you'll be able to find their indices in constant time with Math.floor(worldPosition) in your 3D array - this is the fastest. Dictionaries are faster than arrays when you're searching through an unsorted data structure without knowing the index . See here [LINK] for a picture (Dictionary lookups for an unsorted list are O(1), and arr
Recommends disc_code22 · 2019-11 · Game Development Stack Exchange · on “Generating lakes and rivers on 2D grid”
Searching for river generation on this same site turns up quite [a few good results], notably this answer has some good methods listed [LINK] Perlin noise is a good choice for terrain which is a continuous space, but for more discrete shapes like a river you may be better served by a different generation technique like a random walker [LINK] . You could give the random walker some rules to get a more river-like 2D shape, then overlay that onto your map. Alternatively since you have already generated some noise based terrain, you could modify the noise slightly so you get more low valleys and then add water to any area below a certain Y value, so the low points would all become rivers/lakes.
Recommends Christophe Roussy · 2019-12 · Stack Overflow · on “How does one get started with procedural generation?”
(More than 10 years later ...) Procedural generation only means that code is used to generate the data instead of it being hand made. For example if you want to generate a forest with various trees you are not going to design each tree by hand , thus coding is more efficient to generate the variations. It could be the generation of the tree graphics, size, structure, placement ... In general there is some kind of interation with a few rules , in addition to that you can add some randomness and logic of your own, combine all of these techniques ... Anything somewhat chaotic but not too chaotic can yield interesting results. Here are a few notable techniques: [LINK] [LINK] (notable cellular au
Recommends Smoothbrick578 · 2023-01 · Stack Overflow · on “Unity - How to create octaves in procedural terrain?”
I'm making procedural terrain generation for my Unity game, and I want to add octaves to my terrain to make it look more like in the image. How would I go about doing this? [LINK] Here is my code: using System.Collections; using System.Collections.Generic; using UnityEngine; [RequireComponent(typeof(MeshFilter))] public class MapGenerator : MonoBehaviour { Mesh mesh; Vector3[] vertices; int[] triangles; public int xSize = 20; public int zSize = 20; void Start() { mesh = new Mesh(); GetComponent<MeshFilter>().mesh = mesh; CreateShape(); UpdateMesh(); } void CreateShape() { vertices = new Vector3[(xSize + 1) * (zSize + 1)]; for (int i = 0, z = 0; z <= zSize; z++) { for (int x = 0; x <= xSize;
Cites atheer21 · 2019-10 · Stack Overflow · on “Unity mesh has black spots”
Hello I have followed a video series on YouTube made by Sebastian league on procedural generation and I have followed his whole video series, however on my part there are black spots in the mesh, only on water regions. I'm using global mode for those wondering, also using unity 2019.4.6f1. I want to get rid of the black spots have tried to build and run the and the blackspots were there. Link to his serie is: [this video] I have dowloaded his project on GitHub and he seems doesn't have a problem with here is his GitHub page: [LINK] Also here is a picture -> here [LINK] I'm creating my own custom shader for the terrain, here it is Shader "Custom/terrain" { // this properties will be added to our m
Cites filgas08 · 2020-08 · Stack Overflow · on “CS0161 C# '': not all code paths return a value”
I am getting this error: CS0161 C# '': not all code paths return a value. (I am using this videos if it can help you: [LINK] , [this video] , I am tring to use landmass color instead of gradient in planet) here is the code: public Texture2D TextureFromHeightMap(float[,] heightMap) { int width = heightMap.GetLength(0); int height = heightMap.GetLength(1); Texture2D texture = new Texture2D(width, height); Color[] colourMap = new Color[shapeSettings.planetRadius * shapeSettings.planetRadius]; for (int y = 0; y < minMax.Max; y++) { for (int x = 0; x < shapeSettings.planetRadius; x++) { for (int i = 0; i < y; i++) { colourMap[y * width + x] = Color.Lerp(Color.black, Color.white, heightMap[x, y]); } }