Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pathing rework 2 #1139

Merged
merged 2 commits into from
May 18, 2024
Merged

Pathing rework 2 #1139

merged 2 commits into from
May 18, 2024

Conversation

hemoridos
Copy link
Contributor

@hemoridos hemoridos commented May 18, 2024

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.

Reorganized pathing code to commonly usable classes.
Various minor bug fixes and optimizations.
Fixed tanks retargeting nearest enemy after move order.
@akarnokd akarnokd merged commit 8036965 into akarnokd:master May 18, 2024
@hemoridos hemoridos deleted the pathing_rework_2 branch May 23, 2024 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants