Bug #1267
openciv2civ3 ruleset - help for units is misleading
0%
Description
In the help for Government -> Federation it says -
"Each city can support up to 2 units for free; further units each cost 2 gold per turn."
but effects.ruleset has -
[effect_upkeep_free_units_federation]
type = "Unit_Upkeep_Free_Per_City"
value = 4
reqs =
{ "type", "name", "range", "quiet"
"Gov", "Federation", "Player", TRUE
"OutputType", "Gold", "Local", FALSE
}
Same problem for Fundamentalism.
Easy to fix, but which one is correct?
Files
Updated by Marko Lindqvist 7 months ago
Not sure, but this might be correct as it is. Each unit has upkeep of 2, so (free) upkeep of 2 units is 2x2=4 gold.
README.civ2civ3 likely has more to say about this.
Updated by Dean Brown 7 months ago
- File patch1267.diff added
Did a deep dive into this and you are correct, the Upkeep_Factor is sometimes 2. Hard to understand the Upkeep_Factor reqs the way they are written.
But I did find a problem with the help displayed for units - most of them say
"Basic upkeep: 1 Food, 1 Shield, 1 Gold"
which is wrong, or at least very misleading. The actual upkeep is, depending on government, either "1 Shield", "1 Gold", or "2 Gold". I made an improvement by using the Shield2Gold_Factor effect, and, in units.ruleset, the ShieldToGold unit flag plus appropriate changes. With these changes the unit help says "1 Food, 1 Shield" and there's an auto generated help text saying "The 1 shield unit upkeep becomes 1 gold under Despotism and Monarchy, and 2 gold under Fundamentalism, Federation and Democracy.". Unfortunately you can't attach a "helptxt" to a predefined unit flag so I had to make a pseudo duplicate unit flag "ShieldToGold". And that new helptxt string would need translations.
Also wish I could edit the bug title.
Patch for 3.1
Updated by Dean Brown 3 months ago
- Subject changed from civ2civ3 ruleset - mismatch between gov help and effect Unit_Upkeep_Free_Per_City to civ2civ3 ruleset - help for units is misleading
Edited the bug subject, renamed patch file.
Updated by Dean Brown 3 months ago
- File 1267_Main.patch added
- File 1267_S3_3.patch added
- File 1267.patch added
better 1267.patch file, and added patches for other branches.
Updated by Marko Lindqvist 3 months ago
This would be an improvement to the help display, yes, but a lot of testing needs to be done to see how badly it hurts the AI.
Updated by Marko Lindqvist about 2 months ago
Marko Lindqvist wrote in #note-8:
... but a lot of testing needs to be done to see how badly it hurts the AI.
Which is not happening yet, but only when I'm back to full steam at freeciv development. I begun my summer break much later than I should have, so am also going to end it late.
Updated by Marko Lindqvist 9 days ago
Currently these patches change civ2civ3 ruleset only. In most cases when civ2civ3 ruleset is changed, similar change is needed for sandbox ruleset too. Isn't it the case here, or is it missing?
Updated by Marko Lindqvist 9 days ago
Marko Lindqvist wrote in #note-8:
... but a lot of testing needs to be done to see how badly it hurts the AI.
Turns out it doesn't even change the autogame with my regression test game, so there's no need for painful AI performance comparison testing.
Updated by Dean Brown 9 days ago
- File 1267.patch 1267.patch added
Yes sandbox should also get changed. Replaced patch for S3_1 & S3_2. I still need to update patches for S3_3 and Main.
Re. AI testing - occurred to me, does the AI know about the Shield2Gold_Factor effect type? If not, then an improvement is possible. I assume AI already knows about unit upkeeps uk_shield, uk_gold, etc.
Updated by Dean Brown 6 days ago
- File 1267_Main.patch 1267_Main.patch added
- File 1267_S3_3.patch 1267_S3_3.patch added
S3_3 and Main are different because of the change from Shield2Gold_Factor to Shield2Gold_Pct, and flag ShieldToGold changed to a user unit type flag.
Updated by Marko Lindqvist 6 days ago
S3_3 & Main: There's only one 100% Shield2Gold_Pct effect, though some government types are supposed to have 200%.
Updated by Dean Brown 4 days ago
My testing shows what I think are the correct results, at least it matches what the S3_2 version does. The Shield2Gold_Pct effect must be multiplied by the cumulative "Upkeep_Factor" effects. When I tried adding a second 100% Shield2Gold_Pct effect for, e.g. Democracy or Federation, I saw 4 gold/unit result.
Updated by Marko Lindqvist 4 days ago
Ok, so the Upkeep_Factor is defined differently between branches? I just saw in these patches that S3_2 patch introduces two effects while the S3_3/main introduce only one.
Updated by Dean Brown 4 days ago
Upkeep_Factor is the same in all branches, and my patches don't change it. It looks to me like the interaction between Shield2Gold_Pct and Upkeep_Factor is different in newer branches than the interaction between Shield2Gold_Factor and Upkeep_Factor in 3_2.
Updated by Marko Lindqvist 4 days ago
Sounds like we've unearthed a bug somewhere.
Updated by Marko Lindqvist 4 days ago
S3_2 README.effects:
Shield2Gold_Factor
Factor in percent for the conversion of unit shield upkeep to gold upkeep.
A value of 200 would transfer 1 shield upkeep to 2 gold upkeep. The range
of this effect must be player or world. Note that only units with the
"Shield2Gold" flag will be affected by this.
So it's percentage even in S3_2 (despite the name). Your patch sets values to just 1 or 2.
Updated by Dean Brown 4 days ago
- File 33test.sav.xz 33test.sav.xz added
Yes could be a bug if the intent was to make Shield2Gold_Pct work the same as Shield2Gold_Factor, which I would expect. If that gets changed then my patch would need to change also.
In case it's useful - here's the 3_3 savegame file I'm using for testing.