Improving Pathfinding Quality With New Algorithm

caption
This is all what I have to say about these updates

29 Likes

@watIsInTheName & the team, thanks so much for all your attention to pathfinding (and your patience with all those obstructions), and even bringing partial paths back to life!!

Cannot be more excited to use this in production, it’s really awesome :heart:

6 Likes

This is so FIRE!!! Ive had so many issues with pathfinding and this is a crazy huge improvement!

1 Like

Yes once this new algorithm is default in production, ClosestNoPath will be marked as un-deprecate from documentation.

7 Likes

PathTestB.rbxl (226.3 KB)

The RIG struggles to get downstairs. the near stair jitter bug still exists
@watIsInTheName

1 Like

Absolutely huge improvements, thank you :grinning:

1 Like

If I’m not using pathfinding, can changing the new pathfinding setting under Workspace affect my game performance?

1 Like

No if you are not using pathfinding this should not effect the game performance.

3 Likes

I was enabled this in my baldi project game and during testing the playtime npc got stuck

5 Likes

Can we please get a place file (rbxl) to reproduce this issue.

3 Likes

Okay I will send it in a private message I don’t want people randomly downloading my game

2 Likes

I wonder what’s the tech behind this improved algorithm. Is this still using A*? also, is there a new algorithm for the nav mesh?

1 Like

I’m nothing but excited. Going to go see if it’s made some big differences.

1 Like

	if path.Status ~= Enum.PathStatus.NoPath then
		local points = path:GetWaypoints()
		if points and points[3] then
			
			character.Humanoid:MoveTo(points[3].Position)
			
		end
	end

Looks like that the issue is the NPC movement logic. The code snippet you provided calls ComputeAsync frequently and consistently moves the NPC to the third waypoint. As red line in the image, when the NPC reaches the depicted position, moving directly to the third waypoint results in the NPC getting stuck. The NPC should instead be moved sequentially from waypoint 1 to N to ensure smooth navigation.

3 Likes

Okay done I sent the rbxl file to you hope you fix the problem

2 Likes

Can you check the other file. in the other file I used the code from ROBLOX official tutorial page.
this is the other file
PathTestB.rbxl (226.3 KB)

1 Like

this is a fire update to pathfinding service but i have 3 questions :-
is there is any possibility for increasing the path length limit ?
why there is an option to disable these improvements or it is just for the early release ?
is agent can climb going to get fixed because if can climb set to true the NPC will still not able to climb truss

1 Like

Yes this is an early release to get feedback from the community. Incase some games are having bad pathfinding behavior due to these improvements they can disable it while we fix the issue.

4 Likes

roblox studio is getting so much updates this year , this is crazy i can not imagine what will the studio look after 2-3 years

2 Likes

This is awesome!
Although I do have one teeny-tiny feature request.

Can we please get a function to make pathfinding ALWAYS return partial paths?

I’d like to have a pathfinding function that only returns partial paths for improved performance, but also for more realistic NPCs, I sometimes want enemies to take a wrong turn on purpose and lose their target or begin searching in random places.

I like the idea of being able to make simple AI where I can simulate NPCs getting lost / seeking or trying to approximate paths rather than always fully calculate the entire path start to finish.

Pathfinding service also has a limit of the maximum length that a path can have, if I recall, using pathfinding for distances longer than 2000+ studs causes it to just not work at all or error?

I just want to be able to use pathfinding service to calculate approximated / guessed paths rather than full start-to-finish paths.

This can also speed up performance in a project where there might be hundreds of NPCs moving around all at once where the intend for them is to not always find the player but guess where the player COULD be.

Having this as a built-in feature would save me a TON of time implementing own / custom pathfinding instead that does this.

2 Likes