bugFreeciv - Bugs: bug #20521, Government Upkeep_Factor help wrong

 
 
Show feedback again

bug #20521: Government Upkeep_Factor help wrong

Submitted by:  Jacob Nevins <jtn>
Submitted on:  Sun 17 Feb 2013 03:16:48 PM UTC  
 
Category: docsSeverity: 3 - Normal
Priority: 5 - NormalStatus: Fixed
Assigned to: Jacob Nevins <jtn>Open/Closed: Closed
Release: S2_4 r22361Operating System: None
Planned Release: 2.3.5,2.4.2,2.5.0,.6.0

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Mon 27 Jan 2014 01:16:32 AM UTC, SVN revision 24270:

Rework generation of government effects-driven help text, mainly to take
into account world bonuses and the resulting net effect value.
Fixes an issue where food Upkeep_Factor (for Settlers) was not reported
(Democracy/Republic in default/civ2 ruleset), or even reported incorrectly
(Communism/Fundamentalism in civ2 ruleset).

See gna bug #20521.

(Browse SVN revision 24270)

Jacob Nevins <jtn>
Project AdministratorIn charge of this item.
Mon 27 Jan 2014 01:15:20 AM UTC, SVN revision 24269:

Rework generation of government effects-driven help text, mainly to take
into account world bonuses and the resulting net effect value.
Fixes an issue where food Upkeep_Factor (for Settlers) was not reported
(Democracy/Republic in default/civ2 ruleset), or even reported incorrectly
(Communism/Fundamentalism in civ2 ruleset).

See gna bug #20521.

(Browse SVN revision 24269)

Jacob Nevins <jtn>
Project AdministratorIn charge of this item.
Mon 27 Jan 2014 01:09:39 AM UTC, SVN revision 24266:

Rework generation of government effects-driven help text, mainly to take
into account world bonuses and the resulting net effect value.
Fixes an issue where food Upkeep_Factor (for Settlers) was not reported
(Democracy/Republic in classic/civ2 ruleset), or even reported incorrectly
(Communism/Fundamentalism in civ2 ruleset).

See gna bug #20521.

(Browse SVN revision 24266)

Jacob Nevins <jtn>
Project AdministratorIn charge of this item.
Mon 27 Jan 2014 01:03:38 AM UTC, SVN revision 24263:

Rework generation of government effects-driven help text, mainly to take
into account world bonuses and the resulting net effect value.
Fixes an issue where food Upkeep_Factor (for Settlers) was not reported
(Democracy/Republic in classic/civ2 ruleset), or even reported incorrectly
(Communism/Fundamentalism in civ2 ruleset).

See gna bug #20521.

(Browse SVN revision 24263)

Jacob Nevins <jtn>
Project AdministratorIn charge of this item.
Mon 27 Jan 2014 12:49:58 AM UTC, comment #9:

> What kind of relation this ticket has to bug #17841?

I think this patch fixes that bug.

Jacob Nevins <jtn>
Project AdministratorIn charge of this item.
Mon 27 Jan 2014 12:17:05 AM UTC, comment #8:

What kind of relation this ticket has to bug #17841?

Marko Lindqvist <cazfi>
Project Administrator
Sat 25 Jan 2014 12:38:46 PM UTC, comment #7:

Patches for older branches, plus output diffs.

Testing ancients ruleset (on S2_5) threw up a couple more changes, but again I'm happy that the result is more accurate.

(file #19857, file #19858, file #19859)

Jacob Nevins <jtn>
Project AdministratorIn charge of this item.
Sat 25 Jan 2014 02:48:00 AM UTC, comment #6:

Commit candidate version (for trunk -- haven't checked if it applies to older branches yet).

> probably some of these should be split to separate patches

String changes split to patch #4450.

As a result, a version of this patch should apply to S2_3.

> I haven't investigated the following unexpected diffs

I have now and am happy with them.

(file #19846, file #19847)

Jacob Nevins <jtn>
Project AdministratorIn charge of this item.
Mon 20 Jan 2014 01:12:23 AM UTC, comment #5:

> Changing the civ2 food upkeep factors [...] to be the subject of
> new tickets.

Now bug #21519.

Jacob Nevins <jtn>
Project AdministratorIn charge of this item.
Sun 19 Jan 2014 03:57:43 PM UTC, comment #4:

Second WIP version -- quite different.

Notable changes from first version (probably some of these should be split to separate patches):

  • discard present=FALSE reqs
  • more asserts for things that should have been caught during ruleset loading
  • cope with effects with both output type and unit type reqs

silence output in more cases in the presence of extra requirements (otherwise could lie)

  • add PL_() i18n where it was missing
  • substantially rework veterans help:
    • remain silent if more than one (class, flag, type) req (longstanding FIXME)
    • add i18n disambiguation for class/flag/type output (longstanding FIXME)
    • in the case of a type req, output the specific veteran rank name
    • reword to make it clearer that it applies to newly built units

Also attached is the current difference it makes to government help with supplied rulesets + variant2. I haven't investigated the following unexpected diffs, but suspect they are more accurate rather than less:

  • civ2civ3 waste/corruption
  • alien max tax rates

(file #19791, file #19792)

Jacob Nevins <jtn>
Project AdministratorIn charge of this item.
Tue 14 Jan 2014 09:56:51 AM UTC, comment #3:

> Here's my first go

Er, here it is.

(file #19746)

Jacob Nevins <jtn>
Project AdministratorIn charge of this item.
Tue 14 Jan 2014 02:32:52 AM UTC, comment #2:

> A fix that would help here would be to explicitly look for and
> take account of completely unqualified effects like
> base_unit_upkeep here.

Here's my first go at reworking government help to take into account global effects (not just for Upkeep_Factor). It fixes at least the original reported problem.

(Might try to backport this to S2_3 if I can hack it in a way that doesn't break string freeze.)

> Noticed with civ2 ruleset, but will affect others.

civ2 is worst affected, as the help outright lies. In other rulesets like the default where Upkeep_Factor = 1(world)+1(gov), the gov help simply doesn't mention that settlers eat twice the food under Republic/Democracy.

Haven't spotted any other existing ruleset structures which trigger this class of issue; should diff gov help before/after with all rulesets.

> Did we make this up?

Changing the civ2 food upkeep factors (and/or adding more upkeep graphics) to be the subject of new tickets.

Jacob Nevins <jtn>
Project AdministratorIn charge of this item.
Mon 01 Apr 2013 11:13:02 PM UTC, comment #1:

> However, the help for [civ2] Settlers says:
> "Settlers in a Republic or Democracy require twice as much
> food per turn, and in Communist or Fundamentalist societies,
> three times as much."

I haven't checked the original game, but two references I've found (1, 2) don't mention it, and the first indicates that food upkeep is 1 for these govs.

Did we make this up?

  • The "three times as much" text came from me in patch #1390. I presume I was just updating docs to match the ruleset, so we can't take that as intention.
  • Going back, I think r11293 (when effects were added) bumped it from 2 to 3, and that this was probably inadvertent.
  • Going back further, upkeep=2 seems to have been deliberate; r4517 deliberately changed it for Communism, and r3761 implemented Fundamentalism in this state.

So I think we should at least reduce it to 2 (under a new ticket), and possibly back to 1 (depending on whether we can find out what commercial Civ2 did).

(I can see a possible game balance argument for having high settler upkeep, to balance the military advantages of these governments, but the civ2 ruleset isn't the place for such tweaks.)

> (Incidentally, if we are intentionally shipping rulesets with
> upkeep 3, it's not ideal that the upkeep icon can only go up
> to 2 -- I only noticed this by hovering over the unit icon to
> get the upkeep numbers.)

Patch #3824 will address this limitation.

Jacob Nevins <jtn>
Project AdministratorIn charge of this item.
Sun 17 Feb 2013 03:16:48 PM UTC, original submission:

Noticed with civ2 ruleset, but will affect others.

In the autogenerated help for civ2 Fundamentalism and Communism we have:

  • "You pay 2 times normal Food upkeep for your units."

No other government types mention this.

However, the help for Settlers says:
"Settlers in a Republic or Democracy require twice as much food per turn, and in Communist or Fundamentalist societies, three times as much."

And by experiment, this appears to be accurate.

(Incidentally, if we are intentionally shipping rulesets with upkeep 3, it's not ideal that the upkeep icon can only go up to 2 -- I only noticed this by hovering over the unit icon to get the upkeep numbers.)

Root cause is that the government help (helptext_government()) cherry-picks effects that apply to the current government, but doesn't consider effects that aren't government-specific. The effect structure in civ2/effects.ruleset looks like:

So "effect_base_unit_upkeep" is not taken into account. For many descriptions that sort of thing doesn't matter, but for Upkeep_Factor which is multiplicative it's very misleading.

This explains why no help text is seen for Republic/Democracy: the resultant factor is 1, which isn't seen as worth mentioning.

A fix that would help here would be to explicitly look for and take account of completely unqualified effects like base_unit_upkeep here.
That doesn't catch more complicated interactions, but most of those would hopefully be specific enough that it's reasonable to say "gov X pays 2x upkeep" and expect the player to know that in condition Y that's a base level that's modified. (In general, this generated help text will never cope with all these circumstances; the best we can hope for is to remain silent when things get complicated.)

(This is with S2_4; haven't checked other branches yet.)

Jacob Nevins <jtn>
Project AdministratorIn charge of this item.

 

(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #19860:  S2_5-gov-help-worldbonus-ter-output.diff added by jtn (62kB - text/x-diff - demonstrate help changes with a selection of supplied and extra rulesets)
file #19861:  S2_4-gov-help-worldbonus-ter-output.diff added by jtn (52kB - text/x-diff - demonstrate help changes with a selection of supplied and extra rulesets)
file #19862:  S2_3-gov-help-worldbonus-ter-output.diff added by jtn (50kB - text/x-diff - demonstrate help changes with a selection of supplied and extra rulesets)
file #19857:  S2_5-gov-help-worldbonus-ter.patch added by jtn (32kB - text/x-diff - S2_5/S2_4/S2_3 r24236)
file #19858:  S2_4-gov-help-worldbonus-ter.patch added by jtn (32kB - text/x-diff - S2_5/S2_4/S2_3 r24236)
file #19859:  S2_3-gov-help-worldbonus-ter.patch added by jtn (34kB - text/x-diff - S2_5/S2_4/S2_3 r24236)
file #19846:  trunk-gov-help-worldbonus-ter.patch added by jtn (32kB - text/x-diff - trunk r24225: split out string changes)
file #19847:  trunk-gov-help-worldbonus-ter-output.diff added by jtn (66kB - text/x-diff - trunk r24225: split out string changes)
file #19792:  trunk-gov-help-worldbonus-wip-bis-output.diff added by jtn (67kB - text/x-diff - trunk r24167 (work in progress))
file #19791:  trunk-gov-help-worldbonus-wip-bis.patch added by jtn (36kB - text/x-diff - trunk r24167 (work in progress))
file #19746:  trunk-gov-help-worldbonus-wip.patch added by jtn (16kB - text/x-diff - trunk r24127 (work in progress))

 

Depends on the following items: None found

Digest:
   patch dependencies.

 

Carbon-Copy List
  • -unavailable- added by cazfi (Posted a comment)
  • -unavailable- added by jtn (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 18 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 27 Jan 2014 01:19:06 AM UTCjtnStatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
    Sat 25 Jan 2014 12:39:42 PM UTCjtnAttached File-=>Added S2_5-gov-help-worldbonus-ter-output.diff, #19860
      Attached File-=>Added S2_4-gov-help-worldbonus-ter-output.diff, #19861
      Attached File-=>Added S2_3-gov-help-worldbonus-ter-output.diff, #19862
    Sat 25 Jan 2014 12:38:46 PM UTCjtnAttached File-=>Added S2_5-gov-help-worldbonus-ter.patch, #19857
      Attached File-=>Added S2_4-gov-help-worldbonus-ter.patch, #19858
      Attached File-=>Added S2_3-gov-help-worldbonus-ter.patch, #19859
    Sat 25 Jan 2014 02:48:00 AM UTCjtnAttached File-=>Added trunk-gov-help-worldbonus-ter.patch, #19846
      Attached File-=>Added trunk-gov-help-worldbonus-ter-output.diff, #19847
      StatusIn Progress=>Ready For Test
      Planned Release2.4.2,2.5.0,.6.0=>2.3.5,2.4.2,2.5.0,.6.0
    Sun 19 Jan 2014 03:57:43 PM UTCjtnAttached File-=>Added trunk-gov-help-worldbonus-wip-bis-output.diff, #19792
    Sun 19 Jan 2014 03:57:42 PM UTCjtnAttached File-=>Added trunk-gov-help-worldbonus-wip-bis.patch, #19791
    Tue 14 Jan 2014 09:56:51 AM UTCjtnAttached File-=>Added trunk-gov-help-worldbonus-wip.patch, #19746
    Tue 14 Jan 2014 02:32:52 AM UTCjtnStatusNone=>In Progress
      Assigned toNone=>jtn
      Planned Release=>2.4.2,2.5.0,.6.0
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup