Big World vs Random Generated World

Which path would be the best to choose?

Creating a Big world with loads of different spawn would be easier than creating a world that is random generated. But whats the cons of doing that?

Im trying to create like a 2D game that is inspired by MineCraft and i can’t stop thinking about how i should solve “creating the world”

If i would create a realy big world with loads of spawns it would in the end serve the same purpose as a random generated world, But it feels like theres a catch to it all…

I was reading about Noise Maps and it seems realy overwhelming but is it worth to learn how to make and use them?

Someone could share their thoughts?

Randomly generated are potentially infinite and you can explore them until your cpu dies.
Designed worlds are definitely finite but potentially nothing (in that you have already explored everywhere)
If exploration is not your thing then fine. (But a game where you already know everything about it is not one I would play. It is imo why fps games are so profitable. You finish the game and cannot discover anything more so you have to buy the sequel. Notice that the differences between modern warfare 2 and 3 are mostly content)

you should research some more about perlin noise (just copy some code) and start playing with it.
Its overwhelming at first, but really worth it.

The problem with large (premade) land is the amount of work + saving the data + Its finite so players will start to regonise terrain after a while.
Just try to find out more about terrain generation.

I have been looking into Perlin Noise and Simplex Noise…

I understand the concept but it have a hard time to implement it in code…
When reading about Simplex Noise i heard its an upgraded and newer version… And all resources i find uses the same class… Should i just copy an enite class or create my own class ?

Here are the resources i found about SimplexNoise:
http://buddat.net/?p=96
http://staffwww.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf
https://code.google.com/p/toxiclibs/source/browse/trunk/toxiclibs/src.core/toxi/math/noise/SimplexNoise.java

As i said before, Should i just copy this entire class and implement it into my game or should i spend time to actualy create my own class that generates theese 2d landscapes which is shown in the 1st link… ?
Feels that im a little bit stupid if i can’t create my own Perlin Noise class :confused:

Suggestions please?
Also in the first link (http://buddat.net/?p=96)
I dont understand what he posted about his own map generation… I dont understand how i would implement that in my own code and make it draw like he got it to draw…
His code says double tile = SimplexNoise.noise(i / res, j / res); But what would i even use that for ? Tile Placement ?

depends on what you want.
You should jus copy the noise class, there is no use of creating one for your own if you dont know what it does.

when you got for example an 2d game where you want to create smooth hills you could do this for each pixel:
float value = SimplexNoise.noise(x / 1000, 0);
value would be beween -1 to 1, it seems useless but it isnt :).

if the hills need to be max 100 px, then you could just say fill pixels from y = 0 to y = value * 100 at each x value.

for(int x = 0; x < width; x ++){
    float height = 50 + SimplexNoise.noise(x / 1000, 0) * 50;
    
    for(int y = 0; y < height ; y ++){
        setRGB....
    }
}

This could create a image like this:

https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcTFQ4umpksAHHsVgWi-r74V1ijSzJ1Pae6hC0-3Yb1tfkau4Pfasw

https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcQgHVIVTUuCS5s5PVgQfCT4vtLIRvIHCTng5UMpNzLTcVDEnHlM

What if i wanted lets say use it to create an 2D island for a 2D top down rpg?

And then also having it help me create different kind of terrains like desert, woods, stones?
Instead of your example of creating hills (Which was not bad at all im realy happy with the knowledge you share)
Create something like this:

That is only an image i found on google to explain what im thinking, Hope u get an idea of what im trying to do :slight_smile:

Well im not really good with explaining, and the good people are not responding to this thread, so i guess ill give it another chance.

with your example you can see there are 2 coordinates to take accout of.
So going back to my loop:


for(int x = 0; x < width; x ++){
    for(int y = 0; y < height ; y ++){
        float value = SimplexNoise.noise(x / 1000, y / 1000);
        
        //Now you got some smooth noise for each block.
        //You could say something like this to add terrain

        if(value >= 0){
           //Add land
           
           if(value < 0.1f){
               //Shore
           }else if(value < 0.8f){
               //Grass
           }else{
               //Mountains?
           }

        }else{
            //Add water
        }
    }
}

This will give a basic impressen how to use the noise.
For best results you could use some mathemathical functions like abs / clamp / sqrt or even sin / cos to create diffrent looking noise.
Example:

float value = Math.sqrt(SimplexNoise.noise(x / 1000, y / 1000));

Also try using multiple generators with diffrent seeds.
Like one to create islands, one for terrain types, one for woods, mountains, rivers etc…

At last, im using the scale 1 / 1000 in my example, just try some other values to see what it does :).

Just try to make somethign from my example, and then try out some stuff.

In his example he uses:

SimplexNoise.genGrad(mapSeed);

What is it i would put in here? How does “seeding” work? What is it i want in there?

EDIT i figured it out myself…

Though i found another issue with my progress…
When i wanted to use this noise to create maps the maps doesn’t actualy make sense… The water and ground is just scattered all over the map there is no cordination or real terrain that is getting generated it all is just mashed up…
How would i solve this?

This is the code:


double value = SimplexNoise.noise(x , y);
				System.out.println(value);
				
				if(value >= 0){
					
					if(value <= 0.8f){
						level1[x][y] = 1;
					}
					else if(value <= 0.1f){
						level1[x][y] = 0;
					}
				}
				else{
					level1[x][y] = 2;
				}

level1 x y = 1 means green, 2 means blue, 0 means the magenta square i created.

And here is an image:

Think before you post :).

I told about the scale:
float value = SimplexNoise.noise(x / 1000, y / 1000);

the higher the divider, the more smooth terrain.
So dividing by one gives really raw (or even none) terrain.

BTW, this will not work:


               if(value <= 0.8f){
                  level1[x][y] = 1;
               }
               else if(value <= 0.1f){
                  level1[x][y] = 0;
               }

if an value is smaller then 0.8, its always smaller then 0.1, so it will never reach

level1[x][y] = 0;

Keep paying attention programming is not really forgiving on mistakes :slight_smile:

Using different thresholds gives different formations.

Higher thresholds give more island-y terrain.

Lower thresholds result in less water, including a point where water becomes lakes instead.

When i posted yesterday i was realy tired. Forgive my ignorance.
Reason i didn’t divide by 1000 is that all screen were green from grass… I guess that was the point, I will play more with this today.