Research & Lab Gains

PC/MAC : Commander the Great War is the latest release in the popular Commander series to bring the thrill, excitement and mind-breaking decision making of these difficult times to life.

Moderators: Slitherine Core, The Lordz

Post Reply
PrinceMiskin
Lance Corporal - SdKfz 222
Lance Corporal - SdKfz 222
Posts: 21
Joined: Fri Aug 03, 2007 6:05 pm

Research & Lab Gains

Post by PrinceMiskin » 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.

Code: Select all

 -- Total progress of tech this turn
  local totalIncrement = gameplay.researchSpeed + labIncrement
The game play speed is defined as:

Code: Select all

gameplay.researchSpeed = 10
The lab increment is more complicated and calculated as:

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
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:

Code: Select all

local labIncrement = ((labs-1)/3)/math.sqrt(1+math.pow((labs-1)/3,2))*3
Based on this, one can calculate the effects of adding more labs as:

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

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.

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
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.

Historion
Corporal - 5 cm Pak 38
Corporal - 5 cm Pak 38
Posts: 31
Joined: Wed Jul 30, 2014 10:41 pm

Re: Research & Lab Gains

Post by Historion » Sun Aug 17, 2014 6:12 pm

see viewtopic.php?f=218&t=51430 for additional information about research and some new code which allows to easily adjust Research-Speed and boost by additional labs via parameter.

At the moment two additional labs give you ca. 20% research bonus which is only affordable if you have enough unused pp-Income. If you consider rounding issues, additional labs mean that you gain new tech a few turns earlier, e.g. for a tech which costs 100 points the difference is 11 turns normal (1 lab) to 9 turns with 3 labs ... roughly.

Focussing a tech is only possible while there is at least another tech in that tech area to research. The additional research points for focus on one tech are taken from the research of the other techs in that tech area. It's a zero-sum mechanism so if you focus wisely you can speed up research in a tech area.

PrinceMiskin
Lance Corporal - SdKfz 222
Lance Corporal - SdKfz 222
Posts: 21
Joined: Fri Aug 03, 2007 6:05 pm

Re: Research & Lab Gains

Post by PrinceMiskin » Tue Aug 19, 2014 5:00 pm

Thanks you are so nice! This game needs a thorough revision!

I decided to take a break and play some Anno, till I revisit it.

Werk9
Lance Corporal - SdKfz 222
Lance Corporal - SdKfz 222
Posts: 22
Joined: Tue Feb 18, 2014 3:40 am

Re: Research & Lab Gains

Post by Werk9 » Sun Aug 31, 2014 10:48 pm

Thank you for all the information.

In my games if never invested in labours, it had never seemed to be useful. And for Austria I sold the marine labour and bought some more needed infantry.

Post Reply

Return to “Commander - The Great War”