How can I RANDOMLY create a good world?

Hello,
I’m making a sandbox game in unity and I want to create a good random world.

I tried making a random world but the output was looking like this.

I want to create a world with mountains and hills and etc.

Mountains can be made with stone and hills can be made with grass etc.

I store my blocklist in a dictionary(string, int).

My current block creation code is this:

    void Addblock(Vector3 vctr, int blockidd)
    {
        blockbyid.TryGetValue(blockidd, out blocktoput);

        if (blocktoput.tag == "BlockDoor")
        {
            vctr += new Vector3(0.0f, 0.0f, 1.0f);
        }

        lastblock = Object.Instantiate(blocktoput, vctr, Quaternion.identity) as GameObject;
    }

Here are my block ids(can add more, no problem):

1: white test block
2: red test block
3: door
4: ladder
5: wood
6: dirt
7: grass
8: plank
9: stone
10: brick
11: sand
12: leaves

How can I create an algoritm to create a flatland and make it randomly add stuff to it?
Also, I want to give seeds to make it create stuff randomly, can I do that?

This is best placed in the unity forums; unity answers is for answering code problems.

Here’s what I’ll add:

In order to make a flatland, you would want to use Addblocks at position 0 for grass, Addblocks at position -1 for stone, and so on… using a loop. Of course, you probably want an infinitely generated universe, so you would generate these every time you get within a certain distance of them.

I would recommend trying to make a loop to make a single chunk and then figure it out from there. :wink: