Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: