I’m working with perlin noise to get my random map generation working and i have seen some people use polygons along side perlin noise to get biome, any ideas/suggestions?
Biome*
Perlin* (actually Simplex most likely)
So you seem to have done some research, but yet are asking the nebulous question “any ideas/suggestions?”
What, game design ideas or suggestions? I don’t see how the question is relevant.
There are many ways in which one can simulate biomes.
I would start with the definition of what they are so you can understand what exactly it is you are trying to simulate: http://en.wikipedia.org/wiki/Biome
Then a quick google search reveals some techniques:
Elevation (from height map) + rainfall graph, grouped by polygonal regions:
http://www-cs-students.stanford.edu/~amitp/game-programming/polygon-map-generation/
Minecraft uses rainfall + temperature (similar to elevation): http://minecraft.gamepedia.com/Biome#Technical_Details
More conversation here, plus insight of using another noise function to create the biome regions (instead of say, polygons): http://gaming.stackexchange.com/questions/26531/how-do-minecraft-biomes-work
Thanks, thats great, im using the average hight of land to get rainfall and then using a heat map to get the other factor to work out the biomes
Sounds like you already have it figured out.
Just worked it out on what you said and i have started implementing it. Thanks man
What I plan to do is to make a method called genDesert() right and have it return a Tile[][] array and merge that array to where it should be in the map that is being drawn. Like this:
public Tile[][] genDesert(int width, int height) {
// return a new random tile array
}
public void generateWorld() {
for(int x = 0; x < map.WIDTH; x++) {
for(int y = 0; y < map.HEIGHT; y++) {
// Generate a desert
if(new Random().nextInt(2) == 0) {
Tile[][] desert = genDesert(5, 5);
for(int xx = x; xx < x+5; xx++) { // 5 Being the width of the biome
for(int yy = y; yy < y+5; yy++) { // 5 Being the height of the biome
map[x][y] = desert[xx][yy]; // Sets the game's map to the corresponding desert tile.
}
}
}
}
}
}
Other than that I wouldn’t know.
Yeah that would work but not for my game, i run on many tens of thousands of chunks in my random gen and the only way i could get it working is using heat maps and altitude maps to determine what biome there in
If you don’t mind could I see your source sometime? I’m really interested in all of this random generation stuff, and I’d love to learn from your code.
The trick to get easy procedural generation is totality and structuring things as functions of location.
Instead of your map being “an array of tiles”, it’s a function (which can be a composition of smaller functions, such as heat and elevation) from coordinates to tiles.
E.g.
fn terrain (x, y) -> Tile {
elevation = heightFunction(x, y); // has totality; not backed by an array or anything
// creating a constraint for only positive numbers or something
temp = heatFunction(x, y); // same here
biome = biomeMapping(elevation, temp);
tileType = tileTypeMapping(biome, elevation, temp); // grass? dirt? snow? etc.
return new Tile(tileType);
}
This is much nicer and easier to express in a functional language, but is still quite possible here and leads to highly extensible ways to create stuff like terrain.
You might notice that an array is a function from location to tiles, but it’s not easily extensible, and certainly not total.
Pay attention in math class kids!
Sure, im almost done with the tree gen and then ill send you the git info
Ok my git is https://github.com/4H1Z1/Horizon have fun! in the new build there is a bug where when the trees gen it will invoke chunks to be created but excuse that
Nomater what i try i cant seem to get the biomes right, i have looked and expended every reference i can find but i cant get it -.- so far this is what i have
whats not right about them? you might want to try adding some higher frequency noise to make the edges less smooth and more natural looking.
Yeah im still experimenting with the frequencies because atm it dose not look very…well natural
Do a search for something relevant to perturbation and turbulence. Theres some pages on marble and wood grain textures that might be of interest too.