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?