• We need to know your opinion about our social media accounts! Tell us here if you follow us on social media and what we could improve.

[BNW] <Improvement_YieldPerEra> of my Custom Tile Improvement is not working, Help!


Feb 29, 2020
<Improvement_YieldPerEra> of my Custom Tile Improvement is not working, Help!
So YieldPerEra is a bit of a weird thing, and the name is rather misleading.
It works based on the era of archaeological records, and is for instance used for the landmark to give extra culture the older your artefact is. It does not give yields based on the construction era of the improvement.

The relevant source code:
    int iYieldChangePerEra = pImprovement->GetYieldChangePerEra(eYield);
    if (ePlayer != NO_PLAYER && iYieldChangePerEra > 0)
        CvPlayerAI& kPlayer = GET_PLAYER(ePlayer);

        int iPlotEra = GetArchaeologicalRecord().m_eEra;
        int iNumEras = kPlayer.GetCurrentEra() - iPlotEra;

        if (iPlotEra != NO_ERA && iNumEras > 0)
            iYield += (iNumEras * iYieldChangePerEra);
Specifically note that iPlotEra is based on the era of the archaeological record on the plot.
Top Bottom