Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added get_noise_1d #26634

Merged
merged 1 commit into from
Apr 6, 2019
Merged

Added get_noise_1d #26634

merged 1 commit into from
Apr 6, 2019

Conversation

psuhas77
Copy link
Contributor

@psuhas77 psuhas77 commented Mar 5, 2019

Referencing #26457 . Although it seems trivial, it would be useful to have a get_noise_1d() function to build procedurally generated heightmaps ( used in 2D games like Terraria or Worms). This can be used directly without needing to understand how to generate it through get_noise_2d().

Bugsquad edit: Fixes #26457.

@psuhas77 psuhas77 force-pushed the patch-3 branch 2 times, most recently from 9d25dd2 to c170f70 Compare March 5, 2019 14:50
@OvermindDL1
Copy link

Except as one value to the noise generator is always the 'seed' in essence, this is actually more of a 0d noise generator, it is useful for getting a single value from a single seed, I.E. it will always generate the exact same map every single time since there is no seed to adjust it.

@psuhas77
Copy link
Contributor Author

psuhas77 commented Mar 5, 2019

I'm not quite sure what you mean, you can change the seed and it generates a different map. Like this.

@OvermindDL1
Copy link

OvermindDL1 commented Mar 5, 2019

Wait what on earth?! First time I looked at this code (still been using my C code) and the implementation seems... very inefficient...

In addition, the 'seed' doesn't look strictly like a seed for the noise but rather a seed for the permutation array that is used by the noise generator, which is not the same thing as an individual value's seed.

EDIT: In addition it seems the current generator is limited to only 4d, which is exceptionally limiting in many situations (I tend to end up using no less than 6d, on occasion I've hit more, although with the current implementation it is not super efficient as it stands though...).

@akien-mga akien-mga added this to the 3.1 milestone Mar 5, 2019
@Chaosus
Copy link
Member

Chaosus commented Mar 5, 2019

@OvermindDL1 well, you always can contribute to make it better

@psuhas77
Copy link
Contributor Author

psuhas77 commented Mar 5, 2019

Isn't that how Simplex noise work though. It permutes the grid values, otherwise it would have to generate too many values.

@OvermindDL1
Copy link

Isn't that how Simplex noise work though. It permutes the grid values, otherwise it would have to generate too many values.

Should always have a permutation array, but the permutation array is not necessarily for a seed adjustment but rather to find a good set of default data that generates 'good' noise. A bad permutation array can make noise that has lines or noticeable repeats. The 'seed' for a given value, like for a simple 1d heightmap you'd use, say, the X value for the seed for unique generation and the Y for the value 'along' the world to generate an output height value.

@JFonS
Copy link
Contributor

JFonS commented Mar 5, 2019

@OvermindDL1 Godot's simplex noise implementation uses a slightly modified version of https://github.com/smcameron/open-simplex-noise-in-c, you can find it here.

If you can provide a better implementation, it would be a nice addition to the engine.

@akien-mga akien-mga modified the milestones: 3.1, 3.2 Mar 5, 2019
@reduz
Copy link
Member

reduz commented Apr 4, 2019

i think this is good enough and should be mergeable

@akien-mga akien-mga merged commit 87ee2a9 into godotengine:master Apr 6, 2019
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants