basis_noise example is useless

User avatar
Osmo
Fast Inserter
Fast Inserter
Posts: 151
Joined: Wed Oct 23, 2024 12:08 pm
Contact:

basis_noise example is useless

Post by Osmo »

There is a quirk in how basis_noise function in noise expressions works. When given integer values for x and y, the output is always 0 (ref). This means that if x and y are passed directly, and input scale is unchanged, the function appears to not work.

The noise expressions auxilary page has this example: basis_noise{x = x, y = y, seed0 = map_seed, seed1 = 0}, which runs into the above problem. it should be removed or changed to include input_scale.
Additionally, it would be good if the behaviour of returning 0 at integer inputs was documented and explicitly advise against using x and y directly with default or integer input_scale.
User avatar
Osmo
Fast Inserter
Fast Inserter
Posts: 151
Joined: Wed Oct 23, 2024 12:08 pm
Contact:

Re: basis_noise example is useless

Post by Osmo »

Also document that multioctave_noise uses the same algorithm as basis_noise but allows for having multiple layers of it with different scales, to make it clear that it also has the same issue. And remove the example with no input_scale from it too as it effectively removes the first layer.
Bilka
Factorio Staff
Factorio Staff
Posts: 3636
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: basis_noise example is useless

Post by Bilka »

Thanks for doing the research and noting this, fixed the docs for 2.0.67.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Post Reply

Return to “Resolved Requests”