OrderOfThePorcupine / ProjectPorcupine

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

Discussion: Map Generation #7

Closed BraedonWooding closed 7 years ago

BraedonWooding commented 7 years ago

Issue by WardBenjamin Friday Aug 19, 2016 at 18:47 GMT # Sample: Friday Sep 13, 2013 at 22:58 GMT Originally opened as https://github.com/TeamPorcupine/ProjectPorcupine/issues/306


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!

BraedonWooding commented 7 years ago

Comment by ghost Friday Aug 19, 2016 at 18:58 GMT # Sample: Friday Sep 13, 2013 at 22:58 GMT


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

BraedonWooding commented 7 years ago

Comment by bjubes Friday Aug 19, 2016 at 22:46 GMT # Sample: Friday Sep 13, 2013 at 22:58 GMT


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.

BraedonWooding commented 7 years ago

Comment by relinu Friday Aug 19, 2016 at 22:50 GMT # Sample: Friday Sep 13, 2013 at 22:58 GMT


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"

BraedonWooding commented 7 years ago

Comment by vogonistic Friday Aug 19, 2016 at 23:12 GMT # Sample: Friday Sep 13, 2013 at 22:58 GMT


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

BraedonWooding commented 7 years ago

Comment by WardBenjamin Saturday Aug 20, 2016 at 01:43 GMT # Sample: Friday Sep 13, 2013 at 22:58 GMT


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.

BraedonWooding commented 7 years ago

Comment by kd7uiy Monday Sep 05, 2016 at 14:54 GMT # Sample: Friday Sep 13, 2013 at 22:58 GMT


What is the status of this?

BraedonWooding commented 7 years ago

Comment by bjubes Tuesday Sep 06, 2016 at 12:34 GMT # Sample: Friday Sep 13, 2013 at 22:58 GMT


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.

BraedonWooding commented 7 years ago

Comment by koosemose Tuesday Sep 06, 2016 at 12:36 GMT # Sample: Friday Sep 13, 2013 at 22:58 GMT


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)

BraedonWooding commented 7 years ago

Comment by sboigelot Tuesday Sep 06, 2016 at 15:46 GMT # Sample: Friday Sep 13, 2013 at 22:58 GMT


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