Circumnavigation for a game with procedurally generated terrain

I don’t understand how this would help, would you mind elaborating?

I̶ ̶c̶a̶n̶ ̶j̶u̶s̶t̶ ̶g̶i̶v̶e̶ ̶y̶o̶u̶ ̶a̶ ̶p̶l̶u̶g̶i̶n̶ ̶I̶ ̶m̶a̶d̶e̶ ̶a̶ ̶w̶h̶i̶l̶e̶ ̶a̶g̶o̶ ̶i̶f̶ ̶t̶h̶a̶t̶’̶s̶ ̶f̶i̶n̶e̶ ̶w̶i̶t̶h̶ ̶y̶o̶u̶.̶ ̶I̶t̶s̶ ̶p̶r̶e̶t̶t̶y̶ ̶s̶m̶o̶o̶t̶h̶ ̶i̶f̶ ̶y̶o̶u̶ ̶s̶e̶t̶ ̶t̶h̶e̶ ̶b̶a̶l̶l̶ ̶s̶i̶z̶e̶ ̶t̶o̶ ̶l̶i̶k̶e̶ ̶1̶ ̶o̶r̶ ̶s̶o̶m̶e̶t̶h̶i̶n̶g̶.̶
Misread this. I’m sorry

PathFinding service
https://developer.roblox.com/en-us/articles/Pathfinding
generates a table of points made by the service along the path between one position and another so you could use that to ask the service to give you the points between the spawn point and for example the cornet far left of that position.
If the service is not able to generate a path then a player will not be able to travel there on foot or in a vehicle.

Players are able to modify the terrain, so even if they aren’t immediately able to reach the edge, they can just make a path

Ok, Didn’t realise that. So is the reason for the question to do with stopping the players from dropping through or walking off the edge of the terrain?

Something like that, I just want players to not even notice when they go to the edge and end up at the other side of the map

Ok so you want to detect when they are near the edge then teleport them to the other side of the terrain East to/from West North to/from South?
If that is correct you need to either have a list of points on each side with the corresponding teleport to or some way to calculate the teleport to points.

No, if I wanted to do it like that then I would just teleport them once their coordinates left the chunk zone, what I want to do is have a seamless transition.

Maybe load the other side’s chunk onto this side and smoothly teleport them without them noticing any such teleportation has accoured

Ok, I understand better now. Would simply using MoveTo work?

No. What I am saying, is that I need to make it look like you are circling a world, so I need to teleport without the player realizing, perhaps by cloning pre-existing terrain chunks to give the illusion that they were never teleported. I want it to look visually, like you can walk along a small planet’s surface and end up back where you started.

If you make the distance before reaching the edge big enough so the terrain there is a mirror of the terrain on the other edge and do the teleport at that point I believe you will get the illusion you want.

1 Like

Yes, that’s what I had been planning to do, but the issue arrives with streaming enabled, but I will just have to figure a way around the loading issue

Ok. looks like you wont be the only one with this sort of situation as I believe Streaming Enabled will become the default soon.
Have you tried it with Streaming Enabled disabled?

Yes but then comes the issue with the map being too big for some clients

AFAIK, streaming doesn’t give you enough control to choose which exact chunks are loaded. For that reason, you might want to avoid using streaming and instead make your own chunk loading system that only loads the chunks that are around the player. Is that an option for you?

If so, you can just load the chunks that correspond to where the player would be if the world was round. E.g. if the player is at a position that corresponds to 3½ times around the world, load the chunks that are halfway around the world.

If you end up going with a system like that, keep in kind that simply looping the world in both cardinal directions would make the world into a torus rather than a sphere. https://en.wikipedia.org/wiki/Wraparound_(video_games)

Would something like this work?

I think it could work well for your project.

I was thinking about doing this, but then there would be multiple instances of the same chunk of there are multiple players, and I figured it wouldn’t be very efficient

You can’t render terrain in a viewportframe

Other than somehow faking a circular world by having multiple “copies” of certain chunks, I can only think of one way: making the world actually loop around physically. This won’t work with smooth terrain, and you’ll have to make your own character, character controller and camera controller, as well as your own skybox system. There will also be weird overlap issues where chunks meet. Then rotate each chunk about its edge, compared to the previous chunk.

1 Like

Alright, well I guess I will have to manage multiple chunks, thank you for the help!