Implemented basic pathfinding for space war based on ground war methods so for now all ships are treated as 1x1 sized, but that can be iterated upon.
For this I created a class structure for common pathing and movement methods that are used by both ground war and space war battles since most of the mechanics are the same.
There were some changes made to how spacewar movement is handled to fit the new pathing mechanics. Scripting was also updated to work with the new code.
Also added a node weighing mechanic to encourage spreading paths when groups of units are moving together. A weight is added to each node on the grid for each path touching that node. This weight is used when calculating the distance between two neighboring nodes. It is very basic and does not differentiate between the players nor does it use weights on vertices, but it does the job.
The pathfinding in spacewar can be disabled in the settings to use freeform movement.
Besides the pathfinding there are some additional changes:
Kamikaze fighters also use pathing and are now controllable until impact. This means that is the target if destroyed before impact the fighter will stop or it can be ordered to stop.
Ships no longer chase down incoming missiles. They will still prioritize them if they come into range, but do that while standing still.
Groundwar unit rotation and angle is calculated based on the underlying pathing/surface grid and not the rendered surface. Their angle is converted to isometric when a unit is drawn.
Added a lightweight angle normalization method to the U utils class to get a "good enough" normalized angle fast.
Fixed again ground units not firing at buildings, hopefully for the last time.
Zeuson governor mission scripting now uses landing zone when the Unknown fleet is intercepted near the planet.
Fixed ground units not following move orders when near an enemy unit.
Implemented basic pathfinding for space war based on ground war methods so for now all ships are treated as 1x1 sized, but that can be iterated upon. For this I created a class structure for common pathing and movement methods that are used by both ground war and space war battles since most of the mechanics are the same. There were some changes made to how spacewar movement is handled to fit the new pathing mechanics. Scripting was also updated to work with the new code. Also added a node weighing mechanic to encourage spreading paths when groups of units are moving together. A weight is added to each node on the grid for each path touching that node. This weight is used when calculating the distance between two neighboring nodes. It is very basic and does not differentiate between the players nor does it use weights on vertices, but it does the job. The pathfinding in spacewar can be disabled in the settings to use freeform movement.
Besides the pathfinding there are some additional changes: