Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2006:
[Freeciv-Dev] (PR#20368) bribing enemy units costs way too much
Home

[Freeciv-Dev] (PR#20368) bribing enemy units costs way too much

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#20368) bribing enemy units costs way too much
From: "MITA Yuusuke" <key@xxxxxxxxxxx>
Date: Sat, 2 Sep 2006 21:51:09 -0700
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=20368 >

Hi,


(I'm sending this report twice using different mail addresses.  Sorry in
advance if both arrived.)


I noticed that with SVN trunk (or 2.1) server, bribing an enemy unit always
costs too much I've never afforded to bribe one.

Please take Hungarians in attached savedata; a Hungarian diplomat is next to
an Uyghurian warrior, and the bribing cost is... 1828!  It can often exceeds
20000 in later stage of the game.


Diff of diplomats.c between 2.0.8 and 2.1.0 clearly showed the reason:

-  cost = unit_owner(punit)->economic.gold + 750;
+  cost = unit_owner(punit)->economic.gold * game.info.base_bribe_cost;

base_bribe_cost shouldn't be multiplier.


The patch below also contains another hunk which makes veteran units more
expensive to bribe -- veteran +33%, hardened +66%, elite +100%.  Please also
adopt it if you find it reasonable.


Also, though comments on unit_bribe_cost says:
> calculate how expensive it is to bribe the unit
> depends on distance to the capital, and government form
actually government form is not counted in at all (besides democracy
immunity).


-clefs




Index: server/diplomats.c
===================================================================
--- server/diplomats.c  (revision 12296)
+++ server/diplomats.c  (working copy)
@@ -1298,7 +1298,7 @@
   int dist;
   int default_hp = unit_type(punit)->hp;
 
-  cost = unit_owner(punit)->economic.gold * game.info.base_bribe_cost;
+  cost = unit_owner(punit)->economic.gold + game.info.base_bribe_cost;
   capital = find_palace(unit_owner(punit));
   if (capital) {
     int tmp = map_distance(capital->tile, punit->tile);
@@ -1319,6 +1319,8 @@
      cost = basecost/2 + basecost/2 * damage/hp
      
    */
+
+  cost += cost * punit->veteran / 3;
   
   cost = (int)((float)cost/(float)2 + ((float)punit->hp/(float)default_hp) * 
((float)cost/(float)2));
   


-clefs

Attachment: PR-bribe.save.gz
Description: application/gunzip


[Prev in Thread] Current Thread [Next in Thread]