PathfindingService:GetWaypoints() causing server disconnection?

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?

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):

Edit 3
The issue has been fixed.


With this concurrent issue, I had to disable all of the NPCs spawning in the game.

It may not be an issue with the pathfinding methods but rather the code your wrote to deal with the waypoints. Can you post any sample code?

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*, 0, 1), 4), Torso.Position.Y, math.random(-4, 4))
				if CurrentWayPoint.Action == Enum.PathWaypointAction.Jump then
					Humanoid.Jump = true
				CheckToDisconnectPath(PathfindType, OfficalPosition, LookForOtherTargets, TheObjectHumanoid, nil)

Everything is commented.

You should provide a link to your game.

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.

Edit your post, don’t make a new one.

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.

I’m confused, do I just make a new topic in #bulletin-board and then just ask a Top Contributor to look at it?

I moved it to engine bugs since there is enough information here, but yeah that is the general process.


Oh ok, thank you.

I have this issue too.

I disabled my pathfinding and the game no longer loses connection.

1 Like

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

1 Like

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 :man_shrugging:

1 Like

Thanks for the detailed report.

The feature that is causing this crash will be disabled asap until the next release when the fix is out.

1 Like

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.

Video link has been edited into the post’s description. I hope it helps.

I’ve tested today, the issue seems to be fixed, horray!

1 Like