Opened 18 months ago

Closed 15 months ago

Last modified 15 months ago

#5454 closed defect (fixed)

Building construction unable to start with animals in the corner

Reported by: Krinkle Owned by: wraitii
Priority: Release Blocker Milestone: Alpha 24
Component: Simulation Keywords: regression
Cc: Patch:

Description (last modified by Krinkle)

Trying out the latest trunk locally (macOS). Single player mode, got random civ as Britons. After about 3 minutes I build a storehouse and no matter what I do to it, it won't build. It stays at health 1/640. Added units, removed units, won't go up.

Replay and screenshots attached.


  • Last Changed Rev: 22373
  • Last Changed Date: 2019-06-14 08:58:19 +0100 (Fri, 14 Jun 2019)

Attachments (11)

01-builder.png (1.7 MB ) - added by Krinkle 18 months ago.
Screenshot
02-buiders.png (1.5 MB ) - added by Krinkle 18 months ago.
Screenshot
12-builders.png (1.8 MB ) - added by Krinkle 18 months ago.
Screenshot
commands.txt (44.9 KB ) - added by Krinkle 18 months ago.
0.0.24 replay
commands.2.txt (10.1 KB ) - added by Krinkle 17 months ago.
commands.txt (as of r22373)
problem-spot-before.png (669.3 KB ) - added by Krinkle 17 months ago.
problem-spot-after.png (1.1 MB ) - added by Krinkle 17 months ago.
commands.r22434.buggy.txt (10.4 KB ) - added by Krinkle 17 months ago.
buggy commands.txt as of r22434
commands.r22442.bug.txt (10.4 KB ) - added by Krinkle 17 months ago.
buggy commands.txt as of r22442
commands.rr22443.bug.txt (11.9 KB ) - added by Krinkle 17 months ago.
buggy commands.txt as of r22443
screen-r22443-bug.png (641.1 KB ) - added by Krinkle 17 months ago.

Change History (28)

by Krinkle, 18 months ago

Attachment: 01-builder.png added

Screenshot

by Krinkle, 18 months ago

Attachment: 02-buiders.png added

Screenshot

by Krinkle, 18 months ago

Attachment: 12-builders.png added

Screenshot

by Krinkle, 18 months ago

Attachment: commands.txt added

0.0.24 replay

comment:1 by Krinkle, 18 months ago

  • Last Changed Rev: 22373
  • Last Changed Date: 2019-06-14 08:58:19 +0100 (Fri, 14 Jun 2019)
Last edited 18 months ago by Krinkle (previous) (diff)

comment:2 by Krinkle, 18 months ago

Description: modified (diff)

comment:3 by Krinkle, 18 months ago

For what it's worth, still seeing this on r22392 as well.

As wraitii suspected, it indeed appears to be related to the positioning of chickens.

I didn't realise it before, but in my default map there are chickens right where I typically place a storehouse, so it keeps happening. The time to finish reflects the number of workers correctly, but it's not counting down. Moving units away from the construction site and assigning them does not solve the issue.

Ordering the units to kill the chicken instead results in the chicken dying, but then the units are also unable to collect the food. So it is stuck in both directions.

I can't finish building a house where a chicken is alive, and I cannot collect food where an unfinished building is.

But, I can kill a chicken where an unfinished house is, and I can finish building a house where uncollected food is. So killing the chicken and then taking the astonished units from the chicken back to the building makes it possible.

Anyhow, definitely a regression we'll want to fix before A24 :D

comment:4 by Krinkle, 17 months ago

Still seen on r22434, and narrowed down a bit:

  • Start single player game with any civ.
  • Select one or more units and build a storehouse or barracks where one or more chickens are walking.

People will act like they're building, and a timer is shown (e.g. 45 seconds remaining). But it is not ticking down, and building health remains at 1 of N (e.g. 1/2000).

It seems (not sure if coincidence or not) that after waiting long enough (maybe 10 seconds or so, and switching between the game and my browser) the chicken started walking away from the construction site, and after that finished, the builders started to make progress.

The fact that the chicken starts walking away could be a coincidence, or maybe it depends on other circumstances. In any event, when I first reported the issue I was in a situation where the building made no progress for well over 2 minutes of game time (and no chickens were walking away from the construction site). So either this behaviour was added in the last 2 weeks, or maybe there are scenarios where they can and cannot walk away.

comment:5 by elexis, 17 months ago

(10:36:10 AM) wraitii: I think it's either r22430 or r22426
(10:36:51 AM) wraitii: Possibly r22422

by Krinkle, 17 months ago

Attachment: commands.2.txt added

commands.txt (as of r22373)

by Krinkle, 17 months ago

Attachment: problem-spot-before.png added

by Krinkle, 17 months ago

Attachment: problem-spot-after.png added

by Krinkle, 17 months ago

Attachment: commands.r22434.buggy.txt added

buggy commands.txt as of r22434

by Krinkle, 17 months ago

Attachment: commands.r22442.bug.txt added

buggy commands.txt as of r22442

by Krinkle, 17 months ago

Attachment: commands.rr22443.bug.txt added

buggy commands.txt as of r22443

by Krinkle, 17 months ago

Attachment: screen-r22443-bug.png added

comment:6 by Krinkle, 17 months ago

OK. I spent a while bisecting the issue with Git, only to find myself with a rather meaningless and confusing sequence of some commits being buggy and some not.

While it isn't inconceivable that it was fixed and then broken again etc., I decided to go back to each of the commits I tested already and check again, and I got different results.

Turns out, the issue is even more specific than I previously assumed, and it was rather my inability to pixel-perfectly perform the same steps each time, that caused the results to vary.

  • The issue was not affecting all construction of buildings.
  • This issue was not affecting all construction of buildings atop animals.
  • This issue was not affecting all construction of storehouses atop chickens or sheep.
  • Refined conclusion: This issue is affecting construction of buildings atop animals whereby an animal is in the corner of the construction site. Specifically, when an animal is outside of an (imaginary) large circle or rounded rectangle within the rectangle of the construction site, so at the very corner of the area where an animal would prevent construction from starting.

To make matters more complicated, the area that is visually painted by the construction site, and the area where animals are not allowed is not 100% the same. There appears to be a small border around the building where the ground is textured by the building, but not considered "blocked". This is fine in regular play and once completed are generally areas where a roof would hover over top of (so it makes sense to allow a unit to be near there so that it can actually walk all the way towards the wall and not be blocked by an invisible wall). But, this does make reproducing this bug harder when the building is not visible yet (merely a construction site).

Equipped with all this knowledge, a third bisecting to help narrow down the cause:

  • r22373 (a5b66619f3): BUG (replay attached)
  • r22421 (de0f60744): OK fixed (maybe?)
  • r22422 (085136a4f0): BUG, but had to try twice with the same chicken.
  • r22423 (9eaa35f321): BUG
  • r22425 (78335dd1dc): BUG
  • r22426 (138d72375e): BUG
  • r22428 (185695713c): OK fixed
  • r22429 (c400c1a94f): OK still fine
  • r22430 (247c8b0975): OK still fine
  • r22431 (7c24fda69b): OK still fine
  • r22434 (03fc36b03c): BUG, again? (replay attached)
  • r22440 (1269531f25): BUG
  • r22441 (8605d8df5b): BUG
  • r22442 (245a26a87f): BUG
  • r22443 (cea525308): BUG (latest trunk as of writing, replay attached)

comment:7 by Krinkle, 17 months ago

Owner: set to wraitii

comment:8 by Krinkle, 17 months ago

Summary: Storehouse building sometimes stuck at 1 healthBuilding construction unable to start with animals in the corner

comment:9 by Krinkle, 17 months ago

Priority: Should HaveMust Have

comment:10 by wraitii, 17 months ago

Hey Krinkle, thanks for this detailed bug report.

For your information, and you might know that already, you can easily perform pixel-perfect replays by starting 0 A.D. with the '-replay=XX' or '-replay-visual=XX' flags, and replacing XX by the path of a commands.txt replay (you can find where those are stored at GameDataPaths). Of course, if the changes make the game act differently, it might not work, but for very limited tests it generally works well.

You may also enter Alt+D to enable the developer overlay and see pathfinder debug and obstruction sizes (which are different from the footprint and drive unit motion)

I still have two patches upstream (https://github.com/wraitii/0ad/commits/D13_outtakes) that might affect this - or might not in this very particular edge case, in which case it'd be quite interesting.

I'll assign this to myself, and intend to fix it at the end of the week at the latest.

Last edited 17 months ago by wraitii (previous) (diff)

comment:11 by wraitii, 17 months ago

Okay, so this is a completely different issue. What happens is the chicken is trying to leave the foundation of the 2nd dropside, but since that has disappeared, it stops moving, and can't ever leave its WALKING state... Only we have a check in "LeaveFoundation" to not re-order if we are currently leaving a foundation (which the chicken is) and thus infinite loop.

This is fixed in D1907 by making the chicken go idle.

comment:12 by wraitii, 17 months ago

The above is indeed fixed by D1907 combined with D1979.

comment:13 by elexis, 15 months ago

Component: Core engineSimulation
Priority: Must HaveRelease Blocker

Is this issue still occurring with recent svn?

(On Release-blocker priority: If this is a new simulation bug, I sugget to put the ticket into a category where it is not easily forgotton. Noone looks at "Must-have", but we look at "release blockers". Perhaps there could also be a new category with "Regressions", perhaps a keyword, then one could identify those too without setting a RB priority if the bug is not bad enough for RB. We should probably have that keyword, but it's fake if it's not set to all the regression tickets and we have > 5000 tickets. So maybe later.)

comment:14 by wraitii, 15 months ago

I think Release Blocker is fine for regressions that we intend to fix before releasing. That doesn't have to mean they're the top priority to work on, but they must be fixed at some point.

I believe this no longer happens in svn, I don't quite recall why I didn't close this when I commented above. I guess I wanted to leave it open in case someone noticed that still happening, and I must have forgotten to close it.

comment:15 by wraitii, 15 months ago

Maybe we need an "EMERGENCY" category above release blocker for stuff that must be looked at ASAP because it breaks svn.

comment:16 by wraitii, 15 months ago

Resolution: fixed
Status: newclosed

comment:17 by elexis, 15 months ago

Keywords: regression added
Note: See TracTickets for help on using tickets.