Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (498)
Games in Android Showcase (117)
games submitted by our members
Games in WIP (563)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Big World vs Random Generated World  (Read 2039 times)
0 Members and 1 Guest are viewing this topic.
Offline Rakso

Junior Member


Medals: 1



« Posted 2013-05-04 11:07:41 »

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?
Offline quew8

JGO Coder


Medals: 29



« Reply #1 - Posted 2013-05-04 12:51:03 »

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)
Offline RobinB

JGO Ninja


Medals: 44
Projects: 1
Exp: 3 years


Spacegame in progress


« Reply #2 - Posted 2013-05-04 13:00:11 »

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.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Rakso

Junior Member


Medals: 1



« Reply #3 - Posted 2013-05-06 15:42:19 »

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 :/

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 ?
Offline RobinB

JGO Ninja


Medals: 44
Projects: 1
Exp: 3 years


Spacegame in progress


« Reply #4 - Posted 2013-05-06 16:46:58 »

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 Smiley.


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.

1  
2  
3  
4  
5  
6  
7  
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:


Offline Rakso

Junior Member


Medals: 1



« Reply #5 - Posted 2013-05-06 19:45:06 »

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 Smiley
Offline RobinB

JGO Ninja


Medals: 44
Projects: 1
Exp: 3 years


Spacegame in progress


« Reply #6 - Posted 2013-05-06 21:22:09 »

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:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
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:
1  
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 Smiley.

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

Junior Member


Medals: 1



« Reply #7 - Posted 2013-05-08 20:01:25 »

In his example he uses:
1  
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:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
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:
Offline RobinB

JGO Ninja


Medals: 44
Projects: 1
Exp: 3 years


Spacegame in progress


« Reply #8 - Posted 2013-05-09 06:38:19 »

Think before you post Smiley.

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:
1  
2  
3  
4  
5  
6  
               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
1  
level1[x][y] = 0;


Keep paying attention programming is not really forgiving on mistakes Smiley
Offline HeroesGraveDev

JGO Kernel


Medals: 254
Projects: 11
Exp: 2 years


┬─┬ノ(ಠ_ಠノ)(╯°□°)╯︵ ┻━┻


« Reply #9 - Posted 2013-05-09 06:42:15 »

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.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Rakso

Junior Member


Medals: 1



« Reply #10 - Posted 2013-05-09 07:03:54 »

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.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Grunnt (18 views)
2014-09-23 14:38:19

radar3301 (14 views)
2014-09-21 23:33:17

BurntPizza (31 views)
2014-09-21 02:42:18

BurntPizza (22 views)
2014-09-21 01:30:30

moogie (20 views)
2014-09-21 00:26:15

UprightPath (29 views)
2014-09-20 20:14:06

BurntPizza (33 views)
2014-09-19 03:14:18

Dwinin (48 views)
2014-09-12 09:08:26

Norakomi (75 views)
2014-09-10 13:57:51

TehJavaDev (105 views)
2014-09-10 06:39:09
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!