1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Save research in the first five turns

Discussion in 'Civ4 - General Discussions' started by zoiks, Jan 2, 2019.

  1. zoiks

    zoiks Chieftain

    Joined:
    Aug 4, 2007
    Messages:
    39
    I see this mentioned a lot. But how do you do it?
     
  2. Bibor

    Bibor Doomsday Machine

    Joined:
    Jun 6, 2004
    Messages:
    2,968
    Gender:
    Male
    Location:
    Zagreb, Croatia
    When the game asks you to choose a tech in the pop-up sidebar, you do it, but then you click the thin tech bar on top of the screen and unselect it.
     
  3. 6K Man

    6K Man Bureaucrat

    Joined:
    Jul 17, 2007
    Messages:
    2,295
    Location:
    in a Gadda Da Vida
    I’ve never fully understood the mechanics of this, so I guess I’ll ask here.

    As I think I understand it: In the turn after you settle your first city, you are asked to select a tech to research. You then pick a tech, which has zero beakers assigned to it at that point. If you leave that tech selected, then at the start of the next turn it will have ~9 beakers, the turn after ~18 beakers and so on. But if you unselect the tech as Bibor describes, the ~9 beakers are not assigned to any tech, they are held in a kind of limbo, instead. After unselecting the tech, you will be prompted to re-select a tech the following turn. You can do this in the first 5 turns. After that, you have to pick a tech, and the beakers in ‘limbo’ will be assigned to it. If you unselect that tech, the beakers are still assigned to it on the next turn, and you're committed to research it, unless you want to change to something else and start research on that one with 0 beakers.

    Advantages: Your ‘limbo’ beakers will get a boost if you later assign them to a tech a civ you met knows. You have flexibility to change your research path if you find new resources. If you have huts/events enabled, you can reassign beakers if you find a tech in a hut/event.

    My questions:

    1. Is this a bug, or somehow intended?
    2. Can the AIs do this too? Or can AIs do this throughout the game?
    3. Can the number of turns where you can delay a tech choice be modified? I notice that it doesn’t scale with game speed.
    4. If you don’t remember to choose a tech in turn 5, do the beakers get assigned to the last tech you picked, or randomly? What if I change techs multiple times in turn 5?
     
  4. Bibor

    Bibor Doomsday Machine

    Joined:
    Jun 6, 2004
    Messages:
    2,968
    Gender:
    Male
    Location:
    Zagreb, Croatia
    The reason for the boost is the same as with Overflow. If you whip into a wonder for which you have a resource, it first counts the overflow hammers and then modifies that amount by resource bonus. Napkin math style explanation: if you're creative and whip a worker with 29 overflow, you'll get 58 overflow into a library.
    The same is true for techs - for every civ that knows a certain tech (and you have contact with the civ) you get a research discount. Since Deity civs start with all the starting techs and you don't, the more civs you meet in the first 5 turns, the more bonus you'll get into your "5-turn research overflow".

    Since beakers are so meager at start, every beaker counts, especially on a Pangaea where there's a chance you'll get boxed in. 5 or 10 turns don't seem that important until you hit a point where you have a 10-turn window to attack into bows instead of longbows. The same reason why mines are highly disfavored and happiness from whips ignored when going for any kind of rush, because objectively food and commerce are the only two yields that can make that happen in the required timeframe.
     
    Last edited: Jan 4, 2019
    6K Man likes this.
  5. Fippy

    Fippy Mycro Junkie Queen

    Joined:
    Mar 17, 2013
    Messages:
    11,706
    Gender:
    Female
    Would be surprised if somebody knows if it's a feature or oversight (bug) ;)

    As Bibor wrote, can be a nice bonus on high diffs and especially if you have bad starting techs.
    Leaders like Brennus i.e. have really good traits, but when you start with Myst & hunting and then want Agri, AH, Mining, BW..every beaker counts indeed.

    AIs never delay their decisions i think, they also give promotions to units without waiting what they really need.
    I remember that i once lost all beakers when forgetting about it after 5t, maybe somebody can confirm that?

    Oh and i think this could be moved to S&T, good topic.
     
  6. elmurcis

    elmurcis Emperor

    Joined:
    Feb 16, 2011
    Messages:
    1,132
    Location:
    Latvia
    Had some old rusty memories about this stuff (so wasn't exactly sure what happens after T5) so had to check again in game - if un-select again after 5 turns - yes, saved research is lost. So if playing large/huge map with far away AI, this thing pretty much can lose its value (for saving some research turn) although having few turns without research decision before checking what is around - yes, it can be really worth it as might change entire opening strategy.
     
  7. f1rpo

    f1rpo plastics

    Joined:
    May 22, 2014
    Messages:
    869
    Location:
    Germany
    The responsible code is in CvPlayer::doResearch, which is called at the end of every player's turn. Also for AI players, however, for these, CvPlayerAI::AI_doResearch is run beforehand, and that function always chooses a tech to research. Code (some spaces removed for readability):
    Spoiler :
    Code:
    if(isResearch()) {
      bForceResearchChoice = false;
      if(getCurrentResearch() == NO_TECH) {
        if(getID() == GC.getGameINLINE().getActivePlayer())
          chooseTech();
        if(GC.getGameINLINE().getElapsedGameTurns() > 4) {
          AI_chooseResearch();
          bForceResearchChoice = true;
        }
      }
      TechTypes eCurrentTech = getCurrentResearch();
      if(eCurrentTech == NO_TECH) {
        int iOverflow = (100 * calculateResearchRate()) /
            std::max(1, calculateResearchModifier(eCurrentTech));
        changeOverflowResearch(iOverflow);
      }
      else {
        iOverflowResearch = (getOverflowResearch() * calculateResearchModifier(eCurrentTech)) / 100;
        setOverflowResearch(0);
        GET_TEAM(getTeam()).changeResearchProgress(eCurrentTech,
            calculateResearchRate() + iOverflowResearch, getID());
      }
      if(bForceResearchChoice)
        clearResearchQueue();
    }
    So long as no city has been founded, isResearch returns false, no research is generated and the player isn't prompted to choose a tech. Once a city has been founded, if no research is chosen, the choose-tech popup is triggered and appears at the start of the next turn. After triggering the popup, if the number of elapsed turns is above the hardcoded threshold of 4, the AI chooses a tech for the player. This is remembered in the bForceChoice flag for later. Next, if no research is chosen yet, the current turn's research yield is added to the overflow. If research is chosen, any overflow is increased by modifiers that apply to the target tech, and the modified overflow and the current turn's research are spent on that tech. Finally, if the AI has chosen the tech, the human research queue is cleared so that the chosen tech is again blank.

    It might be worth noting that the code that applies modifiers to the accumulated overflow was added in Warlords, or at least it's not in the Vanilla DLL code, which says (otherwise as above):
    Spoiler :
    Code:
    if(getCurrentResearch() == NO_TECH)
      changeOverflowResearch(calculateResearchRate());
    else {
        iOverflowResearch = getOverflowResearch();
        setOverflowResearch(0);
        GET_TEAM(getTeam()).changeResearchProgress(getCurrentResearch(), (calculateResearchRate()
            + iOverflowResearch), getID());
    }
    Regardless of the game version, if you move your Settler for 5 turns (or just hit end turn) before founding a city, your first 9 or 10 research are going to be spent by the AI unless you select a tech on the turn that you found your city. The choose-tech popup doesn't appear until the next turn. So perhaps the 5 turn grace period was implemented in order to give players time to move their Settlers. If the popup were shown immediately after founding a city, this wouldn't be a problem, but the developers might have wanted to avoid confronting first-time players with both the city screen and the tech tree on the same turn.
     
    6K Man and Imp. Knoedel like this.
  8. Bibor

    Bibor Doomsday Machine

    Joined:
    Jun 6, 2004
    Messages:
    2,968
    Gender:
    Male
    Location:
    Zagreb, Croatia
    This is it.
     
  9. 6K Man

    6K Man Bureaucrat

    Joined:
    Jul 17, 2007
    Messages:
    2,295
    Location:
    in a Gadda Da Vida
    You folks are great. Ask a question, get an answer, no matter how esoteric the topic. Thanks everyone.
     
  10. zoiks

    zoiks Chieftain

    Joined:
    Aug 4, 2007
    Messages:
    39
    Yes, the first response was all I needed to help but thanks everyone for chipping in!
     

Share This Page