How is a Civilization's literacy calculated?

Literacy is one of the demographics in Civilization 5. How is it calculated? How do you compare two civilizations via this statistic? Are you able to tell how advanced a civ is compared to you by comparing your relative Literacy ratings?


Solution 1:

It's the percentage of the total technologies you've researched, as long as you have writing, otherwise it's always 0. Note that what follows is not my research, I found this on the CivFanatics forums:

From Assets/UI/InGame/Popups/Demographics.lua:

function GetLiteracyValue( iPlayer )

    local pTeamTechs = Teams[ Players[ iPlayer ]:GetTeam() ]:GetTeamTechs();

    local iWriting = GameInfoTypes[ "TECH_WRITING" ];
    if( iWriting ~= nil and 
        not pTeamTechs:HasTech( iWriting ) ) then
        return 0;
    end

    local iCount = 0;
    for row in GameInfo.Technologies() do
        if( pTeamTechs:HasTech( row.ID ) ) then
            iCount = iCount + 1;
        end
    end

    return 100 * iCount / #GameInfo.Technologies;
end

Since "Future Tech" never gets fully researched, you can never reach 100% literacy.