Opened 11 years ago
Last modified 3 years ago
#1791 reopened defect
Units command queue is reset when they enter new formation
Reported by: | zoot | Owned by: | |
---|---|---|---|
Priority: | Should Have | Milestone: | Backlog |
Component: | Simulation | Keywords: | formations |
Cc: | Patch: |
Description (last modified by )
Steps to reproduce:
- Task one soldier to gather resources.
- Task another soldier to gather resources somewhere else.
- Select both soldiers.
- Queue the soldiers to build a house.
What happens: The soldiers immediately stop their current task and begin building the house.
What I expected would happen: The soldiers should complete their current task before they begin building the house.
OR
Steps to reproduce:
- Begin building house with a soldier.
- Select him and another soldier and queue-order them to build another house.
What happens: The soldiers immediately stop their current task and begin building the second house. This is bad because it is very common to add workers to a building task one-by-one as they become available from other tasks.
Attachments (1)
Change History (22)
comment:1 by , 11 years ago
Description: | modified (diff) |
---|
comment:2 by , 11 years ago
comment:3 by , 11 years ago
I agree with the sentiment that this is not worth trying to fix. UnitAI is ugly enough already, this is an unusual case and the expected behaviour is not well defined.
comment:4 by , 11 years ago
Though I understand the reasoning, I very much disagree that this is an unusual case. I'm convinced a lot of people will run their head against it once they have just a tiny bit of routine.
comment:5 by , 11 years ago
Seems like something for a design committee. To me, it seems like we need a new system here: If a unit is gathering resources, building something replaces the current order. If the unit is building something, building something else queue after the current order.
comment:6 by , 11 years ago
The code in Commands.js (GetFormationUnitAIs) could check each units order queue, but I don't really see how that would improve much.
comment:7 by , 11 years ago
Here's an even worse case:
- Begin building house with a single soldier.
- Now order a second soldier to begin working on the same house.
- Now order a third soldier to begin working on the same house.
- While the soldiers are still building the house, select them and queue-order them to build another house.
What happens:
The soldiers immediately stop their current task and begin building the second house. This is bad because it is very common to add workers to a building task one-by-one as they become available from other tasks.
comment:8 by , 11 years ago
Description: | modified (diff) |
---|
comment:10 by , 10 years ago
Keywords: | design added |
---|
comment:11 by , 9 years ago
Description: | modified (diff) |
---|
comment:12 by , 9 years ago
At times it happened to me to build a civic centre / tower / fortress and then queuing those units to build more things or attack the enemy, expecting that they finish the building first. But they end up having the structure built only 98% and then moving away (often it wasn't noticed).
Another example is to queue some enemies to attack. They will not finish their first target before moving to the next.
leper has given some hints on irc on how to implement the update.
by , 9 years ago
Attachment: | units_cancel_order.gif added |
---|
An illustration of how the current order is canceled when the intention was to queue an order.
comment:13 by , 9 years ago
Description: | modified (diff) |
---|---|
Keywords: | design removed |
Priority: | Should Have → Must Have |
Summary: | Citizen soldiers' command queue is reset when they enter new formation → Units command queue is reset when they enter new formation |
comment:14 by , 8 years ago
Milestone: | Backlog → Alpha 20 |
---|
comment:16 by , 8 years ago
Milestone: | Alpha 20 → Backlog |
---|
comment:17 by , 5 years ago
Component: | UI & Simulation → Simulation |
---|
Move tickets to Simulation
as UI & Simulation
got some sub components.
comment:18 by , 4 years ago
Description: | modified (diff) |
---|---|
Milestone: | Backlog |
Resolution: | → invalid |
Status: | new → closed |
Fixed along the way. Somewhere between A20 and A23b apparently. A not so quick search couldn't find a relevant commit.
comment:19 by , 4 years ago
Keywords: | formations added |
---|---|
Milestone: | → Backlog |
Resolution: | invalid |
Status: | closed → reopened |
Ouch, I was too trigger happy.
First, see also #3479, secondly, the issue still exists, albeit only using formations. So perhaps these tickets can still be closed and a new one specifically for formations can be made.
comment:21 by , 3 years ago
Priority: | Must Have → Should Have |
---|
(I think this was referring to formations since back then they were active by default).
The root cause of this 'bug' is that units are immediately put in formation, as they discard their current order. As written above, doing this in a "deferred" manner seems non-trivial: should units wait for others? How to determine which units should be part of the formation in the future? How to handle deaths? It's unlikely that all units will stop their current order at the same time. All that seems rather complex, and possibly un-necessary.
r24480 / Phab:rP24480 introduces "formation->noformation" queuing but that's much easier than the opposite, and it's still _kinda_ hacky. Further, that diff circumvents the issue by using formations for walking only, and by ignoring formations for queued orders (fixing the reproduction above of 'assign units to buildings, then queue a move order)
I don't think the ticket is necessarily invalid or fixed, but it's no longer a 'must have' IMO.
I'm not really convinced that this is a bug. I know that this happens, check GetFormationUnitAIs in simulation/helpers/Commands.js to see why.
What should happen? The newly created formation should wait for all units to finish their current tasks? What if one of those units is in a formation with a lot of queued tasks? Should the new formation wait for that one to finish? Should they just start executing the task on their own? What is the purpose of formations then?
(It doesn't happen for female citizens, because they can't use formations)