Opened 12 years ago
Closed 12 years ago
#1511 closed defect (fixed)
Workers will start building field foundations when the building they worked on is built
Reported by: | wraitii | Owned by: | Deiz |
---|---|---|---|
Priority: | Should Have | Milestone: | Alpha 11 |
Component: | UI & Simulation | Keywords: | unitAI field farm building |
Cc: | Patch: |
Description
Builders, when they become idle, will switch to any nearby foundation and start building it. While this is the intended behavior, it has the unfortunate side-effect of also working with farms: a builder may see an unbuilt farm and go build it... Turning him into a farmer when the farm is finished.
I find it inconvenient: one usually wants to return the builders to their original task/something else and one may "lose" units from sight.
I suggest changing the UnitAI behavior to only work with all nearby non-field foundations.
Attachments (1)
Change History (7)
comment:1 by , 12 years ago
comment:2 by , 12 years ago
I thought, maybe in ResourceGatherer.prototype.GetTargetGatherRate
binaries/data/mods/public/simulation/components/ResourceGatherer.js 325
we could do something like this:
var rates = this.GetGatherRates(); + if (type.generic == "food" && type.specific == "grain" && rates.length) // only one can farm + return 0;
but this doesn't seem to change the farming behavior yet. without the rates.length it does stop all of them
comment:3 by , 12 years ago
Well, I think the case here is "auto-order at a dropsite". In that case, the unit can help build the building, but should not start gathering. If it's player order, start gathering (unless, like right now, there are other orders after that).
by , 12 years ago
Attachment: | harvest_on_cmd.patch added |
---|
Harvest only when unit initiated the building
comment:5 by , 12 years ago
Did a bit of testing, the patch seems to behave as expected. This issue has annoyed me at times, so thanks for the patch.
Dropsites are the same way, when a builder finishes a dropsite, they will start gathering the nearest supported resource, unless the order was a queued build order. I can see this being unintended behavior in the same sense.
The cases to think about are: queued vs. non-queued orders, dropsite/field vs. other building, player order vs. auto order, and initial vs. final target. It would be easy to fix one and break another.