Ticket #844 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

Idle villagers button broken (garrisoned idle units not shown)

Reported by: k776 Owned by: ben
Priority: Release Blocker Milestone: Alpha 5
Component: Core engine Keywords:
Cc:

Description

I'm clicking on it and 9/10 times nothing happens, 1/10 times it actually finds an idle unit.

Change History

comment:1 Changed 2 years ago by k776

  • Owner set to ben

comment:2 Changed 2 years ago by historic_bruno

I can't reproduce this, any more info would be helpful.

comment:3 Changed 2 years ago by k776

  • Status changed from new to closed
  • Resolution set to worksforme

I've tried getting the same issue, same map, but wasn't able to get this again.

So it's either been fixed, or was a result of some JS error that happened before the button was clicked.

I'll close this for now. If it happens again, I'll reopen for Alpha 6.

comment:4 Changed 2 years ago by historic_bruno

  • Status changed from closed to reopened
  • Resolution worksforme deleted
  • Summary changed from Idle villagers button broken to Idle villagers button broken (garrisoned idle units not shown)

Reopening because it's a valid bug. The cause is that garrisoned units are counted as idle and so get iterated like normal idle units. Then the selection and camera follow fails (presumably because the units are no longer visible). There's a few ways of solving this that I can think of:

  • Allow garrisoned idle units to be selected somehow instead of silently failing. Maybe giving them an order (e.g. move, attack, build) would automatically ungarrison them?
  • Or add an isGarrisoned flag to UnitAI. Marking units as garrisoned turns out to be trivial because they always enter the Garrisoned state, the problem is they exit said state directly after, so marking them as ungarrisoned is a bit trickier. I guess the garrison holder needs to be responsible for manually setting the flag on every unit it ejects. Or maybe units should stay in the Garrisoned state until they're ungarrisoned.
  • Or reset the isIdle flag so that garrisoned units are not counted as idle, we could say for instance that they are on guard and so not really idle at all. (This runs into a similar problem as above when they get ungarrisoned, we'd have to handle changing idleness then.)

comment:5 Changed 2 years ago by historic_bruno

  • Priority changed from Release Blocker to Should Have

comment:6 Changed 2 years ago by k776

  • Priority changed from Should Have to Release Blocker

comment:7 Changed 2 years ago by ben

  • Status changed from reopened to closed
  • Resolution set to fixed

(In [9498]) Fixes garrisoned units being found as idle (even if they are, we can't select them, so skip them instead). Fixes #844. Garrisoned units now remain in the GARRISONED state until explicitly ungarrisoned

Note: See TracTickets for help on using tickets.