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

Add IMove.MoveOntoTarget interface #20621

Merged
merged 2 commits into from Apr 21, 2023
Merged

Conversation

PunkPun
Copy link
Member

@PunkPun PunkPun commented Jan 19, 2023

Closes #19163
Split from #20168
Addresses some concerns from #20187

IMove.MoveOntoTarget

  • This method is needed to properly unify aircraft and ground unit docking.
  • Because Aircraft have to integrate turning into their Land code I had to integrate it into Mobile as well. I've done it with the new MoveOntoAndTurn activity.

MoveOnto Activity

  • I've changed the way ground units wait for dock. Now the dock position is dynamically tracked and proper offsets are applied. This is basically the new way of of tracking, we didn't have any method of tracking a position with an offset before.
  • It works by giving the pathfinder the exact position of the dock, but when we reach 1 cell distance to the target and the target is blocked, we return no path thus forcing the pathfinder to wait. After conditions have changed we start pathing again. (Instead of the current solution of giving pathfinder all positions around the dock)

In the first commit I haven't done any functional changes to MoveWithinRange nor MoveAdjacentTo. I've just moved the code around to allow better overwriting.

The testcase is there just to show off that you can now dock to moving docks. It's still not properly supported as in docked units don't attach and there are probably some bugs. But it's a start.

@PunkPun PunkPun force-pushed the and-move-turn branch 2 times, most recently from 7ff1eac to a310c87 Compare January 20, 2023 19:33
@PunkPun PunkPun added this to the Next + 1 milestone Jan 20, 2023
@PunkPun PunkPun force-pushed the and-move-turn branch 2 times, most recently from beb1a0f to 9988882 Compare January 24, 2023 11:58
Mailaender
Mailaender previously approved these changes Jan 27, 2023
OpenRA.Mods.Cnc/Traits/TDGunboat.cs Outdated Show resolved Hide resolved
OpenRA.Mods.Common/Activities/Move/MoveAdjacentTo.cs Outdated Show resolved Hide resolved
OpenRA.Mods.Common/Traits/CarryableHarvester.cs Outdated Show resolved Hide resolved
OpenRA.Mods.Common/Activities/Move/MoveOnto.cs Outdated Show resolved Hide resolved
No functional changes to `MoveWithinRange` nor `MoveAdjacentTo`. I've just
moved around code to for allow better overwriting.
In `TraitsInterfaces` we expose offset as WPos instead of CPos. In an upcoming PR we'll translate the same change to yaml.
abcdefg30
abcdefg30 previously approved these changes Apr 12, 2023
@PunkPun
Copy link
Member Author

PunkPun commented Apr 12, 2023

dropped the testcase

@Mailaender Mailaender merged commit dc390a7 into OpenRA:bleed Apr 21, 2023
3 checks passed
@Mailaender
Copy link
Member

Changelog

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.

TS harvester can't be moved while waiting to deliver to refinery
4 participants