Live data from Hacker News

Building an Infinite Procedurally-Generated World

spin.atomicobject.com

31–40 of 41 posts

Re: Building an Infinite Procedurally-Generated World

#31

How can we make realistic-looking continents? This project (and Minecraft, which looks similar, in virtue of using Perlin noise the same way) result in interesting and varied terrain for an RPG, but the terrain looks otherworldly or artificial if you zoom all the way out. The same variety that keeps the game from being boring when you're a human-sized observer makes it chaotic and noisy when you have a satellite's vi…

I did this for a project a while back with reasonable results. The algorithm was this: Test each tile for distance to water (you don't have to get this absolutely perfect, just check in about 8 different directions from the centre of the tile). The closer the tile is to water, apply a scaling factor to the elevation, such that at MAX_DISTANCE you scale by 1, at 0 (water's edge) you scale by a factor of 0 (ie you will always have 0 elevation. The exact curve of the scaling factor can be played around with to give you sharper or smoother coastlines... You can even slowly vary the scaling function so that you can have everything from river deltas to cliffs in different parts of the world.

Re: Building an Infinite Procedurally-Generated World

#32

Perlin Noise is a cheap way to get repeatable and smooth randomness but should just be one tool in a world generation toolbox. I think most infinite worlds quite quickly collapse in 'interestingness' because after travelling for a short while in any direction you quickly see that there is nothing new out there. So, instead of creating infinite worlds I'd like to see a lot more focus on procedurally-generating very in…

The game FUEL is a great example. The game covers 14,400 km² but doesn't repeat itself.

http://en.m.wikipedia.org/wiki/Fuel_(video_game)

Re: Building an Infinite Procedurally-Generated World

#33

Once you have access to random 2D data, it’s pretty straight forward to convert that noise into usable data. Simply set up thresholds for each tile type you want to support, eg: * water if = 0.3 and 0.6 I recommend leaving the upper and lower cases open. If they are not left open, you may end up with holes in your map for unexpectedly high or low values. An alternative is to clamp or scale the noise values when you g…

I like your idea here. I think the downside of this approach is you must scale your random data points by a scaling factor to get them in a known range.

Re: Building an Infinite Procedurally-Generated World

#34

Perlin Noise is a cheap way to get repeatable and smooth randomness but should just be one tool in a world generation toolbox. I think most infinite worlds quite quickly collapse in 'interestingness' because after travelling for a short while in any direction you quickly see that there is nothing new out there. So, instead of creating infinite worlds I'd like to see a lot more focus on procedurally-generating very in…

I agree that using one technique for an infinite world is probably going to get boring pretty quickly, and you can probably get more leverage out of a finite world.

But even with an infinite landscape, I think you could improve the variety by using a generator at different scopes - if your landscape is just one constant type of terrain, like a field, things will get boring. You might have a wide variety of rivers and trees, but the basic idea is the same. But if you have another generator controlling the terrain type - going between plains, desert, mountains, etc., that would be really interesting. At the small scope, variation in trees and water is still the same level of change, but there is also a larger scope that changes the overall feel at a much larger radius.

Re: Building an Infinite Procedurally-Generated World

#35
post #34

Perlin Noise is a cheap way to get repeatable and smooth randomness but should just be one tool in a world generation toolbox. I think most infinite worlds quite quickly collapse in 'interestingness' because after travelling for a short while in any direction you quickly see that there is nothing new out there. So, instead of creating infinite worlds I'd like to see a lot more focus on procedurally-generating very in…

I agree that using one technique for an infinite world is probably going to get boring pretty quickly, and you can probably get more leverage out of a finite world. But even with an infinite landscape, I think you could improve the variety by using a generator at different scopes - if your landscape is just one constant type of terrain, like a field, things will get boring. You might have a wide variety of rivers and…

Oh definitely. Minecraft does this in a simple but effective way. Though the interestingness of the landscape lasts until you've seen a few instances of each type, and then you have a model of the system in your mind, because it's just a few simple functions composed together. There is a lot of fun stuff to do so the terrain is only just the backdrop to that fun.

Instead of {noise(x,y)>0.5 = desert} let's simulate eons of weather, geological events, floods, and then feed that back into the lore of the game world. Dwarf Fortress is one of the few games I'm aware of that attempts this level of world generation. Unfortunately it's quite impenetrable as a game, due to its complexity.

Re: Building an Infinite Procedurally-Generated World

#36

Perlin Noise is a cheap way to get repeatable and smooth randomness but should just be one tool in a world generation toolbox. I think most infinite worlds quite quickly collapse in 'interestingness' because after travelling for a short while in any direction you quickly see that there is nothing new out there. So, instead of creating infinite worlds I'd like to see a lot more focus on procedurally-generating very in…

Heh. I agree, and I'm doing the same thing for my game.

As for Perlin noise, check out Simplex noise. It's what Perlin designed AFTER Perlin noise. I use 4D Simplex fractals to create my game world which tiles seamlessly when scrolling up/down as well as left/right. And I'm filling the world with random-but-connected cities, factions etc. That's where interesting emergent gameplay comes from.

BTW, I have a few writeups (quite technical) on the correct implementation of Simplex noise on spiralcode.wordpress.com

Re: Building an Infinite Procedurally-Generated World

#37
post #7

Earlier quoted context omitted.

In infinite generation, it's tricky to meaningfully do it. If you can constrain your space, I've had good luck with Voronoi generation and using those as continental plates. A little edge randomness, and I figure out what subducts, what separates, which plates are water and which plates aren't, and so on. Couple this with an iterative erosion mechanic and you can do some neat stuff. ("Look, this is Perlin noise" made…

Voronoi polygons as plates is probably going to be the best way for me to go - rather than adding a circle, we can just add the distance from the nearest "land" polygon, and sum the noise with that. It doesn't get us interesting geology (which it sounds like you're doing brilliantly) but it will avoid the thousands of little rivers without oceans that we see with straight Perlin noise.

Another way is to tile Simplex 4D fractals, with the different levels generating different scales of detail, then do erosion-by-way-of-flooding due to heightmap/rainshadow calculations.

Re: Building an Infinite Procedurally-Generated World

#38
post #19

Earlier quoted context omitted.

The last time I made a world generation algorithm for a voxel engine prototype I got reasonable results through the judicious combination of different types of noise, (specifically simplex, ridged and turbulence noise) and transforming the result using cubic hermite splines for added control, provided you are okay with generally only having one or two main continents (three and four do occur, but are much less common…

The downside of Simplex noise is that anything greater than 2D is patented: http://en.wikipedia.org/wiki/Simplex_noise There is another project called OpenSimplex that has similar results.

Not in europe :)

Re: Building an Infinite Procedurally-Generated World

#39

Earlier quoted context omitted.

Voronoi polygons as plates is probably going to be the best way for me to go - rather than adding a circle, we can just add the distance from the nearest "land" polygon, and sum the noise with that. It doesn't get us interesting geology (which it sounds like you're doing brilliantly) but it will avoid the thousands of little rivers without oceans that we see with straight Perlin noise.

Another way is to tile Simplex 4D fractals, with the different levels generating different scales of detail, then do erosion-by-way-of-flooding due to heightmap/rainshadow calculations.

That's a really interesting idea, but I'm having trouble visualizing it. Have an example in action?

Re: Building an Infinite Procedurally-Generated World

#40

Perlin Noise is a cheap way to get repeatable and smooth randomness but should just be one tool in a world generation toolbox. I think most infinite worlds quite quickly collapse in 'interestingness' because after travelling for a short while in any direction you quickly see that there is nothing new out there. So, instead of creating infinite worlds I'd like to see a lot more focus on procedurally-generating very in…

Heh. I agree, and I'm doing the same thing for my game. As for Perlin noise, check out Simplex noise. It's what Perlin designed AFTER Perlin noise. I use 4D Simplex fractals to create my game world which tiles seamlessly when scrolling up/down as well as left/right. And I'm filling the world with random-but-connected cities, factions etc. That's where interesting emergent gameplay comes from. BTW, I have a few writeu…

Nice! I really like the art style; but isn't >2D Simplex noise patented?
Post reply on HN