Page MenuHomeWildfire Games

Add perlin noise generator.
AcceptedPublic

Authored by nani on Sep 22 2018, 12:59 AM.

Details

Reviewers
FeXoR
Angen
Summary

Returns a value of perlin noise given a point.

Test Plan

Used in D1633

Diff Detail

Repository
rP 0 A.D. Public Repository
Branch
/ps/trunk
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 10260
Build 17440: arc lint + arc unit

Event Timeline

nani created this revision.Sep 22 2018, 12:59 AM
nani created this object with visibility "No One".
nani edited the test plan for this revision. (Show Details)Sep 22 2018, 5:48 PM
nani changed the visibility from "No One" to "Public (No Login Required)".Sep 22 2018, 5:53 PM
elexis edited the test plan for this revision. (Show Details)Mar 24 2019, 8:20 PM
FeXoR added a reviewer: FeXoR.Nov 30 2019, 1:29 PM
FeXoR added inline comments.Nov 30 2019, 2:19 PM
binaries/data/mods/public/maps/random/rmgen/PerlinNoise.js
3 ↗(On Diff #6891)

It's not a point, it's vector2d. (Widely used inaccuracy, I know, but please change the description to tell that)

FeXoR requested changes to this revision.Nov 30 2019, 8:21 PM

See IRC for improvements: http://irclogs.wildfiregames.com/2019-11/2019-11-30-QuakeNet-%230ad-dev.log starting with "12:30 < FeXoR> ...so on to D1630 I guess ^^"

This revision now requires changes to proceed.Nov 30 2019, 8:21 PM
nani updated this revision to Diff 10523.Dec 7 2019, 10:41 PM
nani edited the summary of this revision. (Show Details)
nani edited the test plan for this revision. (Show Details)
Owners added a subscriber: Restricted Owners Package.Dec 7 2019, 10:41 PM
nani edited the summary of this revision. (Show Details)Dec 7 2019, 10:50 PM
FeXoR accepted this revision.Dec 8 2019, 12:11 PM

Good to go I guess, thanks for the changes! :)

This revision is now accepted and ready to land.Dec 8 2019, 12:11 PM
FeXoR added a comment.Dec 8 2019, 12:25 PM

@"let weight = multiplier;":
Shouldn't waight start at 1 and then be reduced each iteration?

nani added a comment.Dec 8 2019, 6:09 PM
In D1630#102908, @FeXoR wrote:

@"let weight = multiplier;":
Shouldn't waight start at 1 and then be reduced each iteration?

True.

nani updated this revision to Diff 10537.Dec 8 2019, 6:26 PM
Angen added a subscriber: Angen.Dec 9 2019, 12:22 PM

I have no idea about math behind this but code looks good so nice job :)

I have just small safety reminder (you are free to ignore it)

would be nice to make check for scale == 0 or iterations == 0 and early return 0 and maybe log error ?
just safe guard against division by 0 :)

nani updated this revision to Diff 10544.Dec 9 2019, 7:44 PM

Added safeguard.

nani updated this revision to Diff 10545.Dec 9 2019, 7:45 PM

Move safeguard to top.

Angen requested changes to this revision.Dec 9 2019, 7:53 PM
Angen added inline comments.
binaries/data/mods/public/maps/random/rmgen/perlinNoise.js
12

iterations <= 0 :)

This revision now requires changes to proceed.Dec 9 2019, 7:53 PM
nani updated this revision to Diff 10546.Dec 9 2019, 8:13 PM

Fix safeguard.

nani marked an inline comment as done.Dec 9 2019, 8:13 PM
Angen accepted this revision.Dec 9 2019, 8:15 PM
This revision is now accepted and ready to land.Dec 9 2019, 8:15 PM
smiley added a subscriber: smiley.Dec 12 2019, 7:36 AM
smiley added inline comments.
binaries/data/mods/public/maps/random/rmgen/perlinNoise.js
21

This is really not perlin noise now. Perlin noise implies gradient noise.

I suggest renaming this function. Or use the perlin noise implementation in Noise2D.

Angen resigned from this revision.Dec 12 2019, 7:40 AM
nani added inline comments.Dec 13 2019, 7:47 PM
binaries/data/mods/public/maps/random/rmgen/perlinNoise.js
21

Suggestion ? Factal noise, fbm ?

smiley added inline comments.Dec 13 2019, 9:02 PM
binaries/data/mods/public/maps/random/rmgen/perlinNoise.js
21

Fractal noise sounds better.