I have a game that uses Simplepath for NPC’s and it has been working flawlessly for the past few months.
Today I realized that it is no longer working as before either in Studio or in a published game. As a matter of fact, I even restored a backup that is over 10 days old and the weird behavior is present with that old code as well.
Given that even with the old code the behavior is changed I am absolutely sure it’s not a problem I recently introduced in code.
Here’s the issue:
Expected:
NPC receives instruction to walk to a store and it walks to it (no issue here)
NPC receives instruction to go inside the store (and I can even see the target location for the NPC being higlighted inside the store confirming the target location)
NPC finds a path that takes it away from the store to a far away location as if the path was blocked, then the npc gets stuck.
I confirmed that the position being fed to pathfindingservice is correct.
I tried disabling/enabling the improved pathfindingservice search but the issue persists.
Has anyone seen any changes in behavior in pathfindingservice over the past few days?
No. I have not been seeing any differences in pathfinding lately. You have been using the improved pathfinding? Could you attach a video so I could see?
I keep Roblox up to date, yes. I can’t trace it to any particular update, just that one day I test the game like I usually do and the pathfinding stopped working.
Btw, it’s not that I advertedly published a version with this issue. The current published version started showing this behavior yesterday and I haven’t published since the weekend.
sure, I can record some videos but there’s not much to see.
NPC stops in front of the store (you can see the pathfinding objects as I use simple path with visualize path turned on)
NPC actually finds the target position but you can see the path doesn’t take it through the door, instead takes it to the end of the street behind some buildings as if trying to go around the front door.
In fact, I started removing some of the parts of the store (like walls and such) and the NPC finds it’s way correctly. I’m positive that none of the stores have changed for the past month or two.
the path trail that the NPC follows to get to the store
the store door is open
inside the store there’s a green box that appears on the shelf (I’m doing that to confirm that’s the valid target for the NPC)
after a brief pause there’s a new path that leads the NPC away from the store (and I confirmed that the NPC still has that green box as target location).
Keep in mind that this is not something new I am trying to do. This is something that has been working for a couple of months without a glitch. Since a couple of days now it has stopped working and I can confirm that nothing was changed in the code (I mentioned earlier that I restored older code from backup and it has now the same issue)
I’m not sure how the plug in would help as I can see the paths.
One thing I’ve done today to troubleshoot is to remove parts of the store to see if makes it work and it does. Basically if I remove some cover walls the NPC is able to find it’s way into the store. At first I thought it was the agent radious/height that was changed but not, it’s set to 1.
I double-checked that the only cost applied to material is on cracked lava which is NOT used anywhere in the store.
Thanks, but that’s not really the issue. I’ve removed all walls and all non-functional items. Pathfinding finds the way in but sometimes if I just have a part barely on the way then pathfinding will target a location mid air inside the remaining 3 walls or will not find a path. It appears to be random: sometimes if calculates waypoints and sometimes it doesn’t.
Because pathfinding is working fine taking the NPC’s from the end of the street to the store, it looks like the issue is for smaller movements inside close spaces.
I’m going to try to replace Simplepath module with a straighforward Pathfindingservice implementation to see if that works.
I appreciate the comment but the issue boils down to ComputeAsync returning no paths, nothing that I think Simplepath would make worse or not.
I’m digging in causes for the no path issue and the bigger question as to WHY it simply stopped working on a day where no updates had been made to the game.