设为首页收藏本站

塞爱维(CIV)文明联盟

 找回密码
 注册
查看: 7182|回复: 9

[原创] RFC(BTS317)科技研究花费的一些修正

[复制链接]
发表于 2008-7-30 13:01:54 | 显示全部楼层 |阅读模式
对于超过10城的大国,科技研发有惩罚,人类玩家每城多花费10%,AI多6%。

对于小于5城的小国且不是凯尔特文明,科技研发有奖励,由当前时代和城市数目决定奖励。
折扣率 = 100 - (5 - 城市数目) * 大于0的时代系数
时代系数从启蒙时代才大于0, 启蒙工业信息未来分别为3,6,9,12。

-------------------------------------------------------------

新诞生文明科技花费修正(同样,不包括凯尔特人)

如果当前回合数<文明诞生回合数+回合修正系数, 则折扣率为
[100-(文明诞生回合数+回合修正系数)+当前回合数]/100

回合修正系数 = 当前时代数 * 5

  1.         //Rhye - start penalty for large / giga empires
  2.         int iNumCities = GET_PLAYER((PlayerTypes)getID()).getNumCities();
  3.         int iMultiplier = 6;
  4.         if (GET_PLAYER((PlayerTypes)getID()).isHuman())
  5.                 iMultiplier = 10;
  6.         if (iNumCities > 10)
  7.         {
  8.                 iCost *= 100 + iMultiplier*(iNumCities-10);
  9.                 iCost /= 100;
  10.         }        
  11.         //Rhye - end
复制代码
  1. //Rhye - start
  2.         //discount for small empires
  3.         if (getID() < NUM_MAJOR_PLAYERS) {               
  4.                 if (iNumCities < 5)
  5.                 {
  6.                         iMultiplier = 3*(int)GET_PLAYER((PlayerTypes)getID()).getCurrentEra() - 6; //x-x-x-3-6-9-12
  7.                         if (iMultiplier > 0) {
  8.                                 iCost *= 100 - iMultiplier*(5-iNumCities); //52-64-76-88 if future;
  9.                                 iCost /= 100;
  10.                         }
  11.                 }        
  12.                 //discount for new born civs
  13.                 int iTurnModifier = 5*(int)GET_PLAYER((PlayerTypes)getID()).getCurrentEra(); //0-5-10-15-20-25-30
  14.                 if (GC.getGameINLINE().getGameTurn() <= startingTurn[getID()] + iTurnModifier) {
  15.                         
  16.                         iCost *= 100 - ((startingTurn[getID()] + iTurnModifier) - GC.getGameINLINE().getGameTurn());
  17.                         iCost /= 100;
  18.                 }
  19.         }
  20.         //Rhye - end
复制代码

[ 本帖最后由 Khyron 于 2008-7-31 14:37 编辑 ]
 楼主| 发表于 2008-7-30 13:05:07 | 显示全部楼层
任一科技的研发花费折扣

0. 修正系数为1000。
1. 判断活着的文明中是否发现了光纤,是则令修正系数为1,跳至第5步;否则至2。
2. 判断活着的文明中是否发现了电力,是则令修正系数为2,跳至第5步;否则至3。
3. 判断活着的文明中是否发现了天文,是则令修正系数为4。跳至第5步;否则至4。
4. 到了这里说明谁也没发现天文,如果这时当前回合数>380, 科研折扣率为75%。跳至6.
5. 当前还活着的文明数为A,令拥有此科技的文明数B, 此科技研发折扣率 = (A*修正系数-B)/(A*修正系数)
6. 完毕

原代码见5楼

注: 不知道是bug还是Rhye的本意,计算拥有此科技的文明的数量时没有进行存活判断。那么在一些特殊情况下就会有A*修正系数<B。

[ 本帖最后由 Khyron 于 2008-7-31 14:46 编辑 ]
 楼主| 发表于 2008-7-30 13:28:32 | 显示全部楼层
  1. //Rhye - start tech discount
  2.         int owners = 0;
  3.         int modifier = 1000;
  4.         bool bFiber = false;
  5.         bool bElectricity = false;
  6.         bool bAstronomy = false;

  7.         for (int iI = 0; iI < MAX_CIV_PLAYERS; iI++)
  8.         {
  9.                 if (GET_PLAYER((PlayerTypes)iI).isAlive())
  10.                 {
  11.                         if (GET_TEAM((TeamTypes)iI).isHasTech((TechTypes)FIBER_OPTICS))
  12.                         {
  13.                                 modifier = 1;
  14.                                 bFiber = true;
  15.                                 bElectricity = true;
  16.                                 bAstronomy = true;
  17.                                 break;
  18.                         }
  19.                 }
  20.         }
  21.         if (!bElectricity) {
  22.                 for (int iI = 0; iI < MAX_CIV_PLAYERS; iI++)
  23.                 {
  24.                         if (GET_PLAYER((PlayerTypes)iI).isAlive())
  25.                         {
  26.                                 if (GET_TEAM((TeamTypes)iI).isHasTech((TechTypes)ELECTRICITY))
  27.                                 {
  28.                                         modifier = 2;
  29.                                         bElectricity = true;
  30.                                         bAstronomy = true;
  31.                                         break;
  32.                                 }
  33.                         }
  34.                 }
  35.         }
  36.         if (!bAstronomy) {
  37.                 for (int iI = 0; iI < MAX_CIV_PLAYERS; iI++)
  38.                 {
  39.                         if (GET_PLAYER((PlayerTypes)iI).isAlive())
  40.                         {
  41.                                 if (GET_TEAM((TeamTypes)iI).isHasTech((TechTypes)ASTRONOMY))
  42.                                 {
  43.                                         modifier = 4;
  44.                                         bAstronomy = true;
  45.                                         break;
  46.                                 }
  47.                         }
  48.                 }
  49.         }

  50.         if (bAstronomy) {
  51.                 for (int iI = 0; iI < MAX_CIV_PLAYERS; iI++)
  52.                 {
  53.                         if (GET_TEAM((TeamTypes)iI).isHasTech(eTech))
  54.                         {
  55.                                 owners++;
  56.                         }
  57.                 }
  58.                 iCost *= ((GC.getGameINLINE().countCivPlayersAlive() * modifier) - owners);
  59.                 iCost /= (GC.getGameINLINE().countCivPlayersAlive() * modifier);
  60.         }
  61.         //Rhye - end

  62.         //Rhye - start
  63.         //discount for the late game
  64.         //if (GC.getTechInfo((TechTypes)iI).getEra() == 5)
  65.         /*if (GC.getGameINLINE().getGameTurn() > 430) { //2000
  66.                 iCost *= 3;
  67.                 iCost /= 4;
  68.         }*/
  69.         else if (GC.getGameINLINE().getGameTurn() > 380){ //1920
  70.                 iCost *= 3; //4
  71.                 iCost /= 4; //5
  72.         }

  73.         //Rhye - end
复制代码

[ 本帖最后由 Khyron 于 2008-7-31 14:47 编辑 ]
发表于 2008-7-30 15:38:46 | 显示全部楼层
lz ,快解释一下啊

VIKING 的初始值是多少?

那些常量 (如CHINA) 是小于VIKING 的?

不知道常量的值,代码看懂也没用啊。
 楼主| 发表于 2008-7-30 15:42:24 | 显示全部楼层
原帖由 bxf_square 于 2008-7-30 15:38 发表
lz ,快解释一下啊

VIKING 的初始值是多少?

那些常量 (如CHINA) 是小于VIKING 的?

不知道常量的值,代码看懂也没用啊。


研究中, 不过好像China研究花费率115/100是高于Viking的8/10。
 楼主| 发表于 2008-7-30 15:44:41 | 显示全部楼层
难度对科研花费的影响


不同文明享受不同的科研花费折扣

[ 本帖最后由 Khyron 于 2008-7-31 15:04 编辑 ]
 楼主| 发表于 2008-7-30 15:52:56 | 显示全部楼层
  1. //Rhye - start switch
  2. int CvHandicapInfo::getResearchPercentByID(PlayerTypes pl) const               
  3. {
  4.         int researchPercent = m_iResearchPercent;
  5.         int basePercent = 75; //72 in vanilla and Warlords
  6.         if (GC.getGameINLINE().getHandicapType() == 0) //viceroy
  7.                 basePercent = 61; //59 in vanilla and Warlords
  8.         else if (GC.getGameINLINE().getHandicapType() == 2) //emperor
  9.                 basePercent = 85; //82 in vanilla and Warlords
  10.         if (!GET_PLAYER((PlayerTypes)pl).isHuman()) {
  11.                 researchPercent *= basePercent;
  12.                 researchPercent /= 100;
  13.         }

  14.         if (!GET_PLAYER((PlayerTypes)EGYPT).isPlayable()) //late start condition
  15.                 if (pl < VIKING) {
  16.                         researchPercent *= 85;
  17.                         researchPercent /= 100;
  18.                 }
  19.         
  20.         switch (pl)
  21.         {
  22.         case EGYPT:
  23.                 return researchPercent*125/100;
  24.         case INDIA:
  25.                 return researchPercent*123/100;
  26.         case CHINA:
  27.                 return researchPercent*115/100;
  28.         case BABYLONIA:
  29.                 return researchPercent*113/100;
  30.         case GREECE:
  31.                 return researchPercent*102/100;
  32.         case PERSIA:
  33.                 return researchPercent*9/10;
  34.         case CARTHAGE:
  35.                 return researchPercent*9/10;
  36.         case ROME:
  37.                 return researchPercent*95/100;
  38.         case JAPAN:
  39.                 return researchPercent*95/100; //120 before embassies
  40.         case ETHIOPIA:
  41.                 return researchPercent*105/100;
  42.         case MAYA:
  43.                 //Rhye - start UP (Mayan)
  44.                 //return researchPercent*90/100;
  45.                 if (GET_PLAYER((PlayerTypes)pl).getCurrentEra() <= 2)
  46.                         return researchPercent*65/100;
  47.                 else
  48.                         return researchPercent*115/100;
  49.                 //Rhye - end UP               
  50.         case VIKING:
  51.                 return researchPercent*8/10;
  52.         case GERMANY:
  53.                 return researchPercent*68/100;
  54.         case FRANCE:
  55.                 return researchPercent*8/10;
  56.         case ARABIA:
  57.                 return researchPercent*105/100;
  58.         case KHMER:
  59.                 return researchPercent*100/100;
  60.         case SPAIN:
  61.                 return researchPercent*8/10;
  62.         case ENGLAND:
  63.                 return researchPercent*80/100;
  64.         case RUSSIA:
  65.                 return researchPercent*73/100;
  66.         case NETHERLANDS:
  67.                 return researchPercent*75/100;
  68.         case MALI:
  69.                 return researchPercent*140/100; //to counter their UP
  70.         case TURKEY:
  71.                 return researchPercent*75/100;
  72.         case PORTUGAL:
  73.                 return researchPercent*75/100;
  74.         case INCA:
  75.                 return researchPercent*79/100;
  76.         case MONGOLIA:
  77.                 return researchPercent*73/100;
  78.         case AZTEC:
  79.                 return researchPercent*87/100;
  80.         case AMERICA:
  81.                 return researchPercent*63/100;
  82.         case CELTIA:
  83.                 if (!GET_PLAYER((PlayerTypes)EGYPT).isPlayable()) //late start condition
  84.                         return researchPercent*340/100; //Byzantium
  85.                 else
  86.                         return researchPercent*100/100; //Celts
  87.         default:
  88.                 return researchPercent*110/100;
  89.                 break;
  90.         }
  91. }
  92. //Rhye - end
复制代码

[ 本帖最后由 Khyron 于 2008-7-31 14:53 编辑 ]
 楼主| 发表于 2008-7-30 16:16:56 | 显示全部楼层
科研花费要经以上提到的各因素叠乘。 这些修正是我到现在为止找到的RFC特别的地方。

[ 本帖最后由 Khyron 于 2008-7-31 14:52 编辑 ]
 楼主| 发表于 2008-7-30 23:09:58 | 显示全部楼层
这就是玛雅文明特长的来历吗?的确不怎么样,欧洲那些国家除了自己的特长外科技花费很多都在70%左右。

  1. case MAYA:
  2.                 //Rhye - start UP (Mayan)
  3.                 //return researchPercent*90/100;
  4.                 if (GET_PLAYER((PlayerTypes)pl).getCurrentEra() <= 2)
  5.                         return researchPercent*65/100;
  6.                 else
  7.                         return researchPercent*115/100;
  8.                 //Rhye - end UP
复制代码
发表于 2008-9-2 18:01:14 | 显示全部楼层
各个国家有不同 那太不公平了
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|塞爱维(CIV)文明联盟    

GMT+8, 2024-6-4 20:09

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表