bugFreeciv - Bugs: bug #19253, unit_bribe_cost veteran...

 
 
Show feedback again

bug #19253: unit_bribe_cost veteran contribution looks wrong

Submitted by:  Michal Mazurek <akfaew>
Submitted on:  Sat 07 Jan 2012 07:13:20 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalStatus: Fixed
Assigned to: Jacob Nevins <jtn>Open/Closed: Closed
Release: S2.3Operating System: None
Planned Release: 2.4.0,2.5.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)

Sat 14 Jul 2012 11:03:04 AM UTC, SVN revision 21546:

Make unit bribe cost depend on veteran power_fact / move_bonus rather
than a fixed factor based on numeric veteran level.

Reported by Michal Mazurek (akfaew@gna).

See gna bug #19253.

(Browse SVN revision 21546)

Jacob Nevins <jtn>
Project AdministratorIn charge of this item.
Sat 14 Jul 2012 11:02:26 AM UTC, SVN revision 21544:

Make unit bribe cost depend on veteran power_fact / move_bonus rather
than a fixed factor based on numeric veteran level.

Reported by Michal Mazurek (akfaew@gna).

See gna bug #19253.

(Browse SVN revision 21544)

Jacob Nevins <jtn>
Project AdministratorIn charge of this item.
Thu 12 Jul 2012 10:57:00 PM UTC, comment #5:

How about this patch? It has the "simple power_fact based" behaviour, and also takes into account move_bonus, as a fraction of the unit's base move rate (with a special case if that is zero). So a veteran unit with a base move rate of 3 and a move_bonus of 1 costs ~1.33x what the non-veteran unit would.

Will commit soon for 2.4.0 if no-one objects.

(file #16070)

Jacob Nevins <jtn>
Project AdministratorIn charge of this item.
Sun 24 Jun 2012 07:58:37 PM UTC, comment #4:

> this code apparently came in in r12297, RT #20368, in Sep 2006
> (possibly as an afterthought). I dunno when multiple veteran
> levels came in


data/default/units.ruleset already has multiple veteran levels defined in r12297:
http://svn.gna.org/viewcvs/freeciv/trunk/data/default/units.ruleset?revision=12255&view=markup&pathrev=12297

...and it seems to be first introduced in r7194, Jan 11 2004:
http://svn.gna.org/viewcvs/freeciv?view=revision&revision=7194

Marko Lindqvist <cazfi>
Project Administrator
Sun 24 Jun 2012 07:32:54 PM UTC, comment #3:

> Without investigating version history more, I'm not sure if
> this has been written with multiple veteran levels in mind at
> all.

Using the power of "git log -S" I find this code apparently came in in r12297, RT #20368, in Sep 2006 (possibly as an afterthought). I dunno when multiple veteran levels came in. With RT still down I can't easily check the history further.

Some examples. ("tenlevels" is a hypothetical ruleset with ten veteran levels with nonlinear power_fact=100,120,...,250.)

For the last, we could arbitrarily scale power_fact to give the same cost for veterans, but the costs for hardened/elite in classic/default ruleset would end up wrong.

I don't think there's a simple answer that gives exactly the same results as before on existing rulesets. So, I'm leaning toward fixing this on S2_4 and living with the current S2_3 behaviour, so as not to disrupt running games by changing bribe costs.

I'm leaning toward a formula involving semi-arbitrary valuations of power_fact and move_bonus. Any opinion on the values of the factors, or shall I just make them up?

Jacob Nevins <jtn>
Project AdministratorIn charge of this item.
Wed 23 May 2012 11:41:38 PM UTC, comment #2:

> ./diplomats.c:1449: cost += cost * punit->veteran / 3; /* Extra cost for veterans */


Without investigating version history more, I'm not sure if this has been written with multiple veteran levels in mind at all. It might come from times when veterancy was just boolean thing (meaning that veterans had 1.33x cost compared to green ones)

Which leads to discovery that actually patch is worse than current code. Just because classic ruleset has veterancy levels beyond veteran should not make veterans less valuable than in civ/2 (or rather, as the change to current behavior would be: cost for veterans should not be so high in civ/2 (old code: 1.33x, new code 2x))

Marko Lindqvist <cazfi>
Project Administrator
Wed 25 Jan 2012 12:29:31 AM UTC, comment #1:

Hm. The current code is clearly wrong (or at least arbitrary), but it's not obvious that uniformly scaling cost by veteran level between 1.0x and 2.0x is the right answer (clearly it's a better answer).

Perhaps the bribe cost should take into account the veteran level's power_fact and move_bonus, so that (say) a unit that's 3x as powerful as the base level costs 3x as much (or some less steep function)?

Jacob Nevins <jtn>
Project AdministratorIn charge of this item.
Sat 07 Jan 2012 07:13:20 AM UTC, original submission:

./diplomats.c:1449: cost += cost * punit->veteran / 3; /* Extra cost for veterans */

Of course, the 3 should be the maximum level number. diff attached

Michal Mazurek <akfaew>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #16070:  trunk-S2_4-veteran-bribe-costs.patch added by jtn (2kB - text/x-diff - trunk/S2_4 r21520: bribe cost is a function of power_fact and move_bonus)
file #14771:  a added by akfaew (473B - application/octet-stream)

 

Digest:
   bug dependencies.

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by cazfi (Posted a comment)
  • -unavailable- added by jtn (Posted a comment)
  • -unavailable- added by akfaew (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 10 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 14 Jul 2012 11:04:01 AM UTCjtnStatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
    Thu 12 Jul 2012 10:57:00 PM UTCjtnAttached File-=>Added trunk-S2_4-veteran-bribe-costs.patch, #16070
      StatusIn Progress=>Ready For Test
    Thu 12 Jul 2012 10:31:53 PM UTCjtnDependencies-=>Depends on bugs #19931
    Thu 12 Jul 2012 09:50:11 PM UTCjtnStatusNone=>In Progress
      Assigned toNone=>jtn
    Tue 10 Jul 2012 10:28:45 PM UTCjtnPlanned Release=>2.4.0,2.5.0
    Sun 24 Jun 2012 07:32:54 PM UTCjtnSummaryBug in unit_bribe_cost=>unit_bribe_cost veteran contribution looks wrong
    Sat 07 Jan 2012 07:13:20 AM UTCakfaewAttached File-=>Added a, #14771
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup