How 2 make A* Pathfinding

Sure, I’ll do it tomorrow since I’m out of town and the laptop’s occupied. Though, I don’t think it’s too hard to grasp (that if you read the part 2). Lmk what’s not clear in the topic since there also will be a part 3 so I could reiterate the draft

Open source would be great. !

I loke reviewing the code that way

Thanks

You should add Heap to increase performance, also you could give option to calculate the path from the last part to increase the speed

There’s already that in part 2

I couldn’t quite get what you mean

instead of Retrace the path, you could just make it so the path follow the one point before the last point.

Like astar(goal, startpoint)

Thats really easy to modify, though I digest. I’ll do that on part 3

Maybe add a vaiable to the node called “Parent” and i used this to retrace
`
while Data.LowestFCost do
task.wait()

	local Ball=Instance.new("Part")
	Ball.Shape=Enum.PartType.Ball
	Ball.Size=Vector3.new(2,2,2)
	Ball.Position=Data.LowestFCost.Position
	Ball.Anchored=true
	Ball.CanCollide=false
	Ball.CanQuery=false
	Ball.Material=Enum.Material.Neon
	Ball.BrickColor=BrickColor.new("Lime green")
	Ball.Parent=workspace
	
	table.insert(FinalNodes,Data.LowestFCost.Position)
	Data.LowestFCost=Data.LowestFCost.ParentNode
end

print(Done Path)
return FinalNodes

`

Best way to teach A* is to teach graph theory and then Dijkstra algorithm as a* is just an extension of Dijkstra

1 Like

I made this tutorial for those that wants to create their own A* pathfinding. I know that everyone doesn’t have the same knowledge at their disposal but I suppose that its pretty easy to grasp if you analyze the pseudocode, if not, I’d just watch Sebastian Lague’s A* video.

With that being said, I will try to explain more in depth on part 3

2 Likes