# The Mechanics of Overflow Inflation

Discussion in 'Civ5 - Strategy & Tips' started by Fallen_Kings, Dec 31, 2013.

Not open for further replies.
1. ### Fallen_KingsChieftain

Joined:
Oct 21, 2013
Messages:
97
Compound interest is the most powerful force in the universe.
- Albert Einstein

Hello guys,this is my first post in CFC,what im gonna talk about may be a bit hard to understand,and besides I'm not a native speaker,so if you are getting mad in it please accept my apology

Now let's begin.

"Overflow Inflation" is a phenominon that,when you begin to research a new technology(name it "T"),all beakers accumulated but unused before(called"overflow") will automatically multiplied due to other players' discovery OF T,before they are spent in T.

CurrentBeakers=beakers you get this turn+overflow*(1+0.3*number of players that have discovered T/number of players alive)*1.2(If T is discovered by at least one player and "Scholar in Residence"proposal is in place)

eg:you are researching sailing,which has been discovered by all other 7 players.Your overflow is 30,00 and your current research is 100.The Scholar in Residence proposal is not in place.
Currentbeakers=3000*(1+0.3*7/8)+100=3787
beakers spent on sailing are:
beakersneeded=65/(1+0.3*7/8)=51
So,you discovered fishing in one turn,and the beakers left is:
newoverflow=3787-51=3736

See?After researching a new technology,your beakers are not reduced,but increased by 24.5%!

And then,let's get to optics,which is also discoverd by all ohter players.Your current research is still 100,but this time,the Scholar in Residence proposal is in place.

Currentbeakers=3736*(1+0.3*7/8)*1.2+100=5937
beakers spent on optics are:
beakersneeded=85/(1+0.3*7/8)=67
So,you discovered fishing in one turn,and the beakers left is:
newoverflow=5937-67=5870

Yes.The overflow doubled after simply researching 2 small technology.

If you have a large number of overflow(Through GreatScientist,RA,etc.)and lots of technologies that already discovered by most players but not by you,you can create an exponential growth.It has been calculated that the beakers could reach more than 80,000 times as original,which means,if you have more than 100 current research and just one GreatScientist,you can do this in less than 30 turns:
1.launch the spaceship and win a science victory
2.crush your enemy's lancer with giant death robot and win a domination victory
3.discover the Internet and win a cultural victory.
4.found the UN and win a diplomatic victory

Ironically,there is a bug which exists since the beginning of C5,that you can never have more than 210k beakers,because beakers are stored in INT type.If you do so,you will find you have a negative number of beakers.So calculate well before you do this.

How to do this:
1.Keep some small technologies undiscovered,especially the fishing line.
2.Pass the Scholar in Residence Proposal as fast as possible
3.At least one GreatScientist and more than 100 current research.
4.Calculate carefully.Make sure your final beakers are neither too few or too many.

Spaceship Record:
It may seem more like a bug than a "strategy",but to make the most of it and create a new spaceship record is not that easy,perfecting it for one year,we still find it hard to beat down the traditional record(which was 159T in GK and 182T in BNW,both in normal speed).Because you can't finish more than one technology in a turn(We have tried RA,GS and even Interfaith Dialog,but then we found their "overflow" is calculated independently),you can't speed up infinitely.In the traditional play where you heap up beakers for 8 turns and then popped all GSs,you sprint to victory at the same speed.When you play overflow,how fast you achieve victory depends on how fast you or AI found the world congress.If you research Printing yourself,you need a good map;If you want AI to do it for you,you need a good luck.

Relevant code:
int CvPlayer::calculateResearchModifier(TechTypes eTech) const
{
int iModifier = 100;

if (NO_TECH == eTech)
{
return iModifier;
}

int iKnownCount = 0;
int iPossibleKnownCount = 0;

for (int iI = 0; iI < MAX_CIV_TEAMS; iI++)
{
CvTeam& kLoopTeam = GET_TEAM((TeamTypes)iI);
if (kLoopTeam.isAlive() && !kLoopTeam.isMinorCiv())
{
if (GET_TEAM(getTeam()).isHasMet((TeamTypes)iI))
{
if (kLoopTeam.GetTeamTechs()->HasTech(eTech))
{
iKnownCount++;
}
}
iPossibleKnownCount++;
}
}

if (iPossibleKnownCount > 0)
{
iModifier += (GC.getTECH_COST_TOTAL_KNOWN_TEAM_MODIFIER() * iKnownCount) / iPossibleKnownCount;
}

// Leagues mod
int iLeaguesMod = GC.getGame().GetGameLeagues()->GetResearchMod(GetID(), eTech);
if (iLeaguesMod != 0)
{
iModifier *= (100 + iLeaguesMod);
iModifier /= 100;
}

return iModifier;
}

Joined:
Dec 31, 2013
Messages:
22
Just played a small/quick/emperor game as Korea to test this out. This is p. crazy. I left the sailing line un-researched except for Sailing itself which I got from one of my first few ancient ruins. I saved up every great scientist past my first one. Once I got Scholars in Residence passed I popped all my scientists and began researching up the sailing line. Once that line had caught up to the bottom military line I simply chose the lowest rank tech to research each turn.

I waited way late to pop my GS's as I wasn't sure when it would be optimal to do so. Going to play around with this a bit on standard size/speed maps and see just how early I can nab a science victory.

(Large) Screens:
Spoiler :

3. ### Erneiz HydeWarlord

Joined:
Jun 7, 2011
Messages:
280
Whoa, wow, sounds exploitative like hell, but still is curious how this works. It hinges on Scholar in Residence, and techs that are already researched by other Civs right? Sounds like this works better in higher difficulties where you'll be more likely to be behind the tech tree.

All techs past the current era obviously still hasn't been researched by anyone, so how come the beakers can still hold long past that?

4. ### phillipwyllieWannabe Deity

Joined:
Dec 11, 2003
Messages:
1,458
Location:
4 Hexes from FoY
This is similar to production overflow. Nice find though as in my games I'm usually the tech leader so I don't want Scholars in Residents passed.

5. ### Magma_DragoonReploid

Joined:
May 10, 2008
Messages:
2,354
Because, the overflow value is increasing every time a tech is researched, more than the cost of the tech itself. The 80 or so it took to get optics is dwarfed by the 800 he gets from the known by others bonus. Every old tech he discovers accumulates a larger and larger overflow, until there is enough stored up to get all the way to the info era.

Can't say I'm surprised by science overflow (still) being buggy, though I am baffled by the developer's decision to use a serif font for CJK localization.

I'll have to abuse this three or four times before they patch it out

Joined:
Dec 31, 2013
Messages:
22
It doesn't depend on Scholars in Residence but without it you will need more initial overflow to be effective. Scholars is really what pushes this over the edge.

The beakers hold out because the gain in overflow from the early technologies is insanely high compared to the actual beaker cost of that tech.

I just played another quick game (this time as Babylon) again on Emperor. Took forever to get the World Congress going since Portugal was hiding out down in a corner of the map and I couldn't find her. By the time I did the game had auto-discovered the sailing line for me up to astronomy (why does this happen?). Passed Scholars and popped scientists right at start of industrial era but my overflow ran out of steam right before I hit the information era. Large part of the problem I think was no-one had researched my non-researched techs since Washington wouldn't stop razing everyone's cities every century or so.

7. ### Hammer RabbiDeityGOTM Staff

Joined:
Jan 3, 2012
Messages:
4,460
Location:
USA
would those who have posted VERY large pictures please put them in a spoiler? it has forced excessive thread resizing. interesting topic though. thanks.

8. ### Light ClericElCee/LC/El Cid

Joined:
Feb 5, 2011
Messages:
3,225
Wow, very interesting read. I wonder how many fast SVs have involved this o_O Has this been around for a long time?

9. ### IronWallChieftain

Joined:
Apr 27, 2013
Messages:
5
Location:
china
support you &#65281;Maximus
This setting must be modified&#65281;

10. ### ravenmagusWarlord

Joined:
Dec 28, 2013
Messages:
251
Gender:
Female
Location:
Washington, DC
This works, and it's really ridiculous.

The further behind you are when you start this, the faster you get ahead.

I officially dub it the Science Slingshot.

11. ### MoriarteImmortal

Joined:
May 10, 2012
Messages:
2,050
And what a post it is! Thanks for the the new year present, mate.

Made a demonstration of that terrible mechanic on my channel.

Will be live in 30 mins.

12. ### Fallen_KingsChieftain

Joined:
Oct 21, 2013
Messages:
97

It was first discovered in GK one year ago.We thought it would be patched out in BNW but instead they strengthened it

13. ### Hammer RabbiDeityGOTM Staff

Joined:
Jan 3, 2012
Messages:
4,460
Location:
USA
im watching Moriarte's LP and this is quite stunning. can't believe these forums havent known about this yet. (btw, thank you for spoilering the pics!)

14. ### MoriarteImmortal

Joined:
May 10, 2012
Messages:
2,050
Farewell present from the dev's?

15. ### Fallen_KingsChieftain

Joined:
Oct 21, 2013
Messages:
97
The dev's can't beat Diety level,so they create this

16. ### shdaolhiChieftain

Joined:
Jan 1, 2014
Messages:
1
Here are my knees&#65281;

Joined:
Aug 10, 2012
Messages:
24
judging from his screenshot he is Japanese and not Chinese or "from some asian country"...

18. ### MoriarteImmortal

Joined:
May 10, 2012
Messages:
2,050
I didn't say he is "from some asian country", please be careful when posting quotes.

19. ### Light ClericElCee/LC/El Cid

Joined:
Feb 5, 2011
Messages:
3,225
I have to imagine this is one of those things people knew about but kept under wraps like the old Research Agreement overflows giving way too many beakers.

Thanks to the OP for bringing this to light. I'll watch Moriate's vid when I have a computer again