I’m currently using PathfindingService to control idle zombies.
It’s great but the main issue is how it doesn’t detect walls correctly and as a result zombies walk into walls ALOT on some maps.
Solution
Optionally you could make all walls 4 stud thick, but that’s just not an option for any realistic development team.
Instead I suggest that an option in studio was added where I can generate a static world model of the map and inspect it to make sure all walls are covered. This is then saved and loaded just like terrain objects are saved/loaded.
Then when you load a map you can add it to the pathfindingservice and when you remove the map you can clear pathfindingservice from all added worlds.
Functions suggested
local world = PathfindingService:GenerateWorld()
PathfindingService:Add(world)
PathfindingService:Clear()
If my intuition is correct, the pathfinding service uses similar vertex world that terrain uses in order to calculate it’s path. It would then make sense to basically make a second “terrain” editor option that only creates/show/edit pathfindingworlds.
_If this was added then alot more people would take advantage of pathfindingservice!_emphasized text
I think what you’re suggesting can be implemented quite easily in Lua opposed to what PathFindingService does currently (uses actual geometry, not just a simple node graph AFAIK). I don’t know if Roblox should provide a stock method to disconnect the movement graph from the world geometry. It seems it’d be hard to use and hard to debug if something does go wrong in your constructed graph – they’d also have to include tools to view/edit the movement graph for that to work. All in all, probably better to leave this up to a plugin/modules.
Specifying the size of the moving model (with some default value such as a radius of 1 stud or so) would likely be a simpler solution to this problem - the higher the size, the more the NPC would avoid the walls, and it could be appended when calculating the path.
Node Mapper for Pathfinding Crazyman also just made some node mapper, which could help you out a bunch with your pathfinding issue as a manual solution - I’m not certain how fast it is against PathfindingService, though - though all times when I’ve used PathfindingService, it was pretty slow and restricted to default-humanoid situations only, which is quite depressing
There is no need to detect walls if you specify nodes. For example Crazyman32’s plugin.
Maps on ROBLOX tend to be static, therefore a dynamic solution is unnecessary overhead. Unless your map is expected to change dramatically to the point where nodes would not be ideal, you’re better off doing nodes.
Also to restate what I said since you misunderstood; zuexcg is not tweaking the pathfinder system. Instead, there was a demo that changed the lighting vowel grid to 1x1x1 from 4x4x4 which is what we are currently at. This would allow better wall detection.
You don’t have to write your own at all – I’ve seen at least 3 open source modules posted on this forum before, one of them also has an editor as plugin I think.
Tnx but I already made such a node system way back.
It worked… ok. Was rather tedious work to set up all the nodes and connecting them. Also gave the zombies a very rigid walkpattern. Easily forming lines instead of finding shortest path.
Because built in functions are almost always faster than custom built for loop scripts. Not to mention the visual and structural aspect of it.
What I suggest here is a huge improvement to the pathfindingservice!
It makes it easy for everyone to create smart AIs without having to install plugins, implement 13 difference opensource projects, then spending 14 days debugging because the source have bugs and haven’t been updated etc.
Yes, as always you can work around everything. We don’t even need a pathfinding service at all, you can hardcode that aswell if you wish. But we still have pathfindingservice because it’s easier to use than suggested methods. That’s why I suggest an improvement for it.
Thanks, @PlaceRebuilder for this suggestion.
We are currently working on improving pathfinding, and visualizing the navigation mesh is something we will consider.
For the time being, you can try setting EmptyCutoff to 0.
So even the thinnest walls will fill the voxels they touch and considered as obstacles by PFS.
There’s also a known bug that causes MeshParts to be completely ignored by PathfindingService in certain situations. That problem will be solved soon.
It’d be really nice to be able to edit the world because then you could make sure all walls are detected but destroyable obstacles like windows and doors are not; effectivly making the zombies crush through the windows and doors for quickest path in