Qs: Tech cost & Empire_Size_Base effect

Contribute, display and discuss rulesets and modpacks for use in Freeciv here.
User avatar
Corbeau
Elite
Posts: 1108
Joined: Mon Jan 13, 2014 11:13 pm

Qs: Tech cost & Empire_Size_Base effect

Postby Corbeau » Mon Mar 02, 2020 10:49 pm

I have two questions. One is a mystery, the other a technical one.

1.

The following tech cost style is activated in a ruleset:
; 1 - Cost of technology is:
; MAX((1+parents) * (researchcost/2) * sqrt(1+parents), researchcost)
; where num_parents == number of requirement for tech, counted
; recursively.

With base_tech_cost = 100 and sciencebox 100 I get the price of initial techs 424. So where is researchcost defined and how much is it? It smells like 424 or 4.24, but both are weird.

2.

Does Empire_Size_Base effect add up or substitute other such effects if there are more in action?
--
* Freeciv LongTurn, a community of one-turn-per-day players and developers, contains forum: http://longturn.net
* Longturn Discord server; real-time chatting, discussing, quarrelling, trolling, gaslighting...
* What Is Longturn?

Ignatus
Elite
Posts: 366
Joined: Mon Nov 06, 2017 12:05 pm
Location: St.Petersburg, Russia
Contact:

Re: Qs: Tech cost & Empire_Size_Base effect

Postby Ignatus » Tue Mar 03, 2020 12:40 pm

1.
Corbeau wrote:So where is researchcost defined and how much is it?
researchcost is just the name of sciencebox changed in 2005, and at style 1 it should just be the overall multiplier in percents (1 to 10000). The rest - :?: , maybe something with team pooled research and individual research bonuses is in effect?
2. Adds up as any other effect. Just remember it's empire-wide, can't be city-specific. It's interaction with Empire_Size_Step see in Happiness page on Fandom.

User avatar
Corbeau
Elite
Posts: 1108
Joined: Mon Jan 13, 2014 11:13 pm

Re: Qs: Tech cost & Empire_Size_Base effect

Postby Corbeau » Tue Mar 03, 2020 5:14 pm

Ignatus wrote:1.
Corbeau wrote:So where is researchcost defined and how much is it?
researchcost is just the name of sciencebox changed in 2005, and at style 1 it should just be the overall multiplier in percents (1 to 10000). The rest - :?: , maybe something with team pooled research and individual research bonuses is in effect?


It doesn't add up.

Let's see:

MAX((1+parents) * (researchcost/2) * sqrt(1+parents), researchcost)

researchcost = sciencebox = 100
parents = 0

So

MAX( ( 1+0 ) * (100/2) * sqrt(1+0) , 100) = MAX(50, 100), so it should be 100. But it's 424.

And you say "it should just be the overall multiplier in percents". But in this and other equations (style 0, for example), it looks like the base cost of techs, not percentage used to modify something.
--
* Freeciv LongTurn, a community of one-turn-per-day players and developers, contains forum: http://longturn.net
* Longturn Discord server; real-time chatting, discussing, quarrelling, trolling, gaslighting...
* What Is Longturn?

User avatar
Corbeau
Elite
Posts: 1108
Joined: Mon Jan 13, 2014 11:13 pm

Re: Qs: Tech cost & Empire_Size_Base effect

Postby Corbeau » Tue Mar 03, 2020 5:39 pm

Ok, I just did some research. It seems that if "parents" includes the tech currently being researched AND researchcost = 300, numbers are consistent with what you get in-game. So, where did this 300 come from?

I mean, this is madness! :D
--
* Freeciv LongTurn, a community of one-turn-per-day players and developers, contains forum: http://longturn.net
* Longturn Discord server; real-time chatting, discussing, quarrelling, trolling, gaslighting...
* What Is Longturn?

Akechi
Posts: 34
Joined: Thu Dec 07, 2017 12:17 pm

Re: Qs: Tech cost & Empire_Size_Base effect

Postby Akechi » Wed Mar 04, 2020 12:58 pm

Maybe the factor is Tech_Cost_Factor effects or Tech Leakage.

Technology cost from Freeciv 2.6 common/tech.c (with tech_cost_style = "Classic") and common/research.c:
base_tech_cost * (1 + number of requirements) * (1 + number of requirements)^0.5 / 2
* Tech_Cost_Factor (effects.ruleset)
* (number of player - number of tech leakage applicable player) / number of player
* science cost (250 for handicapped and novice AI, 100 for other difficulty AI and all non-AI player) / 100
* sciencebox / 100

If tech_cost_style = "Classic", base_tech_cost = 100, technology with no requirement (actually, one. "None".), tech_leakage = "Normal Players", 8 player, no one knows researching technology, non-AI player, sciencebox = 100, then...
100 * (1 + 1) * (1 + 1)^0.5 / 2 (= 141.42)
* Tech_Cost_Factor
* (8 - 0) / 8 (= no tech leakage modifier)
* 100 / 100 (= no AI modifier)
* 100 / 100 (= default sciencebox modifier)
= 141.42 * Tech_Cost_Factor

If final technology cost is 424, then Tech_Cost_Factor will be 424 / 141.42 = about 3.
What is your Tech_Cost_Factor?
If Tech_Cost_Factor is not 3 then check Tech Leakage setting.