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

Let harvesters only search for refineries when needing to unload. #18586

Merged
merged 1 commit into from
Jan 10, 2021

Conversation

tovl
Copy link
Contributor

@tovl tovl commented Sep 4, 2020

Fixes #18563

Queueing a callfunc on creation was unneeded, since DeliverResources will take care of linking with a new refinery when needed anyway.

if (!searchFromLoc.HasValue)
{
searchFromLoc = self.Location;
searchRadius = harvInfo.SearchFromHarvesterRadius;
Copy link
Member

Choose a reason for hiding this comment

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

Won't this mean we use SearchFromProcRadius in case we use self.Location?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, that is the idea. Without this, the range for the initial search is too short, causing harvesters in the shell maps to stall.

Apart from the initial search, Self.Location is only really used for the center of the search as a last resort.

Copy link
Member

Choose a reason for hiding this comment

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

Sigh, guess I need to finally revisit #18198 to get rid of this mess. (Or at least reduce it.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can take that over if you like. After all, I did the the big harvester refactor last time and some issues where deliberately left hanging then. I would be happy to finish what I started.

Copy link
Member

Choose a reason for hiding this comment

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

If you want to go for it. I'm just no longer sure if it should search from the refinery first. Probably it still should, but return to the refinery to unload first before doing more scanning in case no ore is in the refinery radius.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I already have some ideas on how to deal with this. I will probably split things in multiple PRs and take on some related dangling issues with harvester behaviour while I'm at it, so that we can close this topic once and for all. I would like to get this PR merged first though before I go further, because it is all closely related and it makes more sense to handle this in a linear fashion.

Copy link
Member

Choose a reason for hiding this comment

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

Do we want the has dependencies labels on this PR then?

Copy link
Member

@Mailaender Mailaender left a comment

Choose a reason for hiding this comment

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

This works as promised and the code changes look convincing.

@reaperrr reaperrr merged commit 560c323 into OpenRA:bleed Jan 10, 2021
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.

Harvesters lock onto refineries next their spawn
5 participants