improve generate tilemap with perlin noise

Hi, I am fiddling with perlinnoise to generate a tilemap using the following code:
i want the map to contain mostly green tiles, and blobs here and there of resources iron , copper etc…

using UnityEngine;
using System.Collections;

public class SpawnGrid : MonoBehaviour 
{
	[Range(0.1f,100f)]
	public float seedX, seedY;

	public GameObject gridTile;
	public float gridX, gridY, perlinThresholdiron, perlinThresholdcoal, perlinThresholdcopper, perlinThresholdstone;

	void Start () 
	{
		for (float x = -gridX; x < gridX; x += 0.1f) 
		{
			for (float y = -gridY; y < gridY; y += 0.1f) 
			{
				Vector3 spawnPos = new Vector3(x*10,y*10,0);
				GameObject tile = Instantiate(gridTile,spawnPos,Quaternion.identity) as GameObject;

				SpriteRenderer rend = 			tile.GetComponent<SpriteRenderer>();
				TileController tileController = tile.GetComponent<TileController>();

				float perlinNum = Mathf.PerlinNoise(x/seedX, y/seedY); 

				if (perlinNum < perlinThresholdiron) 
				{
					rend.color = Color.gray;
					tileController.isResource = true;
					tileController.tileType = ResourceType.iron;

				}
				else if (perlinNum > perlinThresholdiron && perlinNum < perlinThresholdcoal) 
				{
					rend.color = Color.black;
					tileController.isResource = true;
					tileController.tileType = ResourceType.coal;
				}
				else if (perlinNum > perlinThresholdcoal && perlinNum < perlinThresholdcopper) 
				{
					rend.color = Color.yellow;
					tileController.isResource = true;
					tileController.tileType = ResourceType.copper;
				}
				else if (perlinNum > perlinThresholdcopper && perlinNum < perlinThresholdstone) 
				{
					rend.color = Color.blue;
					tileController.isResource = true;
					tileController.tileType = ResourceType.stone;
				}
				else 
				{
					rend.color = Color.green;
				}
			}
		}
	}
}

I can move the seedX and Seedy sliders around to genrate different patterns,
but they are always very repetitive and the resources are always “surrounding” eachother:


how can i change this code so that it generates blobs of resources of random size/shape
(think factorio)

hope you guys understand what im trying to do

Perlin Noise and most noise generating functions are very repetitious by nature. However, in order to get the random-looking patterns Perlin Noise is known for (the “clouds” effect) you’ll need to use Fractional Brownian Noise, which is a long name for adding Perlin a bunch of times, each time with a higher frequency and lower amplitude. This answer has a lot of good info and resources on Perlin Noise in general if you’re interested in learning more about it and FBN.

For your application you can sum together several functions of PerlinNoise (to taste, it will take some experimentation) but as you have it now I believe you’ve got the use of the function wrong. Mathf.PerlinNoise gets the x and y value of a 2d perlin noise result. To modify the amplitude of that you’d just multiply a constant times the function as a whole, as if you were changing the ‘height’. For the frequency you’d multiply x and y by a constant, in effect determining how close successive values are to each other. And for the random seed you would add a constant to each x and y based on your seed to offset the 2d lookup for each unique value. So it looks like this:

Perlin Noise = Amplitude * Mathf.PerlinNoise(Frequency * x + Seed, Frequency * y + Seed)

In short, sum up a bunch of the above with increasing frequency and decreasing amplitude and you should see something like the effect you’re after. As an aside, note that Perlin Noise is not the most efficient method of random generation so if performance is a factor you might want to consider a custom implementation over Unity’s function.