vranasm
Deity
ok the code for barbs teching is here
the important call is probably "changeResearchProgress"
where there is some "barbarian_free_tech_percent" XML variable multiplied by number of civs knowing the tech and then divided with the number of all AI's, then divided by 100.
i speculate once this number is >1 then you get the tech (the number multiplies tech cost of the tech and assigned as research progress).
so it depends probably on difficulty in 2 ways...first the xml value, second the AI's teching speed.
As I read it it's done with every tech in one loop, but depends on this code GC.getNumTechInfos() which is invisible of course.
Spoiler :
Code:
if (isBarbarian()) {
for (iI = 0; iI < GC.getNumTechInfos(); iI++) {
if (!isHasTech((TechTypes) iI)) {
iCount = 0;
iPossibleCount = 0;
for (iJ = 0; iJ < MAX_CIV_TEAMS; iJ++) {
if (GET_TEAM((TeamTypes) iJ).isAlive()) {
if (GET_TEAM((TeamTypes) iJ).isHasTech((TechTypes) iI)) {
iCount++;
}
iPossibleCount++;
}
}
if (iCount > 0) {
FAssertMsg(iPossibleCount > 0, "iPossibleCount is expected to be greater than 0");
changeResearchProgress(((TechTypes) iI), ((getResearchCost((TechTypes) iI) * ((GC.getDefineINT("BARBARIAN_FREE_TECH_PERCENT") * iCount) / iPossibleCount)) / 100), getLeaderID());
}
}
}
}
the important call is probably "changeResearchProgress"
where there is some "barbarian_free_tech_percent" XML variable multiplied by number of civs knowing the tech and then divided with the number of all AI's, then divided by 100.
i speculate once this number is >1 then you get the tech (the number multiplies tech cost of the tech and assigned as research progress).
so it depends probably on difficulty in 2 ways...first the xml value, second the AI's teching speed.
As I read it it's done with every tech in one loop, but depends on this code GC.getNumTechInfos() which is invisible of course.