Looping Map with Perlin Noise (Solved)

I want to loop a perlin noise map, but i dont know how to do a map that would loop.

How do I…

Is there a way that i could make a noise map loop, so i can teleport the player from opposite edges making it look without any hard map edges, with the porpouese of making it look as if you were in a sphere

What is the expected result

Want random seed that make borders transitionable from one side to the other to make it feel like a “spehere”

I did not even get to the point of successfully generating map with noise extension
If you did then i would be thankful for sharing it

As to your problem i think perfect sphere transition would be very problematic
Unless it would contain KINDA same elements beyond sphere
Like imagine ONLY trees in same exact spot
Then what player would notice is some area of trees in certain area of map

BUT if you would go for square/rectangle map
Then it would be as easy as repeating your map on various parts
Let me show you with repeating vertically

Look at picture below
Player is at arrow A and is going down he sees 2 trees
Tree 2 and tree 3
Now if he cross red border
He is teleported up to arrow B BELOW red border still going down
And still seeing TWO trees but in this case it would be tree 4 and tree 1
Where for player it would be same exact trees

Problem with this approach is IF player damage or destroy tree 3 then tree 1 will be intact so it can confuse player

Where most logical approach would be to
To have emptyness or water or whatever in purple area
Where again player would teleport from bottom red border to top red border
And all your map would have margin NOT crossing purple borders
Where again purple border could be just water
And you would be perfectly fine
And this approach would work with sphere
Cause you could check if distance from center of your sphere to player is above something and if it is you would teleport player to opposite edge of it

To add context. Yes, im using a square perlin noise map, and want to teleport from edges.
i dont know how to repeat the perlin noise from the right border to the outside of the left border. I will follow in the teleportation but need help in repeating the noise.
Im using the extension that is generally used for perlin noise called:Noise + Extended Math.

Does it work as in creating something from center
Or from top left corner then expanding to bottom right corner?

top left to bottom right.
Its from the tutorial and the example project

IIRC, with perlin noise you get a value for an X & Y position based on a seed?

If I’m correct, then you’ll need to set x and y using the mod function. So something like x = mod(x+max_x_value, max_x_value), where x is the current X position and max_x_value is the x value that 1 more than the right edge of your map.

I use x + max_x_value because if you move left then x could enter negative territory. So adding a complete map shift to the right and then using mod will keep it within the bounds of the map.

1 Like

Ok, I may be dumb because I’m having difficulty understanding part of it.
saying this has 9 lines. In which line and how should I modify it. and how.

Well MrMen explained what i was about to
Yet my way would be more butchered
Imagine you create map at x0 y0
With size of 1k to the bottom and to the right
I would repeat same crap at x0 and y1000 and x0 y-1000
This would cover top and bottom
And if would fit my needs rest would be doing the same for X-1000 and X1000 with all 3 possible Y values so 0 -1000 and 1000
Which would cover all 8 directions

1 Like

That second event, where you create a noise generator, is run every single game frame. I don’t think that’s your intention.

What I’d suggest is, for starters, that you create one event with the condition “At the beginning of the scene”, and then off that include any events you only want to run at the start as subevents. This will keep it tidy and immediately obvious what is and isn’t run at the start of the scene.


It’ll be a few lines. For just the map, you can generate areas outside the bounds of the main area you have so it ends up like what @ZeroX4 has suggested (@ZeroX4 posted while I was creating this post). Something like:


Visually, you are doing this - for the red tile in the middle (circled in green), create the 8 tiles in the areas surrounding it:

image


And the player movement is restricted to the mod expression I suggested previously. This will keep the player in the bounds of the central area.

1 Like

You need an extra dimension for each wrapped axe as you’ll do a circle instead of a line.