Research & Lab Gains
Posted: Sun Aug 17, 2014 4:49 am
How research is conducted is defined in game_research.lua
It takes into account two major components, the gameplay speed and the labincrement.
The game play speed is defined as:
The lab increment is more complicated and calculated as:
As a side note, apparently focusing a technology is boosting the increment by 20%, while slowing down all the others by 20%. In other words boosting a specific technology slows down the overall progress, as long as there are more than two technologies.
Lab increment is calculated by the formula:
Based on this, one can calculate the effects of adding more labs as:
Meaning that the effect of adding more labs is insignificant and rapidly diminishing. The key point is to have 1 lab per category to receive the gameplay researchSpeed, which is 10. The second 0.95, the third 0.72, the forth 0.46, and the fifth 0.28.
If we also take into account that the lab cost is increasing, not only by each category, but all categories, investing in labs is probably a waste of resources. If we make a simplification and assume that there are no purchased labs in other research groups, one can also estimate the gain per PP cost per lab increase.
Overall, it seems that investing in labs is worthless. Perhaps an investment up to 1 or 2 labs early on may pay off. And if you ever consider buying a second lab, do never purchase it in the same research group.
In addition, we should restrain from extensive use of focus points, as it tends to slow down the overall research of the subgroup.
It takes into account two major components, the gameplay speed and the labincrement.
Code: Select all
-- Total progress of tech this turn
local totalIncrement = gameplay.researchSpeed + labIncrement
Code: Select all
gameplay.researchSpeed = 10
Code: Select all
function GetTechIncrement(faction, techName)
local techClass = data.newTechnologies[techName].class
-- Research speed bonus starts from 2 labs, 0 at 1 lab
local labs = faction.luaData.labs[techClass] - 1
-- Lab research speed bonus calculation
--FIXME: should not be "labs - 1" AGAIN here, but change requires resetting of all tech times
local labIncrement = ((labs-1)/3)/math.sqrt(1+math.pow((labs-1)/3,2))*3
-- Total progress of tech this turn
local totalIncrement = gameplay.researchSpeed + labIncrement
-- If there currently is a focused tech in this tech class
if faction.luaData.currentTech[techClass] ~= -1 then
-- If the current tech is the focused techn speed bonus
if faction.luaData.currentTech[techClass] == techName then
-- 20% increase
local boost = totalIncrement * 20 / 100
totalIncrement = totalIncrement + boost
-- If another tech is focused, speed is slowed down
else
local loss
-- This should never happen cos if there is only 1 tech left than there cant be another thats being focused
if GetCategoryTechlineCount(faction, techClass) == 1 then
loss = 0
else
loss = (totalIncrement * 20 / 100) / (GetCategoryTechlineCount(faction, techClass) - 1)
end
totalIncrement = totalIncrement - loss
end
end
return totalIncrement
end
Lab increment is calculated by the formula:
Code: Select all
local labIncrement = ((labs-1)/3)/math.sqrt(1+math.pow((labs-1)/3,2))*3
Code: Select all
Labs | Increment | Research | Gain
0 | N/A | 0 | N/A
1 | 0.00 | 10.00 | 10.00
2 | 0.95 | 10.95 | 0.95
3 | 1.66 | 11.66 | 0.72
4 | 2.12 | 12.12 | 0.46
5 | 2.40 | 12.40 | 0.28
6 | 2.57 | 12.57 | 0.17
7 | 2.68 | 12.68 | 0.11
8 | 2.76 | 12.76 | 0.07
9 | 2.81 | 12.81 | 0.05
10 | 2.85 | 12.85 | 0.04
If we also take into account that the lab cost is increasing, not only by each category, but all categories, investing in labs is probably a waste of resources. If we make a simplification and assume that there are no purchased labs in other research groups, one can also estimate the gain per PP cost per lab increase.
Code: Select all
Labs | Gain | PP Cost | Gains / PP Cost (%)
0 | N/A | 0 | 0
1 | 10.00 | 0 | Infinity
2 | 0.95 | 45 | 2.11
3 | 0.72 | 50 | 1.43
4 | 0.46 | 55 | 0.83
5 | 0.28 | 60 | 0.46
6 | 0.17 | 65 | 0.27
7 | 0.11 | 70 | 0.16
8 | 0.07 | 75 | 0.10
9 | 0.05 | 80 | 0.06
10 | 0.04 | 85 | 0.04
In addition, we should restrain from extensive use of focus points, as it tends to slow down the overall research of the subgroup.