How to add seed to Perlin noise?

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
Rishavs
Party member
Posts: 103
Joined: Sat Oct 17, 2009 5:29 am
Contact:

Re: How to add seed to Perlin noise?

Post by Rishavs »

Hmmm...

I am still not very happy with the seeding. I generally end up with 5-6 similar shapes with minor differing details.
Still, this is something I can optimize later. I am in a good place right now.

This is my hexagon map with heightmap.
hexmap.png
hexmap.png (49.21 KiB) Viewed 2919 times
User avatar
pgimeno
Party member
Posts: 3641
Joined: Sun Oct 18, 2015 2:58 pm

Re: How to add seed to Perlin noise?

Post by pgimeno »

Maybe taking different sections of the "Perlin map"?

If your map is, say, 20x20, you can use the intervals [20*seedX, 20*seedX+20) and [20*seedY, 20*seedY+20) for some constants seedX, seedY (or maybe 30 instead of 20, to allow for some separation between maps).
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: How to add seed to Perlin noise?

Post by raidho36 »

Yep, that is what you're supposed to do to get different snapshot of noise here. You need to sample different coordinates, one thing you could do is just offset the whole thing.
User avatar
Rishavs
Party member
Posts: 103
Joined: Sat Oct 17, 2009 5:29 am
Contact:

Re: How to add seed to Perlin noise?

Post by Rishavs »

very interesting idea. Will try it tomorrow and report back.
Thanks!!
User avatar
Rishavs
Party member
Posts: 103
Joined: Sat Oct 17, 2009 5:29 am
Contact:

Re: How to add seed to Perlin noise?

Post by Rishavs »

taking your advise i changes my noise to :

Code: Select all

            local elv_merged_noise =    
                   1.00 * love.math.noise (  1 * (dx + seed),     1 * (dy + seed))
                + 0.50 * love.math.noise (  2 * (dx + seed),     2 * (dy + seed))
                + 0.25 * love.math.noise (  4 * (dx + seed),     4 * (dy + seed))
                + 0.13 * love.math.noise (  8 * (dx + seed),     8 * (dy + seed))
                + 0.06 * love.math.noise ( 16 * (dx + seed),   16 * (dy + seed))
                + 0.03 * love.math.noise ( 32 * (dx + seed),   32 * (dy + seed))
                + 0.02 * love.math.noise ( 64 * (dx + seed),   64 * (dy + seed))
                + 0.01 * love.math.noise (128 * (dx + seed), 128 * (dy + seed))
and now i am getting completely diverse shapes. Thanks everyone.
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests