How would I achieve an infinite map with the current way the ROBLOX engine works?

My goal here is simple, I’d like to find a way to have an infinite map in Roblox sort of thing, I already have in mind how to generate it (a line of pre-made chunks sort of say with math.random() deciding what chunk to put next after the latest chunk), but…

The issue is, the way ROBLOX currently works kind of restricts it, sure the map keeps generating forward but if the player gets too far from the origin point the game will begin glitching and spazzing out.

I have thought of makeshift solutions for my issue, namely to teleport them back after reaching the game boundary in a way they won’t suspect it, but that’s something I’d use as a last resort for this as the game I plan on making currently involves vehicles (namely that constraints are sensitive to sudden position changes), I am making this post in hopes to find a better alternative for this farlands issue the game engine has from the devforum community.

3 Likes

Here’s the best I’ve got for you: Infinite Terrain Plugin

2 Likes

Unfortunately, there is no current way to fix floating point errors, it is simply a complication of modern technology. Floating point errors aren’t unique to Roblox, other popular engines suffer from them, the only differences being the distance at which they occur and the way they are handled. In Roblox, floating point errors only start being apparent when you get around 100’000 to 250’000 studs away from the origin point. As you stated, the best way to avoid it is to bring back the player to the origin point. Of course, this is far from ideal, but until Roblox works on an upgrade to the current systems, this is here to stay.

2 Likes

infinite is imposable but there are a few things you could do to make it larger


i just tested using workspace:PivotTo() and it never worked so looks like that can not be used as a option so you would need to manually shift all parts in the world as the player walks around but this would be kinda hard to do and if you have a lot of parts would not be grate on performance

workspace:PivotTo()
if you put this localscript into StarterPlayer.StarterCharacterScripts

local primaryPart = game.Players.LocalPlayer.Character.PrimaryPart
while wait(1) do
	local center = workspace:GetPivot()
	local offset = primaryPart.Position - center.Position
	workspace:PivotTo(CFrame.new(-offset.X, -offset.Y, -offset.Z))
end

you will notice that every 1 seconds this will put your character at position 0, 0, 0
but now workspace.OriginPosition will have the same foating point errors but we can use this to at least double are total distance we can do

local primaryPart = game.Players.LocalPlayer.Character.PrimaryPart
while wait(1) do
	local center = workspace:GetPivot()
	local x1, y1, z1 = math.round(primaryPart.Position.X), math.round(primaryPart.Position.Y), math.round(primaryPart.Position.Z)
	local x2, y2, z2 = center.Position.X, center.Position.Y, center.Position.Z
	local offsetX = math.clamp(x1 - x2, -100, 100)
	local offsetY = math.clamp(y1 - y2, -100, 100)
	local offsetZ = math.clamp(z1 - z2, -100, 100)
	workspace:PivotTo(CFrame.new(-offsetX, -offsetY, -offsetZ))
end

and here is a improved version what this does is round the players position so that the workspace.OriginPosition does not have point values it will only have hole numbers that may allow for larger numbers (not tested)

im also clamping the value set to -100 , 100 just for this demo what this does is allows the workspace.OriginPosition to only go upto 100 and if the player walks any further it will be on the players position

so what that means if you walk 260 studs to the right
workspace.Origin Position = 100, 0, 0
character.Position = 160, 0, 0

so you should set the -100 and 100 to a very large number just before the game starts to glitch

so here you can see how we could at least double the distance but it might even let you go further as we are rounding the numbers so the workspace.OriginPosition might allow for even higher numbers but im not sure as i have not tested


the next thing you can do is scale everything down and reduce the walk speed
if you scale everything down by lets say 50% and reduce the players walk speed from 16 to 8 it would take twice the amount of time to walk to farlands


and you could use both of these methods together to increase the size of the world

1 Like

I’m pretty sure all “infinite” games have this issue. If I’m correct, the glitching starts millions of studs away from the origin point, which should be plenty of space for a player to explore. In theory, you could size the player down in order to “increase” the size of the map.

2 Likes