[Freeciv-Dev] Re: (PR#7294) Reducing the bribe-power of Diplomats
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=7294 >
On 2004.01.23 08:11, Per I. Mathisen wrote:
> If bribe cost is still too low, let's increase it even more.
Current implementation of city_incite_cost() is something like:
bribe_cost = (1000 + something + improvements values)*size/(distance + 3);
It's good since it favours large cities with lots of buildings. But values of
buildings are in most cases insignificant. For example: granary. In city of
size 5, 5 tiles from capital it adds only 60*5/8=37.5 to the bribe cost.
I'm not sure how does it work in real world, but IMO in Freeciv rules
improvements should increase loyality of your people (fighting smallpox).
This patch adds customization to the ruleset. If you wan't to increase bribe
cost just raise [incite_cost] total_factor. You can also increase factor for
improvements in cities.
--
mateusz
diff -ur -Xdiff_ignore freeorig/common/game.h freeciv/common/game.h
--- freeorig/common/game.h 2004-01-12 09:52:50.000000000 +0100
+++ freeciv/common/game.h 2004-01-25 11:34:14.000000000 +0100
@@ -202,6 +202,12 @@
*/
int global_init_techs[MAX_NUM_TECH_LIST];
} rgame;
+
+ struct {
+ int improvement_factor;
+ int unit_factor;
+ int total_factor;
+ } incite_cost;
char demography[MAX_LEN_DEMOGRAPHY];
char allow_take[MAX_LEN_ALLOW_TAKE];
diff -ur -Xdiff_ignore freeorig/data/civ1/game.ruleset
freeciv/data/civ1/game.ruleset
--- freeorig/data/civ1/game.ruleset 2002-08-25 13:21:00.000000000 +0200
+++ freeciv/data/civ1/game.ruleset 2004-01-25 11:53:22.000000000 +0100
@@ -65,3 +65,14 @@
; 3 - Technology cost is reduced depending on the number of normal
; players (human and AI) which already know the tech.
tech_leakage = 0
+
+; city_incite_cost =
+; total_factor * (city_size) *
+; (base + (units_cost) * unit_factor +
+; (improvements_cost) * improvement_factor)
+; / (distance * 100)
+; See city_incite_cost() for more details
+[incite_cost]
+improvement_factor = 1
+unit_factor = 1
+total_factor = 100
diff -ur -Xdiff_ignore freeorig/data/civ2/game.ruleset
freeciv/data/civ2/game.ruleset
--- freeorig/data/civ2/game.ruleset 2002-08-25 13:21:00.000000000 +0200
+++ freeciv/data/civ2/game.ruleset 2004-01-25 11:53:09.000000000 +0100
@@ -65,3 +65,14 @@
; 3 - Technology cost is reduced depending on the number of normal
; players (human and AI) which already know the tech.
tech_leakage = 0
+
+; city_incite_cost =
+; total_factor * (city_size) *
+; (base + (units_cost) * unit_factor +
+; (improvements_cost) * improvement_factor)
+; / (distance * 100)
+; See city_incite_cost() for more details
+[incite_cost]
+improvement_factor = 1
+unit_factor = 1
+total_factor = 100
diff -ur -Xdiff_ignore freeorig/data/default/game.ruleset
freeciv/data/default/game.ruleset
--- freeorig/data/default/game.ruleset 2002-08-25 13:21:01.000000000 +0200
+++ freeciv/data/default/game.ruleset 2004-01-25 11:54:45.000000000 +0100
@@ -70,3 +70,14 @@
; 3 - Technology cost is reduced depending on the number of normal
; players (human and AI) which already know the tech.
tech_leakage = 0
+
+; city_incite_cost =
+; total_factor * (city_size) *
+; (base + (units_cost) * unit_factor +
+; (improvements_cost) * improvement_factor)
+; / (distance * 100)
+; See city_incite_cost() for more details
+[incite_cost]
+improvement_factor = 1
+unit_factor = 1
+total_factor = 100
diff -ur -Xdiff_ignore freeorig/data/history/game.ruleset
freeciv/data/history/game.ruleset
--- freeorig/data/history/game.ruleset 2002-08-12 22:03:12.000000000 +0200
+++ freeciv/data/history/game.ruleset 2004-01-25 11:53:50.000000000 +0100
@@ -70,3 +70,14 @@
; 3 - Technology cost is reduced depending on the number of normal
; players (human and AI) which already know the tech.
tech_leakage = 0
+
+; city_incite_cost =
+; total_factor * (city_size) *
+; (base + (units_cost) * unit_factor +
+; (improvements_cost) * improvement_factor)
+; / (distance * 100)
+; See city_incite_cost() for more details
+[incite_cost]
+improvement_factor = 1
+unit_factor = 1
+total_factor = 100
diff -ur -Xdiff_ignore freeorig/server/cityturn.c freeciv/server/cityturn.c
--- freeorig/server/cityturn.c 2004-01-25 08:56:05.000000000 +0100
+++ freeciv/server/cityturn.c 2004-01-25 11:34:32.000000000 +0100
@@ -1195,15 +1195,15 @@
cost = city_owner(pcity)->economic.gold + 1000;
unit_list_iterate(map_get_tile(pcity->x,pcity->y)->units, punit) {
- cost += unit_type(punit)->build_cost;
+ cost += unit_type(punit)->build_cost * game.incite_cost.unit_factor;
} unit_list_iterate_end;
/* Buildings */
built_impr_iterate(pcity, i) {
if (!is_wonder(i)) {
- cost += improvement_value(i);
+ cost += improvement_value(i) * game.incite_cost.improvement_factor;
} else {
- cost += improvement_value(i) * 2;
+ cost += improvement_value(i) * 2 * game.incite_cost.improvement_factor;
}
} built_impr_iterate_end;
@@ -1252,7 +1252,9 @@
- pcity->ppl_unhappy[4]
- pcity->ppl_angry[4] * 3);
cost *= size;
+ cost *= game.incite_cost.total_factor;
cost = cost / (dist + 3);
+ cost /= 100;
return cost;
}
diff -ur -Xdiff_ignore freeorig/server/ruleset.c freeciv/server/ruleset.c
--- freeorig/server/ruleset.c 2004-01-12 10:01:12.000000000 +0100
+++ freeciv/server/ruleset.c 2004-01-25 11:56:48.000000000 +0100
@@ -2474,7 +2474,7 @@
secfile_lookup_int_default(file, 9, "parameters.add_to_size_limit");
/* City Styles ... */
-
+
styles = secfile_get_secnames_prefix(file, "citystyle_", &nval);
/* Get rest: */
@@ -2613,7 +2613,15 @@
freelog(LOG_ERROR, "Switching to tech_leakage 0.");
game.rgame.tech_leakage = 0;
}
-
+
+ /* City incite cost */
+ game.incite_cost.improvement_factor =
+ secfile_lookup_int_default(&file, 1, "incite_cost.improvement_factor");
+ game.incite_cost.unit_factor =
+ secfile_lookup_int_default(&file, 1, "incite_cost.unit_factor");
+ game.incite_cost.total_factor =
+ secfile_lookup_int_default(&file, 100, "incite_cost.total_factor");
+
/*
* Load global initial techs
*/
- [Freeciv-Dev] Re: (PR#7294) Reducing the bribe-power of Diplomats, Per I. Mathisen, 2004/01/23
- [Freeciv-Dev] Re: (PR#7294) Reducing the bribe-power of Diplomats, ue80@xxxxxxxxxxxxxxxxxxxxx, 2004/01/23
- [Freeciv-Dev] Re: (PR#7294) Reducing the bribe-power of Diplomats, Genevieve Gracian, 2004/01/23
- [Freeciv-Dev] Re: (PR#7294) Reducing the bribe-power of Diplomats, Per I. Mathisen, 2004/01/23
- [Freeciv-Dev] Re: (PR#7294) Reducing the bribe-power of Diplomats, ue80@xxxxxxxxxxxxxxxxxxxxx, 2004/01/23
- [Freeciv-Dev] Re: (PR#7294) Reducing the bribe-power of Diplomats, Genevieve Gracian, 2004/01/23
- [Freeciv-Dev] Re: (PR#7294) Reducing the bribe-power of Diplomats, Gregory Berkolaiko, 2004/01/23
- [Freeciv-Dev] Re: (PR#7294) Reducing the bribe-power of Diplomats, Raimar Falke, 2004/01/26
- [Freeciv-Dev] Re: (PR#7294) Reducing the bribe-power of Diplomats,
mateusz stefek <=
|
|