Skip to content

Last docking PR for release#21565

Merged
pchote merged 8 commits intoOpenRA:bleedfrom
PunkPun:docking-release
Oct 13, 2024
Merged

Last docking PR for release#21565
pchote merged 8 commits intoOpenRA:bleedfrom
PunkPun:docking-release

Conversation

@PunkPun
Copy link
Member

@PunkPun PunkPun commented Aug 29, 2024

Fixes #21027
supersedes #21067

Continued progress #20168
Changes taken from #20667
Changes taken from #20665

I've reduced the amount of changes to make the new docking system good enough for release

All changes contained here either have been discussed on github or discord or bug reports were submitted to discord or github

@PunkPun PunkPun added this to the Next Release milestone Aug 29, 2024

[Desc("Host actor type(s) leading to the condition being granted. Leave empty for allowing all hosts by default.")]
public readonly HashSet<string> DockHostNames = null;
public readonly HashSet<string> LinkHostNames = null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be using link types rather than actor names?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that was one of the issues yet to be solved. Linked and Unlinked notifications don't provide a link type, and adding it is easier said than done


[Desc("Client actor type(s) leading to the condition being granted. Leave empty for allowing all clients by default.")]
public readonly HashSet<string> DockClientNames = null;
public readonly HashSet<string> LinkClientNames = null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likewise here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likewise

WPos DockPosition { get; }
int DockWait { get; }
WAngle DockAngle { get; }
WPos LinkPosition { get; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These really should move out of the link interface and into the docking implementation.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's used by FindAndDeliverResources to search resources closest to the refinery, by CarryableHarvester to order carryalls to, and LinkExts to search for the closest Link

Copy link
Member Author

@PunkPun PunkPun Sep 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In other words, it's exposed for outside traits to interact with the process of moving to the link or finding the closest link

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, having a single LinkPosition is not correct for all potential types of link host. The interface should be abstracting the actions, not the implementation details (e.g. units should MoveWithinRange of a proximity host and not Move to a specific point).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, but I don't know the best way to do it. This can be iterated on in the future

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't the problem then that FindAndDeliverResources depends on Link and not Dock?

public override bool CanLinkTo(Actor hostActor, ILinkHost host, bool forceEnter = false, bool ignoreOccupancy = false)
{
return base.CanLinkTo(hostActor, host, forceEnter, ignoreOccupancy)
&& (self.Owner == hostActor.Owner || (ignoreOccupancy && self.Owner.IsAlliedWith(hostActor.Owner)));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it make more sense to require force enter to unload at an allied refinery?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why? Imo you should be able just directly order the harvester. IgnoreOccupancy is used for manual orders

@pchote
Copy link
Member

pchote commented Sep 21, 2024

The "link" interfaces still expose a lot of docking-specific things. If this really can't be fixed then I think it would be best to abandon the idea of renaming to link and just stick with docking: the abstraction issues remain, but at least it won't have the silly names.

@PunkPun PunkPun force-pushed the docking-release branch 2 times, most recently from 972b7e0 to 1c6d0b2 Compare September 22, 2024 11:03
@PunkPun
Copy link
Member Author

PunkPun commented Oct 11, 2024

The "link" interfaces still expose a lot of docking-specific things. If this really can't be fixed then I think it would be best to abandon the idea of renaming to link and just stick with docking: the abstraction issues remain, but at least it won't have the silly names.

idea abandoned.

Incase we decide otherwise this is the commit d082518

Copy link
Member

@pchote pchote left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. The controversial parts have been removed, and this is a clear improvement (focusing on bugfixes) over current bleed. Scope creeps/bugfixes can be handled in followup PRs.

@pchote pchote merged commit 67855f2 into OpenRA:bleed Oct 13, 2024
@pchote
Copy link
Member

pchote commented Oct 13, 2024

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.

Harvester unload on allied refinery automatically.

6 participants