Perlin Noise plugin 1 - Zooming

This forum is currently in read-only mode.
From the Asset Store
All popular touch mechanics - scrolling, zooming, swiping
  • Hi all!

    Well I've reached a snag while fooling around with the perlin noise plugin. The first version.

    Let's say you have a display size of 640x480.

    The noise is 1 pixel big. So the noise map is the same as the display size.

    I have two loops generating the noise one for X and one for Y.

    They read the noise in the noise map and then create 1x1 pixel tiles.

    So if I wanted to be able to zoom the landscape, how would I go about doing this? I know that frequency will allow you to zoom in and out.

    BUT.

    When I zoom in(lowering the frequency), the whole map moves up towards the left corner. But I want to be able to zoom in on the what ever is in the CENTER of the SCREEN, at coordinates 320x 240y.

    How would I go about doing this and what formula is used?

    Thanks in advance! :)

    /MJOne

  • Nevermind I fixed it! ;)=

    I can post a solution if anyone want one... :)

    However it only works when I take the noise frequency * 0.5....

    It would be nice to see if someone could make a smooth zoom in a sin wave motion. In and out. :)

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • You're creating a sprite for each pixel?

    That's like over 300000 tiles.

    You might want to check out the Canvas plug, or even a sprite distort map.

    That many tiles is just crazy. I'm surprised it even ran.

    Also you might check out Noise 2 Arsonide added functions for changing the rez.

  • Don't worry about computer-power... I have that...

    It's brain-power Im lacking. ;P

    It runs perfectly smooth when using the canvas...

    But it takes 1-2 seconds to update the map ;P

    But it's just for testing...

    My main issue is how to write a formula or set it up to be able to zoom into the noise. Like a map zoom. Like 1x 2x 3x 4x 5x 6x 7x 8x zoom etc...

    or maybe everything in between like 1.1x 1.2x 1.3x etc... :)

    I can't figure out the relationship between the display size, the frequency in perlin noise plug ver 1 and the center point on where I am zooming.

    And noise plugin version 2 is out of the question right now...

    Because my project will be tile based.

    This 1x1 pixel is just for fun right now.

    Any ideas?

  • I can't figure out the relationship between the display size, the frequency in perlin noise plug ver 1 and the center point on where I am zooming.

    Think of the Perlin noise as a scene with unlimited resolution. The scene is created by octave, frequency and seed. If you keep those values and only change width and height, you change the resolution, thus zooming in or out. Width will change the horizontal zoom, height the vertical.

    Let's say, perlin was set to 64x64. If you now change it to 128x128, you see the same scene, just with more detail. If you keep the output size at 64x64 (e.g. drawing in a canvas), you effectively zoomed in. To still present the center, you wouldn't draw 0 to 63, but 32 to 95. You calculate that like so:

    1x zoom was presented with a 64x64 perlin, area shown was 64, center is at 32

    2x zoom is presented with a 128x128 perlin, area shown still is 64, center is 64. Half of the area is 32, ergo 64 - 32 is the left/top-edge, 64 + 32 - 1 is the right/bottom-edge.

    Here's a very rough example cap:

    perlinzoom.cap

    (I wish English was my native language, I could explain it so much more understandable)

  • I wish English was my native language as well :)

    Of course... Dang why didn't I think of that...

    Thanks a munch of a bunch! ;P

    I'll experiment on all the things you said there...

    I let you know if I figure it out. ;)

    That cap isn't readable on my end. I downloaded the latest official r2 release of construct classic.

    "Failure to load..."

    "This cap was saved with a newer version of construct"

    How come?

    I just downloaded the latest...

    Anyways, thanks alot for your help and explanation!

  • That cap isn't readable on my end. I downloaded the latest official r2 release of construct classic.

    "Failure to load..."

    "This cap was saved with a newer version of construct"

    How come?

    I just downloaded the latest...Hmm, that's strange. I built the cap with R2 and only used Perlin Noise plugin of the 3rd party plugs. Anyone else having problems to open it?

  • tulamide

    Works just fine on my PC.

  • Wolod

    Thank you, I was wondering if I'd done something wrong :)

  • That's weird...

    I did the same thin just to make sure...

    Fresh install of Construct + perlin plug...

    Still the same error...

    I'll investigate my registry for old inputs...

    I have a 64bit OS but I'm sure that got nothing to do with it...

    "I'll be back"

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)