Page 1 of 1

adjustable technology leak rate

Posted: Tue Jul 10, 2018 6:39 am
by fomalhaut
I like technology leak but sometimes feel that it's too strong.
So I hope to be able to adjust the rate of it in game.ruleset.

Re: adjustable technology leak rate

Posted: Fri Jul 13, 2018 8:52 pm
by vodot
There is no option for this in 2.6 aside from setting Tech Leak to "Embassies" (The weakest of the three tech leak settings).

If you want to get nuts (LET'S GET NUTS!) then you can find the math itself in 'research.c' in the /common folder. I've copied it below:

Code: Select all

  case TECH_LEAKAGE_EMBASSIES:
    {
      int players = 0, players_with_tech_and_embassy = 0;

      players_iterate_alive(aplayer) {
        const struct research *aresearch = research_get(aplayer);

        players++;
        if (aresearch == presearch
            || (A_FUTURE == tech
                ? aresearch->future_tech <= presearch->future_tech
                : TECH_KNOWN != research_invention_state(aresearch, tech))) {
          continue;
        }

        research_players_iterate(presearch, pplayer) {
          if (player_has_embassy(pplayer, aplayer)) {
            players_with_tech_and_embassy++;
            break;
          }
        } research_players_iterate_end;
      } players_iterate_alive_end;

      fc_assert_ret_val(0 < players, base_cost);
      fc_assert(players >= players_with_tech_and_embassy);
      base_cost *= (double) (players - players_with_tech_and_embassy);
      base_cost /= (double) players;
    }
    break;
To weaken the effect, just tweak the ratio at the end (the 'base_cost *=' bit). Note that by default, the game is reducing the cost by a straight percentage equal to the the ratio of (know_tech+have_embassy)/(all players)— e.g. if 4/10 players know the tech (and you have embassies with 3 of them), the cost of the tech will be reduced by 30%.

Put a 0.5* in there to (globally & permanently, in your copy of the game) cut the effect in half, for example. That would make the reduction only 15%, in the above example.

Re: adjustable technology leak rate

Posted: Sat Jul 14, 2018 9:56 am
by JTN
Raised hrm #764944.