Opened 9 years ago

Closed 9 years ago

#3328 closed defect (fixed)

[PATCH] Population limit is not rounded properly.

Reported by: maveric Owned by: mimo
Priority: Should Have Milestone: Alpha 19
Component: UI & Simulation Keywords: simple patch
Cc: Patch:

Description

http://i.imgur.com/AzBNQh9.jpg

Attachments (2)

t3328_round_population_v1.patch (1.3 KB ) - added by elexis 9 years ago.
Uses Math.floor to fix the number.
commands.txt (379.7 KB ) - added by maveric 9 years ago.

Download all attachments as: .zip

Change History (11)

by elexis, 9 years ago

Uses Math.floor to fix the number.

comment:1 by elexis, 9 years ago

Did you change that value with a custom mod or is there a bug in the main game somewhere?

comment:2 by elexis, 9 years ago

Keywords: patch review added
Summary: Population limit is not rounded properly.[PATCH] Population limit is not rounded properly.

comment:3 by elexis, 9 years ago

Milestone: BacklogAlpha 19

in reply to:  1 comment:4 by maveric, 9 years ago

Replying to elexis:

Did you change that value with a custom mod or is there a bug in the main game somewhere?

In the main game.

comment:5 by Itms, 9 years ago

Keywords: review removed

playerState.popLimit/popMax should be integer, so the rounding must happen in the simulation, not in the GUI.

Also it would be nice to know where this decimal limit comes from, maybe there is a bug somewhere that we don't want to hide by rounding. maveric, do you have steps to reproduce?

comment:6 by elexis, 9 years ago

Here the structures that gauls can build, affecting population:

structures/gaul_market.xml:    <PopulationBonus>12</PopulationBonus>
structures/gaul_farmstead.xml:		<PopulationBonus>2</PopulationBonus>
structures/gaul_rotarymill.xml:    <PopulationBonus>2</PopulationBonus>
structures/gaul_blacksmith.xml:    <PopulationBonus>4</PopulationBonus>
structures/gaul_fortress.xml:    <PopulationBonus>12</PopulationBonus>
structures/gaul_barracks.xml:    <PopulationBonus>4</PopulationBonus>
structures/gaul_tavern.xml:    <PopulationBonus>10</PopulationBonus>
structures/gaul_storehouse.xml:    <PopulationBonus>2</PopulationBonus>
structures/gaul_temple.xml:    <PopulationBonus>7</PopulationBonus>
structures/gaul_dock.xml:    <PopulationBonus>2</PopulationBonus>

Maybe it was caused by that house upgrade that gives 20% more population capacity. However I could not reproduce the issue.

If you don't know the exact steps, can you find the commands.txt file of that match and upload it? If so, please tell us the revision too (or if it was a18).

by maveric, 9 years ago

Attachment: commands.txt added

comment:7 by maveric, 9 years ago

I am not sure, but it could happen after capturing enemy buildings.

in reply to:  5 comment:8 by elexis, 9 years ago

The scenario map of that replay "The Massacre of Delphi" is interesting for multiple reasons.

The map starts with structures that you can't build with any unit. Gauls have the longhouse and athen has the hellenic special structure (stoa) which can produce champion skirmishers (which you can't produce otherwise).

Replying to Itms:

maybe there is a bug somewhere that we don't want to hide by rounding

The gaul player gets a celtic hut in the south. It gives only +2 pop, and if you use the +20% pop house upgrade, it will upgrade to 2,4 pop count.

Reproduce: (1) Start this map The Massacre of Delphi with cheats (2) Before you lose the hut in the south, type the cheats 2x "back to the future", "bring me my axe 9999" and "i am too busy" (3) Build a house and research the +20% pop tech

You will see that your pop count is now 52.4.

Another bug? If you delete buildings, all following numbers will be messed up - in the end you will even reach a negative number. -If you delete the house you just built, then it goes back to 46.6. -If you delete the longhouse, then the counter goes down to 34.4. -If you delete the CC, you get 14.39999 -If you delete the tavern, you get 2.39999 -Then the last remaining house in the south will become gaia, so that the counter reaches -1.33226715.

comment:9 by mimo, 9 years ago

Owner: set to mimo
Resolution: fixed
Status: newclosed

In 16848:

rounding needed for houses with popBonus%5 != 0, fixes #3328

Note: See TracTickets for help on using tickets.