Pathfinding movement functions for A* and theta have been combined into one generic function.
Ensure next goal is always set if there is a valid path.
Checking if mob has reached the next goal improved - now works no matter the mob height, and the height of the node below the goal.
mob:pos_in_box now can take a size param that is a table. Using this to add stepheight to the box height, to fix issues with mobs stepping up onto next node before hitting the goal.
Mobs now won't overshoot their goal, if they're very close to it (less than mob width) their speed reduces.
The more a mob is turning, the less forward velocity it has. This should fix spinning a lot.
mob:pos_in_box now can take a size param that is a table, containing the separate width and height.
pathfinding.moveable no longer pads an extra 0.2 around the width of mob when checking if there is sufficient space for the mob.
pathfinding.get_neighbors now uses max_fall for the maximum distance we can go down, instead of stepheight.
mob_meta.get_node_height:
Moved to pathfinding, and made public (creatura.get_node_height).
Now uses collision box rather than node box, if available, unless flag specifies not to.
Fix for getting node height for nodes with connected node boxes
pathfinding.get_ground_level:
We now have one copy between pathfinding and mob_meta.
Can check a larger range of nodes at different heights.
Takes into account node height of both target node, and the height of the node we're coming from.
pathfinding.get_neighbors:
Get maximum distance mob can travel up/down from mob stepheight.
Improved checking diagonals are clear.
Improved checking vertical clearance, takes into account height of current and target node.
Vertical clearance can cope with nodes that have a different collision and node boxes, like snow.
Vertical clearance has a tiny height adjustment so a 2 node heigh entity can fit through a 2 node gap.
Fixed bug where it was assumed a node was reachable if it's the end goal.
methods.movement_theta_pathfind and movement_pathfind:
Fixed bug that raised goal pos by 0.5 nodes.
1. Spawning radius fixed, we now have a cubic max radius mobs will spawn within, and a spherical min radius mobs won't spawn within.
2. Node light check fixed - we need to check the node above the spawn node, otherwise it always returns zero.