First I want to mention that I am not super good at maths and that I wasn't even sure if this was the right sub forum to post in (please move this to another one if that's the case).(adsbygoogle = window.adsbygoogle || []).push({});

I am working on a 2D game in python where the player plays on an infinite map. Of course that means that the map is generated by a function such that only the "tiles" on the screen have to be calculated and in memory at any time. The function I have been using is a Perlin noise type function that I found somewhere a while back, but I am unable to figure out how to scale the distance between the troughs and valleys of the function, so the features of the map are too small and look kind of cramped. I have really tried to figure out how to "stretch" the "distance" between these troughs and valleys, but I haven't had any luck so far. This is the code from my program:

(looks a bit messy)

Code (Text):def noise(x, y):

n=x*331+y*337

n=(n<<13)^n

nn=(n*(n*n*41333 +53307781)+1376312589)&0x7blackf

return int(((1.0-(nn/1073741824.0))+1)/2.0)

**Physics Forums - The Fusion of Science and Community**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Scaling of noise function

Loading...

Similar Threads - Scaling noise function | Date |
---|---|

A Methods to interpolate surfaces from gradient field? | Feb 17, 2017 |

A Action of a vector on the pull-back of a function | Oct 16, 2016 |

I S^1 transition functions | Jul 20, 2016 |

Scaling and Translation Invariance | Sep 21, 2009 |

Why is noise always gaussian? | Oct 10, 2008 |

**Physics Forums - The Fusion of Science and Community**