This isn't even really a question for Roblox itself, since it has it's own pathfinding, but how do I calculate heuristics for Manhattan/Euclidiean distance for A*. I'm pretty sure euclidian is like square root of (a-c) + (b-d), and Manhattan is like (a-c) + (b-d).
Is this correct?
You could calculate it like this:
local abs = math.abs; local function ManhattanDistance(a, b) return abs(a.X - b.X) + abs(a.Y - b.Y) + abs(a.Z - b.Z); end