I’ve published a update for my game currently and after a ROBLOX update, the players and I noticed that the servers were disconnecting frequently, and I’ve been diagnosing this issue all day.
I’ve came to the conclusion that it was the pathfinding itself that my NPCs were generating (using the pathfindingService) that’s been causing disconnections all day: I tested to see if it was the NPCs following the path that was causing the servers to crash, but turns out that wasn’t causing it. I’ve disabled the NPCs invoking the waypoints and found out it stopped servers disconnections. I’ve disabled all of the complicated scripting that causes the path generated from the server to be simplified, but it still causes the server to lose connection immediately. Can someone take a look at it?
Edit
The disconnection isn’t immediate if I make NPCs invoke for a path in different maps, bigger or smaller. It always disconnect on the map called Homeland though, and it doesn’t disconnect if I disable NPCs from spawning on there.
Edit 2
I made a video to analysis this bug for anyone who sees this post to view (10/19/18):
local WayPoints = PathfindingFunction:Invoke(Torso.Position,TheLocation)
--for i, WayPoint in pairs(WayPoints) do
--[[
if EndPathfinding == true then break end
local CurrentWayPoint = WayPoint
local OfficalPosition = CurrentWayPoint.Position*Vector3.new(1, 0, 1)+Vector3.new(math.random(-4, 4), Torso.Position.Y, math.random(-4, 4))
SetPathPoint(OfficalPosition)
Humanoid:MoveTo(OfficalPosition)
if CurrentWayPoint.Action == Enum.PathWaypointAction.Jump then
Humanoid.Jump = true
end
CheckToDisconnectPath(PathfindType, OfficalPosition, LookForOtherTargets, TheObjectHumanoid, nil)
CheckPathRegulations(OfficalPosition)
--]]
--end
Please use 3 backticks (that apostrophe looking thing near the top left of your keyboard) at the beginning and end of your code to make it show up in a more legible form.
I don’t have a solution myself, but I’d like to stick in a comment: if you are absolutely sure that your code should be fine, has worked before without said disconnections and don’t have any good solutions to work from, this may be an issue on the backend to which you’ll need to take this to #platform-feedback:engine-bugs (if you are a new member, then to #bulletin-board and followed up with a Top Contributor). Don’t post a bug report unless you’re sure this is a problem with Roblox and not your code.
This seems to be a very common issue. The server crashes when multiple semi-complex paths (more than 3 in our case) are being calculated at the same time.
I should also mention that this major bug was introduced with the API changes to the PathfindingService since Release 359
I’ve made a working repro place file that crashes 100% of the time, it doesn’t produce a .dmp file and does not give any sort of warning or crash message, it simply closes studio.
It occurs (at least in my case) in a very specific circumstance when a path is being calculated in a very specific map with very specific start and end points, only one path needs to be made in this manner for the crash to occur.
When the same thing happens online it causes all clients to disconnect and the server basically hangs for a little before shutting down.
I’ve reported it so now we just have to wait I suppose
The issue still happens; I will make a unlisted video on youtube showing the scripting and events in studio, and what happens when NPCs are enabled, and when NPCs are disabled in a live server.