UFOAI: Pathfinding
Introduction
This document concentrates on moving (pathfinding) of 2x2 units in UFO:AI. 1X1 units are basically the same except for diagonal checks. The rest is much more simple. Also most of the examples and descriptions completely ignore the 3. dimension (z axis) although it is used in the code as 3rd argument for really every function. It will become very important when it comes to falling units later on though.
UFO:AI Pathfinding for 2x2 units
Programming information:
For more information on the code used for pathfinding see
http://ufoai.ninex.info/wiki/index.php?title=TODO/General/Support_for_2x2_units
cl_actor.c (Client):CL_ConditionalMoveCalc (Grid_MoveCalc)
g_client.c (Server):G_MoveCalc (as gi.MoveCalc)
cmodel.c:Grid_MoveCalc
cmodel.c:Grid_MoveMarkRoute
cmodel.c:Grid_MoveMark
cmodel.c:Grid_CheckForbidden
The size of a unit is stored in le->fieldSize or ent->fieldSize
Its position (x,y,z) is located in le->pos or ent>pos