• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

Pang Bingxun

Field Marshal
2 Badges
Nov 22, 2011
5.596
185
  • Arsenal of Democracy
  • 500k Club
Due to the historical date modifier any gained technological superiority will decay over time.

Let's assume that in a scenerio A you research 10 1937 techs in 1936, 10 1938 techs in 1937, 10 1939 techs in 1938, 10 1940 techs in 1939, 10 1941 techs in 1940 and 10 1942 techs in 1941.

For the sake of simplicity the techs will each take exactly 360 days. As each component will take an integer number of days to complete that includes an average 0.5 days of rounding per compoment and an average of 2.5 days of rounding per tech. Prior to rounding it takes only 357.5 days to really research the techs while an average historical date modifier of 0.8195 applies for the full 360 days. Prior to rounding and historical date modifier it takes 0.8195 x (360-2.5) days = 292.97125 days to research the tech.

Now move on to a scenario B where research holds for the first 360 days. The research of the 1937 techs starts in 1937. The historical date modifier starts at 1 and increases by 0.001 each day. Including 2.5 days of rounding it will take 261.652 days to research which only for purposes of historical date modifier i will further round to 262 days. The historical date modifier for the 1938 techs will therefore start at 0.902.

In including 2.5 days of rounding it will take 261.652 days to research the 1937 techs ending at day 261.652.
In including 2.5 days of rounding it will take 283.393 days to research the 1938 techs ending at day 545.045.
In including 2.5 days of rounding it will take 302.675 days to research the 1939 techs ending at day 847.720.
In including 2.5 days of rounding it will take 315.671 days to research the 1940 techs ending at day 1163.391.
In including 2.5 days of rounding it will take 332.237 days to research the 1941 techs ending at day 1495.628.
In including 2.5 days of rounding it will take 340.804 days to research the 1942 techs ending at day 1836.432.

If those figures are accurate despite the rounding issues, than A gains an advantage of 10 1937 techs that lasts for 262 days. The advantage for the 10 1938 techs will last 185 days, 29.39% less than the prior year. The advantage for the 10 1939 techs will last 128 days, 30.81% less than the prior year. The advantage for the 10 1940 techs will last 83 days, 35.16% less than the prior year. The advantage for the 10 1941 techs will last 56 days, 32.53% less than the prior year. The advantage for the 10 1942 techs will last 36 days, 35.71% less than the prior year. The decay from 262 days for 1937 techs to 36 for 1942 techs is 86.26%.

It might be eye-catching that while the absolute rate of decay does decrease the relative rate of decay is increasing. That is because over the years the historical date modifier for scenario B gets worse over the years. At bad historical date modifiers starting a few days later makes a much bigger difference.
 
Last edited:

MagooNZ

Captain
4 Badges
May 17, 2012
467
24
  • Arsenal of Democracy
  • Hearts of Iron II: Armageddon
  • 500k Club
  • Hearts of Iron IV: Cadet
Pang, so for Scenario A, each 1 year research in advance always completes at the end of the year? eg ten 1938 techs complete their research on 30 Dec 1937?

Scenario B starts researching the ten 1937 techs 1 Jan 37. When it completes, it starts the next ten 1938 techs immediately, and this will occur before the end of 1937. Ok, so the completion dates are Sep 22, 1937; then July 6, 1938; etc. So completion is always a bit earlier in the year because researching the 1942 techs still takes <360 days. And it will never reach 360 days because it would then have caught up to Scenario A, which is impossible given its later start date.
 

Zsar1

Major
52 Badges
Dec 19, 2014
659
199
  • Arsenal of Democracy
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Darkest Hour
  • Crusader Kings II: Jade Dragon
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Crusader Kings II: Reapers Due
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Hearts of Iron IV: Together for Victory
  • Crusader Kings II: Monks and Mystics
  • Hearts of Iron IV: Death or Dishonor
  • Age of Wonders III
  • Stellaris: Galaxy Edition
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Shadowrun Returns
  • Crusader Kings II: Holy Fury
  • Battle for Bosporus
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Hearts of Iron IV: La Resistance
  • Stellaris: Federations
  • Stellaris
  • Europa Universalis IV
  • Victoria 2
  • Europa Universalis III: Collection
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Crusader Kings II: Way of Life
  • Stellaris Sign-up
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Stellaris: Megacorp
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Europa Universalis III
  • Divine Wind
  • Heir to the Throne
  • Stellaris: Synthetic Dawn
  • King Arthur II
  • Stellaris - Path to Destruction bundle
Mmh, at first I was not sure, what exactly you are showing here, but after mulling it over for a bit:
The duration of advantages is not really supposed to shrink as time progresses, is it?
 

Pang Bingxun

Field Marshal
2 Badges
Nov 22, 2011
5.596
185
  • Arsenal of Democracy
  • 500k Club
Pang, so for Scenario A, each 1 year research in advance always completes at the end of the year?

They start at the first day of the year and take 360 days.

eg ten 1938 techs complete their research on 30 Dec 1937?

Well, then it is still shown to take one day. It finishes from 1937/12/30 to 1938/1/1. As i recall it the new tech does not apply for 1937/12/30, but it does for 1938/1/1. So it seems proper to say that it finishes with the starting of the new year. Also i do assume that for the research from 1937/12/30 to 1938/1/1 the historical date modifier of 1937/12/30 applies etc..

Ok, so the completion dates are Sep 22, 1937;

Subject to rounding September the 23rd seems more likely.

And it will never reach 360 days because it would then have caught up to Scenario A, which is impossible given its later start date.

Subject to rounding that might not be entirely impossible. If we let the 36 days advantage in 1942 decay by further 35% per tech for 7 years into 1949, than it is only 1.76 days, less than average 2.5 days of rounding per tech. By principle any exponential decay does never decrease to zero, but distinguishing it from zero might be come difficult, especially with rounding applying.

The duration of advantages is not really supposed to shrink as time progresses, is it?

I argue it is. If not explicitly than obviously by implication.

Still there are incentives to be up to date within playing one nation. Having a new model 9 months before the competion gives an important advantage. And if comparing nations of different research abilties, say germany and soviet union, than the duration of advantages may be maintained simply because better tech teams and worse historical date modifier will cancel each other out. What i did was only comparing what happens within a given nation.
 

PouetVL

Second Lieutenant
37 Badges
Aug 10, 2009
156
33
  • Crusader Kings II
  • Arsenal of Democracy
  • Semper Fi
  • Victoria: Revolutions
  • Europa Universalis IV: Res Publica
  • Heir to the Throne
  • Hearts of Iron III
  • For the Motherland
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Art of War
  • Europa Universalis IV
  • Divine Wind
  • Europa Universalis III: Chronicles
  • Europa Universalis III
  • Darkest Hour
  • Europa Universalis IV: Conquest of Paradise
  • BATTLETECH
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV: Cradle of Civilization
  • Hearts of Iron IV: Expansion Pass
  • BATTLETECH: Flashpoint
  • Europa Universalis IV: Golden Century
  • Hearts of Iron IV: Expansion Pass
  • BATTLETECH: Season pass
  • BATTLETECH: Heavy Metal
  • Hearts of Iron IV: La Resistance
  • Europa Universalis IV: Mandate of Heaven
  • Hearts of Iron IV: Together for Victory
  • Europa Universalis IV: Rights of Man
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV Sign-up
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV: El Dorado
  • 500k Club
  • Victoria 2
  • Europa Universalis IV: Third Rome
Nice math for mid/smaller countries, Of course good tech teams vs bad one can further increase the Gap... and AI/Computer researching tech in a bad sequence can further increase the gap. (Computer sometimes research tech like a retarded 4 years old) aka Adv Machine tools + adv construction need both to be researched for Prod control and Planning, improved light thank for basic medium tank etc... some countries devote wrong tech team for a tech that cripple them 100-200 days later on the tech they really should have researched. English often use english electric company for Air research, which often leads in a delayed ADV contrustion so delay all their assembly line research for a while... and England have like 6 Very good air tech teams...
 

Zsar1

Major
52 Badges
Dec 19, 2014
659
199
  • Arsenal of Democracy
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Darkest Hour
  • Crusader Kings II: Jade Dragon
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Crusader Kings II: Reapers Due
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Hearts of Iron IV: Together for Victory
  • Crusader Kings II: Monks and Mystics
  • Hearts of Iron IV: Death or Dishonor
  • Age of Wonders III
  • Stellaris: Galaxy Edition
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Shadowrun Returns
  • Crusader Kings II: Holy Fury
  • Battle for Bosporus
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Hearts of Iron IV: La Resistance
  • Stellaris: Federations
  • Stellaris
  • Europa Universalis IV
  • Victoria 2
  • Europa Universalis III: Collection
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Crusader Kings II: Way of Life
  • Stellaris Sign-up
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Stellaris: Megacorp
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Europa Universalis III
  • Divine Wind
  • Heir to the Throne
  • Stellaris: Synthetic Dawn
  • King Arthur II
  • Stellaris - Path to Destruction bundle
Well, the algorithm is arguably bad. The AI slavishly adheres to the field priorities defined in its softcode file. If it's time to research a tech from a given field and no matching team is free - highest skill unmatching team is used.

And that team will then be unavailable (still occupied) when the time for its fitting field comes.

Add to this that technologies within fields have priorities themselves, which means that of two techs within a field, one fitting a free team well but with low individual priority, the other fitting considerably worse but of higher individual priority - usually the latter will be chosen and may, again, well block a good team from being used on a better fitting project that just happend to be selected next.

----

Sadly reordering based on team capability is, if I am not mistaken, NP-hard ("single-machine early/tardy problem" ought to be reducible, if I am not mistaken; there ought to be another NP-complete problem reducible to this, but I cannot recall the name - minimise the length of a timetable of interdependent jobs, of which arbitrary sets may be processed in parallel, as long as all elements of a set have their prerequisites fullfilled).

It should be possible to find a quite decent heuristic for this, but, well... it's been a while. So it will be a while.
 

Pang Bingxun

Field Marshal
2 Badges
Nov 22, 2011
5.596
185
  • Arsenal of Democracy
  • 500k Club
Sadly reordering based on team capability is, if I am not mistaken, NP-hard ("single-machine early/tardy problem" ought to be reducible, if I am not mistaken; there ought to be another NP-complete problem reducible to this, but I cannot recall the name - minimise the length of a timetable of interdependent jobs, of which arbitrary sets may be processed in parallel, as long as all elements of a set have their prerequisites fullfilled).

It should be possible to find a quite decent heuristic for this, but, well... it's been a while. So it will be a while.

I am not entirely sure about the implementation into the executable, but from a simply logic point of view there would seem to be a solution that is easy to understand and works sufficiently well. First of course some softcoding would be imported. Instead of something like this

Code:
technology = {
   endgoal    = {
     [...]
   }
   preference    = {
     [...]
   }
   ignore      = {
     [...]
   }
   armor      = 18
   infantry    = 63 # 21 x 3, super high priority
   industry    = 52
   aircraft    = 21
   naval      = 11 # 23 / 2, no navy early
   land_doctrines    = 26 # 13 x 2, no use of endgoal
   secret_weapons    = 6
   air_doctrines    = 38
   naval_doctrines = 7 # 21 / 3, no navy early
}

in 1.09 something like this

Code:
technology = {
   priority    = {
     [...]
     2170 = 250 # 10 x 25 # 1938 TD
     [...]
     3040 = 4200 # 100 x 42 # 1938 DD
     [...]
     5070 = 11800 # 200 x 59 # 1938 Machine Tools
     [...]
     6260 = 10800 # 150 x 72 # 1938 Blitzkrieg Doctrine
     [...]
   }
}

could be imported from the AI files in 1.11. I would be happy to supply a complete set of ai files. 25, 42, 59 and 72 are the actual difficulties of the techs. 10, 100, 200 and 150 are a priority modifier to indicate how much tech rushing a tech deserves with 100 indicating regular priority.

Now whenever at the start of a day a free tech slot can be used for every available tech team for every researchable tech it is remembered which combinations scores best at

Code:
score = [priority] x [historical date modifier] / [research time including ministers and ideas but excluding historical date modifier]

That combination will be used for actual research. Excluding the historical date modifier will simplify calculating the estimated research time. Using only the historical date modifier at the start of the research will make AI discriminate more strongly by the historical date modifier. Teaching AI to appreciate historical date modifier seems rather important.

One of the subtle effects of this approach is that available tech teams and ministers will influence the research strategy of AI. Identical imported research sections of an AI file might result in very different research strategies as AI will optimize for its strenghts. I image an alliance of AIs exchanging blueprints could utilize it relativly well.
 
Last edited: