#6744 closed defect (fixed)

Negative animal costs and eco points in the summary

Reported by: Langbart Owned by: Freagarach
Priority: Should Have Milestone: Alpha 27
Component: UI & Simulation Keywords:
Cc: Patch: Phab:D4951

Description

to reproduce

  • build a corral
  • make a sheep
  • check summary => score => economy score
  • check summary => resources => gathered/used

reproducible

  • works correctly in Alpha XXI Ulysses [18915]

  • Alpha XXII Venustas [19922] it shows the correct resources, but the economy score shows -5

  • Alpha XXIII [21946] negative eco score and wrong gathered/used

@temple wrote: (26/Nov/17) We keep track of the vegetarian food gathered, so I think the vegetarian ratio is still correct. It can get weird if we train some sheep but don't gather them, since that counts as negative food gathered, so the ratio could be over 100% or even negative in the very early game. But I don't think that's anything to worry about.

  • Phab:rP20543 (concerned raised - 20/Oct/19)

    @elexis wrote: It changes history, once a resource was gathered, it will remain true that the resource was gathered. Therefore the number of resources gathered should be monotonically increasing. Since the economy score is also the number of resources gathered divided by 10, it equally becomes possible to reduce the score over time. Even possible to get negative score by starting the match, training some sheep and not gathering them.

simulation/components/StatisticsTracker.js

Line 
219 if (cmpUnitEntityIdentity.HasClass("Domestic") && costs)
220 {
221 // Subtract costs for sheep/goats/pigs to get the net food gain/use for corralling
222 this.resourcesUsed.food -= costs.food;
223 this.resourcesGathered.food -= costs.food;
224 }

expected behavior

  • gather resource counter never becomes negative
  • no change of the history by subtracting the used resources
  • no negative eco points

Attachments (3)

A21.png (191.0 KB ) - added by Langbart 15 months ago.
A22.png (156.8 KB ) - added by Langbart 15 months ago.
A23.png (160.0 KB ) - added by Langbart 15 months ago.

Download all attachments as: .zip

Change History (5)

by Langbart, 15 months ago

Attachment: A21.png added

by Langbart, 15 months ago

Attachment: A22.png added

by Langbart, 15 months ago

Attachment: A23.png added

comment:1 by Freagarach, 15 months ago

Owner: set to Freagarach
Patch: Phab:D4951

comment:2 by Freagarach, 15 months ago

Resolution: fixed
Status: newclosed

In 27562:

Don't subtract lifestock from used/gathered resources.

Also some cleaning in the statistics tracker.
(total is used by the lobby bots and hence not removed.)

References r20543 / rP20543 and #3948.
Differential revision: Don't subtract lifestock from used/gathered resources.
Tested by: @Langbart
Fixes #6744

Note: See TracTickets for help on using tickets.