SERVER CRASH [Internal/RbxThread]

Do you have any scripts with no content in them? I remember that scripts with nothing in them will cause this behavior a few years ago.

Do you have any memory leaks in your scripts? Could this possibly be an issue with the RCCService executable itself?

All my scripts have content in them so I don’t think that to be the problem. What is RCC Service?

I believe it is the server software Roblox runs on their servers, which run Windows Server.

Nah I don’t believe this to be it. It seems to be something happening on my end more than ROBLOX’s because other projects have seem to run fine? This crashing happens consistently

Check your script activity on the devconsole and log what scripts are active then work from there. Start isolating code and logging what connections are open/closed manually. It’s going to be rough work because there’s no easy fix/way to find memory leaks. And remember to close connections when they are no longer needed

1 Like

Yeah currently doing that as we speak I think I found the culprit I’m going to re-enable it to double check when its time

Narrowed the issue down to pathfinding it ONLY happens when my AIs have pathfinding enabled and it doesn’t show any activity prior it just ups and spikes as shown:

(ignore my ping my internet is just really bad)

0.553.0.5530621_20221121T041250Z_Player_F177F_last.log (28.3 KB)
Server log if this helps at all I’m stuck man

How many NPCs are you spawning in? I can easily have several hundred and see no noticable lag at all. Have you considered using an NPC system like Justice the Awesome NPC system:

I got a stupid question: when your NPCs are killed, are they still making new paths?

Basically, are their AIs still running after death?

I’m willing to take a look at this does it use roblox traditional pathfinding?

Nope I cancel all that code and destroy their paths always

1 Like

Read up on this and it doesnt work for R15 yet unfortunately

Fair point, but you can spawn R15 rigs instead via some simple changes. Alternatively would you care to share the relevant npc spawn & control code so we can review it.

1 Like
task.spawn(function()
	while not workspace:GetAttribute("PathfindCancel") do
		task.wait((#Battles - 1)*0.1 + 0.2)
		ActiveRequest = ActiveRequest
		ComputationQueue = ComputationQueue
		if #Battles == 0 then continue end
		
		local EarliestID
		local EarliestInfo
		local PreviousTime
		for ID,Info in pairs(ComputationQueue) do
			if not (Info.Request and Info.QueueTime) then continue end
			task.wait(0.1)
			if not PreviousTime then
				EarliestID = ID
				EarliestInfo = Info
				PreviousTime = Info.QueueTime
			elseif (tick() - PreviousTime) < (tick() - Info.QueueTime) then
				EarliestID = ID
				EarliestInfo = Info
				PreviousTime = Info.QueueTime
			end

		end

		if EarliestID and ComputationQueue[EarliestID] and (tick() - LastCompute) >= 2 then
			warn("Computing "..(tick() - LastCompute))
			LastCompute = tick()
			local Index = ComputationQueue[EarliestID] or {}
			local Path = PathfindingService:CreatePath(Index.Params or {})
			Path:ComputeAsync(Index.StartPos,Index.GoalPos)
			if Path.Status == Enum.PathStatus.Success then
				ComputationQueue[EarliestID] = {Path=Path}
			else
				if Path then Path:Destroy() end
				local Attempts = Index.Attempts or 0
				Attempts += 1
				if Attempts > 2 then
					ComputationQueue[EarliestID].Request = nil
				elseif ComputationQueue[EarliestID] and ComputationQueue[EarliestID].Attempts then
					ComputationQueue[EarliestID].Attempts = Attempts
				end			
			end			
		end


	end
end)

This is the pathfinding code snippet

This is the console print the last thing printed before the crash is "Computing (The time since last computeasync) Screenshot by Lightshot

		local SpawnCF = Data.SpawnCF
		local CHSpawn = SpawnFolder:GetChildren()[math.random(1,#SpawnFolder:GetChildren())]
		if (CHSpawn or SpawnCF) then
			local Model
			if IsPlayer and SquadCount == 1 and (Controller and Controller.Parent)  then
				local BattleHUD = Assets.GUI.Battle.BattleHUD:Clone()
				BattleHUD.Parent = Controller.PlayerGui
			end

			Model = AceData.ModelRef or Data.Model
			if not Model then
				local FolderIndex = ReplicatedStorage.Assets.CharacterModels.Skins
				Model = AceData.ActiveSkin and FolderIndex and FolderIndex:FindFirstChild(AceData.ActiveSkin) or ReplicatedStorage.Assets.CharacterModels:FindFirstChild(AceName)
				if not Model then
					warn("No model found for "..AceName)
					AceFolder:Destroy()
					return
				end
				Model = Model:Clone()
			end
			if not Model then
				Model = Assets.ReferenceRig:Clone()
			end

			local HUM = Model:FindFirstChild("Humanoid")
			HUM.RequiresNeck = false
			HUM.AutoJumpEnabled = false

			if SquadCount == 1 and not Data.SpawnCF then
				StartPos[Team] = (CHSpawn.CFrame)
				SpawnCF = StartPos[Team]
				table.insert(SpawnPositions[Team], SquadCount, SpawnCF)

				local FullCircle = (2 * math.pi)
				local Dist = 12
				for i = 2, MaxSquad do
					local Angle = -(i * (FullCircle/MaxSquad))

					local x = math.cos(Angle) * Dist
					local z = math.sin(Angle) * Dist

					local AdditionalSpawnCF = StartPos[Team] * CFrame.new(x, 0, z)
					table.insert(SpawnPositions[Team], i, AdditionalSpawnCF)
				end
			elseif not Data.SpawnCF then
				local TeamSpawns = SpawnPositions[Team]
				SpawnCF = TeamSpawns[SquadCount]
			end

			local FinalSpawnCF = SpawnCF or StartPos[Team] or (CHSpawn.CFrame)


			Model.PrimaryPart.CFrame = FinalSpawnCF--*CFrame.new(0,-2,0)
			local BG = Instance.new("BodyGyro",Model.PrimaryPart)
			BG.CFrame = FinalSpawnCF
			BG.MaxTorque = Vector3.new(1e8,1e8,1e8)
			game.Debris:AddItem(BG,1.5)
			Model.Name = "Model"
			Model.Parent = AceFolder

			local Container
			if not Data.Model then -- Creates a new container and makes a state connection if its a brand new model
				Container = StateHandler:GetContainer(HUM) or StateHandler:CreateContainer(HUM)
				local StateConnection = Container.StateAdded.Event:Connect(StatusAdded)
				local StateConnection2 = Container.StateRemoved.Event:Connect(StatusRemoved)
				table.insert(BattleConnections,StateConnection)
				table.insert(BattleConnections,StateConnection2)

				local StateConnected3 = HUM.StateChanged:Connect(function()
					local NewState = HUM:GetState()
					if table.find(BadStates,NewState) then
						HUM:ChangeState(Enum.HumanoidStateType.GettingUp)
					end
				end)
				table.insert(BattleConnections,StateConnected3)
			else
				Container = StateHandler:GetContainer(HUM) or StateHandler:CreateContainer(HUM)
			end

			if not table.find(ActiveAces,AceFolder) then
				table.insert(ActiveAces, AceFolder)		
			end

Alright I believed I resolved the issue: In my game battles are created further and further away from the origin so eventually computing a path 342432342342334 studs away gets a bit hectic for the pathfinding causing the server to crash

1 Like

Goof to hear that you have fixed it.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.