Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2004:
[Freeciv-Dev] Re: (PR#9147) researchcost proposal
Home

[Freeciv-Dev] Re: (PR#9147) researchcost proposal

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] Re: (PR#9147) researchcost proposal
From: "Per Inge Mathisen" <per@xxxxxxxxxxx>
Date: Sat, 3 Jul 2004 06:54:14 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=9147 >

This is the patch to implement this researchcost proposal. Please test and
report your findings.

I will make a separate patch to make researchcost doubling by 1AD
optional (defaulting to off). Keep this in mind when testing and the year
ticker exceeds the magic year.

  - Per

Index: common/tech.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/tech.c,v
retrieving revision 1.71
diff -u -r1.71 tech.c
--- common/tech.c       25 Jun 2004 23:43:01 -0000      1.71
+++ common/tech.c       3 Jul 2004 13:46:33 -0000
@@ -18,6 +18,7 @@
 #include <assert.h>
 #include <stdlib.h>            /* exit */
 #include <string.h>
+#include <math.h>
 
 #include "fcintl.h"
 #include "game.h"
@@ -348,8 +349,9 @@
  tech_cost_style:
  0 - Civ (I|II) style. Every new tech add game.researchcost to the
      cost of the next tech.
- 1 - Cost of technology is (1+num_parents)*researchcost, where
-     num_parents == number of requirement for tech, counted recursively.
+ 1 - Cost of technology is 
+       (1 + num_parents) * researchcost * sqrt(1 + num_parents)
+     where num_parents == number of requirement for tech, counted recursively.
  2 - Cost are read from tech.ruleset. Missing costs are generated by
      style 1.
 
@@ -386,7 +388,8 @@
     cost = pplayer->research.techs_researched * game.researchcost;
     break;
   case 1:
-    cost = advances[tech].num_reqs * game.researchcost;
+    cost = advances[tech].num_reqs * sqrt(advances[tech].num_reqs) 
+           * game.researchcost;
     break;
   case 2:
     cost = (advances[tech].preset_cost * game.researchcost) /
Index: data/default/game.ruleset
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/default/game.ruleset,v
retrieving revision 1.16
diff -u -r1.16 game.ruleset
--- data/default/game.ruleset   19 Apr 2004 12:17:15 -0000      1.16
+++ data/default/game.ruleset   3 Jul 2004 13:50:45 -0000
@@ -53,16 +53,14 @@
 
 ; Method of calculating technology costs
 ;   0 - Civ (I|II) style. Every new tech add researchcost to cost of next tech.
-;   1 - Cost of technology is (1+num_parents)*researchcost, where
-;       num_parents == number of requirement for tech, counted recursively.
+;   1 - Cost of technology is (1+num_parents)*sqrt(1+num_parents)*researchcost,
+;       where num_parents == number of requirement for tech, counted 
+;       recursively.
 ;   2 - Cost are read from tech.ruleset. Missing costs are generated by
 ;       style 1.
-; Note that style 1 will make techs overall cheaper. With researchcost
-; set to 10 and using 1.12.0 default rules, style 0 requires 38280 bulbs
-; while style 1 requires only 21120. If you set researchcost to 20, then
-; total bulb cost for style 1 increases to 42240, which is more in line
-; with previous tech progression.
-tech_cost_style = 0
+; Researching all techs in 1.14.1 with style 0 before 1AD costs 40040 bulbs.
+; With style 1 and researchcost 5 the same costs 66001 bulbs.
+tech_cost_style = 1
 
 ; Technology leak from other civilizations
 ; 0 - No reduction of the technology cost.

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