Citizen Automation

OrionVeteran

Deity
Joined
Dec 25, 2003
Messages
2,443
Location
Newport News VA
When I turn off Citizen Automation in a city, what I expect is for all specialists to remain in place and any new population points be added to the number citizens. Thus, I would manually convert the citizen to the specialist or plot of my choice. Instead, the city governor made the decision despite Citizen Automation being turned off. To me this is totally unacceptable and circumvents the disabled Citizen Automation command button. The so called city governor is known to make bad choices and usually does. So my goal is to fix this problem once and for all time. There appears to be three SDK functions that might be involved in the governor's bad choices:

alterSpecialistCount
setSpecialistCount
changeSpecialistCount

What I need is to pinpoint in the SDK where a specialist is added when Citizen Automation is turned off. Any help locating the culprit line(s) would be most helpful.

OV
 
You mean void CvCityAI::AI_assignWorkingPlots()
When the city grows, extraPopulation() will be greater than 0, and AI_addBestCitizen() will be called, which assigns the new pop to work a plot or become a specialist based on the values that AI_specialistValue() and AI_plotValue() calculate.
 
You mean void CvCityAI::AI_assignWorkingPlots()
When the city grows, extraPopulation() will be greater than 0, and AI_addBestCitizen() will be called, which assigns the new pop to work a plot or become a specialist based on the values that AI_specialistValue() and AI_plotValue() calculate.

The test worked! Everyone of my city specialists retained the manual settings I gave them. There was only one exception: The farmer specialist increased by one because the city population increased on the next round.

I can see the light at the end of the tunnel. Now I need to find where a specialist is assigned when the population increases and change the code to add a default citizen instead of the specialist. Of course this will only happen when citizen automation is turned off. Once that is done, the citizen automation will finally be working correctly. Update: I found it! The change has been made and it works! :) Look for the SDK change when OGI 3.09 is released.

Thank you so much!
:thanx:
 
Back
Top Bottom