What's the unit of a node's penalty?

I’m changing a node’s penalty at run-time using the method described here: http://arongranberg.com/astar/docs/graph-updates.php#penalty .

Before finding this I tried addPenalty = 1, which did nothing, then 100, then 1000 and eventually I tried 10000 as described in the link, which worked (my seeker chose a path around the penalised nodes). However the rather cryptic description of “//Here goes the penalty to apply, you need quite large values usually” means I’m not sure what units this is in, so I’m not sure how to spread out my penalties.

So if I want to have a discrete set of penalties (0, 1, 2, 3, 4), should I just multiply by 10000?

Cheers,
Shane

That would be something like 1 penalty = 1000 world units or something. The reason is that normal node to node costs are based on the Int3 (instead of Vector3) precision, it is currently set to 1000, which means one world unit will represent a change of 1000 in Int3 space. Since costs in a path are relative, not absolute (all costs could be multiplied by 1000 and nothing would change really), the penalty values you need to apply will be indirectly based on the Int3.Precision.

Long story short, A penalty value of 10000 usually represents the same cost as a unit walking 10 world units.

Ah, that makes complete sense. Thanks, Aron.

Cheers,
Shane