Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (538)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (600)
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  
  Biomes and their generation within?  (Read 1074 times)
0 Members and 1 Guest are viewing this topic.
Offline roseslayer

Junior Devvie


Medals: 2



« Posted 2013-10-01 15:14:17 »

Well hello there, JGO!

This month I am doing stuff and experimenting on level generation. I am currently using Perlin Noise as generation for the landscape and it just looks like Perlin Noise (obviously).. So I am searching all about a biomes on the internet. On JGO there are no "good" posts about Biomes and generation, you are only able to find to-do lists like:

Quote
To-Do list:
-Biomes added.

So I started to search on google, but every topic about Biomes are modding-topics for MineCraft... After some time I found some good posts: How do MineCraft biomes work? and Voronoi diagram.

But the first link is more like how to do it right without a tutorial on how to do it.
And the second link is about the Voronoi Diagram. I can't see, how I can generate rivers (small/streched) and oceans (big/not streched). Because If you use this methode you can only make biomes from the same length?

So my question is: What would be a good methode for Biomes (and their generation in the biomes)?
As you can see my English isn't that good, so I do not understand the Voronoi Diagram fully.

I already thank you for reading this post!
-RoseSlayer

Fundamentum W.I.P.
Offline Mac70
« Reply #1 - Posted 2013-10-01 15:25:36 »

My way of generation of 2d map:

1. generate heightmap using simplex noise
2. place basic, height-based biomes (sea, mountains and null - the last one for all future biomes)
3. generate lakes (check random points, "fill" them with water, if lake is big enough and not too big apply changes to map)
4. generate rivers (check random points, use A* alghoritm without end point - first reached tile with sea/lake will generate river - use height as heuristics)
5. generate temperature and rainfall
6. generate another biomes to replace null biome

A* can generate really good rivers very fast. Smiley

Check out my Devblog! Smiley
Offline roseslayer

Junior Devvie


Medals: 2



« Reply #2 - Posted 2013-10-01 15:28:41 »

My way of generation of 2d map:

1. generate heightmap using simplex noise
2. place basic, height-based biomes (sea, mountains and null - the last one for all future biomes)
3. generate lakes (check random points, "fill" them with water, if lake is big enough and not too big apply changes to map)
4. generate rivers (check random points, use A* alghoritm without end point - first reached tile with sea/lake will generate river - use height as heuristics)
5. generate temperature and rainfall
6. generate another biomes to replace null biome

A* can generate really good rivers very fast. Smiley

Oops, forgot to say that it was 2d. Thanks for the answer It really help me (and maybe others that are using the searchbar on JGO). Thanks for helping me. I know what to do and now can do some work again!~

-RoseSlayer

Fundamentum W.I.P.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Mac70
« Reply #3 - Posted 2013-10-01 15:31:54 »

I recommend this library for simplex noise: https://github.com/matheus23/Utils. Wink

Check out my Devblog! Smiley
Offline roseslayer

Junior Devvie


Medals: 2



« Reply #4 - Posted 2013-10-02 13:28:46 »

My way of generation of 2d map:

3. generate lakes (check random points, "fill" them with water, if lake is big enough and not too big apply changes to map)

How is it possible to generate lakes? I can generate a single point good, but how can I make multiple points? They are also made "on the fly", so I can't edit them because that will give an error if I try to edit a tile with a higher x, y... and because I am making them "on the fly", I can't generate with: generation = new Random(this.seed);, because if I visit other chunks first, they have the generation.nextInt(1000)  <= 1.. So it will only work If I walk 1 direction. :/ any suggestions? generation = new Random(this.seed + x*16 + y*16) works fine..

-RoseSlayer

Fundamentum W.I.P.
Offline opiop65

JGO Kernel


Medals: 160
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #5 - Posted 2013-10-02 14:33:07 »

Just generate a few points around the center of the "lake". You could use the radius to generate a smooth lake shore, or you could you use radius and a random number to add/subtract to the radius to generate rough shores. Personally, I would create a temporary list of these point and assign an idea according to when they were generated, so like "p1, p2" etc... So then you could just use the Pythagorean theorem and connect the point in order. "p1" to "p2"... Then delete the points and fill in the lake by using two for loops for the x and z axis. The water should then fall and fill the z axis. That's how I would do it, I don't know if it wouldn't work for you however.

Offline Mac70
« Reply #6 - Posted 2013-10-02 14:38:47 »

My way of generation of 2d map:

3. generate lakes (check random points, "fill" them with water, if lake is big enough and not too big apply changes to map)

How is it possible to generate lakes? I can generate a single point good, but how can I make multiple points? They are also made "on the fly", so I can't edit them because that will give an error if I try to edit a tile with a higher x, y... and because I am making them "on the fly", I can't generate with: generation = new Random(this.seed);, because if I visit other chunks first, they have the generation.nextInt(1000)  <= 1.. So it will only work If I walk 1 direction. :/ any suggestions? generation = new Random(this.seed + x*16 + y*16) works fine..

-RoseSlayer

In my generators I often use rule "fill everything around selected point if altitude of this points is lower than the starting one".

Check out my Devblog! Smiley
Offline roseslayer

Junior Devvie


Medals: 2



« Reply #7 - Posted 2013-10-02 14:59:39 »

Just generate a few points around the center of the "lake". You could use the radius to generate a smooth lake shore, or you could you use radius and a random number to add/subtract to the radius to generate rough shores. Personally, I would create a temporary list of these point and assign an idea according to when they were generated, so like "p1, p2" etc... So then you could just use the Pythagorean theorem and connect the point in order. "p1" to "p2"... Then delete the points and fill in the lake by using two for loops for the x and z axis. The water should then fall and fill the z axis. That's how I would do it, I don't know if it wouldn't work for you however.

Great idea, I will implement some pieces of this, probably I am now going to make somesort of this...

In my generators I often use rule "fill everything around selected point if altitude of this points is lower than the starting one".

The only problem in my generation script is that the flat land is always on the side of a hill.. So evrything will flood entirely if I am making a lake on the top of a mountain? the height is always "climbing".. (still using Perlin Noise, because I am lazy Tongue)

-RoseSlayer

Fundamentum W.I.P.
Offline roseslayer

Junior Devvie


Medals: 2



« Reply #8 - Posted 2013-10-11 14:37:32 »

5. generate temperature and rainfall

I made a perlin Noise to generate the temperature and rainfall, but there is a low chance it reaches 100%, my  code for perlin Noise is:
1  
2  
int temperatureNoise = (int)(noises.get(1).noise(x/(biomelength*3), y/(biomelength*3)) * 100) + 50;
int rainfallNoise = (int)(noises.get(2).noise(x/(biomelength*3), y/(biomelength*3)) * 100) + 50;


What is a better way to make a biome better (And I want to have a feature where u can change to times u will come across this biome. Lets say: I want 20% chance to get a desert and 1% to get a swamp. Is there a good way I can implement this in the rainfall and temperature generator?

Fundamentum W.I.P.
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.

rwatson462 (29 views)
2014-12-15 09:26:44

Mr.CodeIt (20 views)
2014-12-14 19:50:38

BurntPizza (40 views)
2014-12-09 22:41:13

BurntPizza (75 views)
2014-12-08 04:46:31

JscottyBieshaar (37 views)
2014-12-05 12:39:02

SHC (50 views)
2014-12-03 16:27:13

CopyableCougar4 (46 views)
2014-11-29 21:32:03

toopeicgaming1999 (113 views)
2014-11-26 15:22:04

toopeicgaming1999 (100 views)
2014-11-26 15:20:36

toopeicgaming1999 (30 views)
2014-11-26 15:20:08
Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

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
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!