TeamPorcupine / ProjectPorcupine

Project Porcupine: A Base-Building Game...in Space!
GNU General Public License v3.0
485 stars 278 forks source link

Discussion: Map Generation #306

Open WardBenjamin opened 8 years ago

WardBenjamin commented 8 years ago

Right now our map is generated exclusively with Unity's built-in Perlin noise. Perlin is pretty slow, compared to other coherent noise algorithms such as Simplex noise, and isn't really extensible.

I want to change our map generation to use LibNoise, a very nice noise library for C++ which Ricardo Mendez has made into an extremely nice Unity/C# port: ricardojmendez/LibNoise.Unity. Not only with this can we do fancy things like biomes, we can also layer LibNoise modules together to come up with some extremely cool terrain. Check out LibNoise Tutorial #5 for an example.

Are we in favor of this? Any other solutions?

Discuss!

ghost commented 8 years ago

Yes i was was thinking of a different method of doing this but your way sounds good also. I definitely think we need to have a very BASIC map generation incorporated. But also make it so it can be modded like the rest of the project

bjubes commented 8 years ago

whats the difference between perlin and the others? I know that most games use perlin (even minecraft, which has biomes and more) without issue. Plus if we use perlin, we can use the system.random class and seed it so that a seed will yield identical terrain across every install.

relinu commented 8 years ago

at the moment worldgenerator uses the unity mathf.perlinnoise but libnoise perlinnoise would be an improvement because you can add modules and can get a much better terrain also u can set a seed and dont need to use my temporary "fix"

vogonistic commented 8 years ago

ProjectPorcupine is GPL and LibNoise is LGPL. Can someone verify their compatibility?

WardBenjamin commented 8 years ago

LGPL is less restrictive than GPL, @vogonistic, so we should be good (it actually says something along those lines in our license file, iirc).

A little more detail about how LibNoise works for @bjubes:

You can either use Perlin or Simplex noise as the underlying algorithm, and both can be seeded like you mentioned. LibNoise has the advantage of 1) being able to use the faster Simplex noise and 2) having amazing module chaining, which lets you make some very cool terrain generation very easily, since you essentially just stick the modules together and then each one acts on the output of the previous one in the chain.

kd7uiy commented 8 years ago

What is the status of this?

bjubes commented 8 years ago

not sure. I still see perlin noise as a fine solution for now since it can be seeded and the seed can be hashed again to produce multiple layers if necessary. I wouldn't be against a different noise algorithm but no one seems to be implementing it atm.

koosemose commented 8 years ago

The current perlin leaves a lot to be desired, especially as it's 2D only, it's made worse with Z-Levels, there's no real connection between what's on one layer compared to another (I tried some hacky ways to fake it, but they were a stop-gap measure at best)

sboigelot commented 8 years ago

We should tackle it one day, but I really don't think this is an urgent issue. The map generation will also probably vary if we are in deep space, in an asteroid field, on a planet, etc...