Help WITH PART ISSUE

I want to solve this annoying problem I’ve had since april.

The problem is that when I generate trees for my procedural planets and I test it on Roblox, an error occurs:


The Error Says: Plase Check Your Internet Connection and Try Again. (Error Code 277)]

I’ve tried Making the part count a lot smaller and adding a dynamic loading system, it worked until I added more detail to the trees.

I’ve also tried to generate trees only for one planet, It worked and It also worked for three planets but the fourth planet always crashes everything.

I NEED HELP PLEASE

To clarify, this only occurs when trying to play the game with the Roblox client and not in studio?
If all the objects are generated and stored on the server, I would try to enable workspace streaming so you can at least get into the game to debug.
Finally, assuming you know how to use the dev console and performance stats, you should be monitoring server memory usage and network traffic when you are able to get into the game.

it uses about 1.8 gb of memory, ping is stable about 230 ms while generating trees, also streaming enabled deletes my trees, basically useless for my purpose

also yep, this only occurs when I test it on Roblox, when I test it on studio it is only a bit laggy

And my game has a drawing system which draws and undraws trees whenever you’re close of far from them.
The scripts that generate trees for all four planets only use CFrame values.

I have another system that makes every player generate their own trees whenever they get close to every cframe generated by the previous script, when they’re close, a tree is chosen, it is sent to the server, the server clones it, parents it to workspace and sends it to all clients for it to render, then it parents it to nil and it removes the cframe from all clients.

I have the exact same problem on lots of large games so yours isn’t the only one. Try enabling or disabling StreamingEnabled to see what will happen.

1 Like

As I said, I’ve tested this before and the only thing I got was straming enabled vanishing all of my trees, plants and minerals.

Thats why I made my own kind of streaming.

My problem literally isn’t allowing me to test my game because whenever the fourth planet trees script is disabled it all collapses.

If you are having the client load and render the models for the trees, that shouldn’t cause a lot of network usage. What exactly are the ‘planet trees script[s]’ you mention and are you saying that enabling a specific script reproduces the server crashing? Are they on the serverside generating the tree locations?

Unless you are creating a very massive amount of CFrame values to represent objects such as trees and rocks, that shouldn’t cause too many issues. (You may have to create your own streaming system to replicate those dynamically to players instead of sending all of them).

Another potential source of the issue is the terrain. If you generate the entirety of all the planets’ terrain upon server startup, then sending that to the client may cause issues.

You may need to share source code and if you are unwilling to do that, ask for help from Roblox engineers.

K, I’ll send the tree code, I said that it seems that my game can hold trees until the fourth script is disabled, I also generate 4 65 million studs surface planets with terrain, after that I wait 85 seconds for the terrain to load, and then I generate trees on a noise like pattern, heres a sample of a tree generator:

for count = 1,1 do
local position
local diameter = 4500
local Seed = math.random(1000000,2000000)

for layer = 1,85,0.6 do
	for steps = 1,360,1 do
		position = CFrame.Angles(math.rad(steps),math.rad(-layer),math.rad(0))*CFrame.new(0,0,math.abs(diameter/2)) + workspace.Sphere1.PrimaryPart.Position
		local noise = math.noise(steps/20,layer/20, Seed)
		if noise <= 0 then
			if math.random(1,3) == 1 then
				local plant = game.ReplicatedStorage.PlantGenerator:Clone()
				plant.Reference.Value = position * CFrame.Angles(math.rad(90),0,0)
				plant.Caster.Value = position * CFrame.Angles(0,0,math.rad(-90))
				plant.Reference.Value = plant.Reference.Value - plant.Caster.Value.LookVector *  6000
				plant.Caster.Value = plant.Caster.Value - plant.Caster.Value.LookVector * 60000
				local ray = workspace:Raycast(plant.Reference.Value.Position, plant.Caster.Value.LookVector * 10000)
				if ray then
					plant.Reference.Value = plant.Reference.Value + plant.Caster.Value.LookVector * ray.Distance
					game.ReplicatedStorage:WaitForChild("SendCF1P"):FireAllClients(plant.Reference.Value)
					plant:Destroy()
				else
					plant:Destroy()
				end
			else
				if math.random(1,3) == 1 then
					local m = game.ReplicatedStorage.MineralGenerator:Clone()
					m.Reference.Value = position * CFrame.Angles(math.rad(90),0,0)
					m.Caster.Value = position * CFrame.Angles(0,0,math.rad(-90))
					m.Reference.Value = m.Reference.Value - m.Caster.Value.LookVector *  6000
					m.Caster.Value = m.Caster.Value - m.Caster.Value.LookVector * 60000
					local ray = workspace:Raycast(m.Reference.Value.Position, m.Caster.Value.LookVector * 10000)
					if ray then
						m.Reference.Value = m.Reference.Value + m.Caster.Value.LookVector * ray.Distance
						game.ReplicatedStorage:WaitForChild("SendCF1M"):FireAllClients(m.Reference.Value)
						m:Destroy()
					else
						m:Destroy()
					end
				end
			end
		else
			if math.random(1,2) == 1  then
				local tree = game.ReplicatedStorage.PlantGenerator:Clone()
				tree.Reference.Value = position * CFrame.Angles(math.rad(90),0,0)
				tree.Caster.Value = position * CFrame.Angles(0,0,math.rad(-90))
				tree.Reference.Value = tree.Reference.Value - tree.Caster.Value.LookVector *  6000
				tree.Caster.Value = tree.Caster.Value - tree.Caster.Value.LookVector * 60000
				local ray = workspace:Raycast(tree.Reference.Value.Position, tree.Caster.Value.LookVector * 10000)
				if ray then
					tree.Reference.Value = tree.Reference.Value + tree.Caster.Value.LookVector * ray.Distance
					game.ReplicatedStorage:WaitForChild("SendCF1"):FireAllClients(tree.Reference.Value)
					tree:Destroy()
				else
					tree:Destroy()
				end
			else
				if math.random(1,2) == 1 then
					local plant = game.ReplicatedStorage.PlantGenerator:Clone()
					plant.Reference.Value = position * CFrame.Angles(math.rad(90),0,0)
					plant.Caster.Value = position * CFrame.Angles(0,0,math.rad(-90))
					plant.Reference.Value = plant.Reference.Value - plant.Caster.Value.LookVector *  6000
					plant.Caster.Value = plant.Caster.Value - plant.Caster.Value.LookVector * 60000
					local ray = workspace:Raycast(plant.Reference.Value.Position, plant.Caster.Value.LookVector * 10000)
					if ray then
						plant.Reference.Value = plant.Reference.Value + plant.Caster.Value.LookVector * ray.Distance
						game.ReplicatedStorage:WaitForChild("SendCF1P"):FireAllClients(plant.Reference.Value)
						plant:Destroy()
					else
						plant:Destroy()
					end
				else
					if math.random(1,4) == 1 then
						local m = game.ReplicatedStorage.MineralGenerator:Clone()
						m.Reference.Value = position * CFrame.Angles(math.rad(90),0,0)
						m.Caster.Value = position * CFrame.Angles(0,0,math.rad(-90))
						m.Reference.Value = m.Reference.Value - m.Caster.Value.LookVector *  6000
						m.Caster.Value = m.Caster.Value - m.Caster.Value.LookVector * 60000
						local ray = workspace:Raycast(m.Reference.Value.Position, m.Caster.Value.LookVector * 10000)
						if ray then
							m.Reference.Value = m.Reference.Value + m.Caster.Value.LookVector * ray.Distance
							game.ReplicatedStorage:WaitForChild("SendCF1M"):FireAllClients(m.Reference.Value)
							m:Destroy()
						else
							m:Destroy()
						end
					end
				end
			end
		end
	end
	steps = 0
	wait()
end

end
wait()
for count = 1,1 do
local position
local diameter = 4500
local Seed = math.random(1000000,2000000)

for layer = 1,85,0.6 do
	for steps = 1,360,1 do
		position = CFrame.Angles(math.rad(-steps),math.rad(layer),math.rad(0))*CFrame.new(0,0,math.abs(-diameter/2)) + workspace.Sphere1.PrimaryPart.Position
		local noise = math.noise(steps/20,layer/20, Seed)
		if noise <= 0 then
			if math.random(1,3) == 1 then
				local plant = game.ReplicatedStorage.PlantGenerator:Clone()
				plant.Reference.Value = position * CFrame.Angles(math.rad(90),0,0)
				plant.Caster.Value = position * CFrame.Angles(0,0,math.rad(-90))
				plant.Reference.Value = plant.Reference.Value - plant.Caster.Value.LookVector *  6000
				plant.Caster.Value = plant.Caster.Value - plant.Caster.Value.LookVector * 60000
				local ray = workspace:Raycast(plant.Reference.Value.Position, plant.Caster.Value.LookVector * 10000)
				if ray then
					plant.Reference.Value = plant.Reference.Value + plant.Caster.Value.LookVector * ray.Distance
					game.ReplicatedStorage:WaitForChild("SendCF1P"):FireAllClients(plant.Reference.Value)
					plant:Destroy()
				else
					plant:Destroy()
				end
			else
				if math.random(1,3) == 1 then
					local m = game.ReplicatedStorage.MineralGenerator:Clone()
					m.Reference.Value = position * CFrame.Angles(math.rad(90),0,0)
					m.Caster.Value = position * CFrame.Angles(0,0,math.rad(-90))
					m.Reference.Value = m.Reference.Value - m.Caster.Value.LookVector *  6000
					m.Caster.Value = m.Caster.Value - m.Caster.Value.LookVector * 60000
					local ray = workspace:Raycast(m.Reference.Value.Position, m.Caster.Value.LookVector * 10000)
					if ray then
						m.Reference.Value = m.Reference.Value + m.Caster.Value.LookVector * ray.Distance
						game.ReplicatedStorage:WaitForChild("SendCF1M"):FireAllClients(m.Reference.Value)
						m:Destroy()
					else
						m:Destroy()
					end
				end
			end
		else
			if math.random(1,2) == 1  then
				local tree = game.ReplicatedStorage.PlantGenerator:Clone()
				tree.Reference.Value = position * CFrame.Angles(math.rad(90),0,0)
				tree.Caster.Value = position * CFrame.Angles(0,0,math.rad(-90))
				tree.Reference.Value = tree.Reference.Value - tree.Caster.Value.LookVector *  6000
				tree.Caster.Value = tree.Caster.Value - tree.Caster.Value.LookVector * 60000
				local ray = workspace:Raycast(tree.Reference.Value.Position, tree.Caster.Value.LookVector * 10000)
				if ray then
					tree.Reference.Value = tree.Reference.Value + tree.Caster.Value.LookVector * ray.Distance
					game.ReplicatedStorage:WaitForChild("SendCF1"):FireAllClients(tree.Reference.Value)
					tree:Destroy()
				else
					tree:Destroy()
				end
			else
				if math.random(1,2) == 1 then
					local plant = game.ReplicatedStorage.PlantGenerator:Clone()
					plant.Reference.Value = position * CFrame.Angles(math.rad(90),0,0)
					plant.Caster.Value = position * CFrame.Angles(0,0,math.rad(-90))
					plant.Reference.Value = plant.Reference.Value - plant.Caster.Value.LookVector *  6000
					plant.Caster.Value = plant.Caster.Value - plant.Caster.Value.LookVector * 60000
					local ray = workspace:Raycast(plant.Reference.Value.Position, plant.Caster.Value.LookVector * 10000)
					if ray then
						plant.Reference.Value = plant.Reference.Value + plant.Caster.Value.LookVector * ray.Distance
						game.ReplicatedStorage:WaitForChild("SendCF1P"):FireAllClients(plant.Reference.Value)
						plant:Destroy()
					else
						plant:Destroy()
					end
				else
					if math.random(1,4) == 1 then
						local m = game.ReplicatedStorage.MineralGenerator:Clone()
						m.Reference.Value = position * CFrame.Angles(math.rad(90),0,0)
						m.Caster.Value = position * CFrame.Angles(0,0,math.rad(-90))
						m.Reference.Value = m.Reference.Value - m.Caster.Value.LookVector *  6000
						m.Caster.Value = m.Caster.Value - m.Caster.Value.LookVector * 60000
						local ray = workspace:Raycast(m.Reference.Value.Position, m.Caster.Value.LookVector * 10000)
						if ray then
							m.Reference.Value = m.Reference.Value + m.Caster.Value.LookVector * ray.Distance
							game.ReplicatedStorage:WaitForChild("SendCF1M"):FireAllClients(m.Reference.Value)
							m:Destroy()
						else
							m:Destroy()
						end
					end
				end
			end
		end
	end
	steps = 0
	wait()
end

end

Since you are generation them mid-game you should have a maximum distance for the items to load, if they are in the range of the player, they will be visible other than that, make them invisible, you can re-generate them but i think this is better.

that’s what my system is for, when you’re too far away it sets the parent to nil, if you’re close enough it parents it to the planet model, it only makes that for the client.

Its kind of weird that it does that, maybe go to #bug-reports and say it there?

1 Like

also the cframes are generated on the server.

I also have my own streaming system.

I don’t think it is a bug, my game used to work before without any complicated system, this annoying thing started to occur when I actually coded procedurally generated trees

1 Like

I kind of hate that roblox isn’t designed for big games, I just wanted to replicate No Man’s Sky and well, I can’t belive I’m stuck with this error when I’ve managed to solve a lot.

It even stops meshes at 10k polygons which kinda sucks.

1 Like

Imma test this on another network and I’ll update this soon if it worked.

Till then, thanks.

Confirmed, the problem is not the wi-fi connection, the problem is something with the game, however I found that apparently the game can hold up to three decorated planets, no matter what planets they are.

I just changed the fourth planet decoration probability, this caused the load to be lighter and I’ve managed to solve it.

Thank’s everyone, cheers.