Hello! I am trying to make a game with precedurally generated terrain (and structures) in chunks of 32x32x32, and thought that circumnavigation (the ability to walk around the world) would be a nice touch, is there any way to smoothly do this?
Things to keep in mind:
Streaming is enabled, so teleporting the player while that area of the terrain isn’t loaded for them could result in them falling to their death
I am not asking how to generate the terrain in such a way where the borders would link well, just asking for a way to easily teleport players/clone areas to make circumnavigation ~100% seamless
Anything to help would be greatly appriciated, thank you!
Why not do the coding for the terrain generator and then a script to use path services from the spawn point to each corner and see if the paths actually get to those corners?
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.
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?
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
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.
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?
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. Wraparound (video games) - Wikipedia
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