Afforess
The White Wizard
I think I identified the largest slowdown in Rise of Mankind. I did some profiling with the game engine, which lets me see how much time the game spends computing each function, in ms. When I first ran it, I found some functions were taking 13000+ ms. I looked at them, and found they all had python callbacks in them, which turned out to be the real culprit behind the slowdowns. I removed the python callback in that particular function, to see the computational time drop from 13700 ms to 1334 ms, on that particular function.
I think if we can identify and remove every python callback, AND replace their old functionality with something in the SDK, we could speed up RoM a great deal.
Now, I looked at all the python callbacks enabled in RoM, and I have a few suggestions for each on how we can replace them:
USE_CANNOT_DO_CIVIC_CALLBACK: Used for Modular Civic Buildings, Slave Market, Military Buildings... etc...
I am already 95% done with a new SDK based XML tags for PrereqOrCivics and PrereqAndCivics. It works, and shows up fine, I just need to get the Obsolencance to work, and I can replace everything with those XML tags and get rid of this callback.
USE_CANNOT_CONSTRUCT_CALLBACK: I believe this is used for Zappara's upgrade paths for buildings. Correct me if I am wrong.
Dom Pedro has a XML tag called 'Replace Buildings" which removes specified buildings from a city when a building is completed. I believe this could be used to replace this feature.
USE_GET_UNIT_COST_MOD_CALLBACK: A wonder? I don't know where this is used. Can someone figure it out?
USE_GET_BUILDING_COST_MOD_CALLBACK: Same as above...
USE_CANNOT_TRAIN_CALLBACK: Inquisitors.
Phungus came up with a way to do this without callbacks. I already have his SDK changes merged, I just need to add the new XML.
USE_CAN_TRAIN_CALLBACK: Inquisitors again?
Any other comments, suggestions?
I think if we can identify and remove every python callback, AND replace their old functionality with something in the SDK, we could speed up RoM a great deal.
Now, I looked at all the python callbacks enabled in RoM, and I have a few suggestions for each on how we can replace them:
USE_CANNOT_DO_CIVIC_CALLBACK: Used for Modular Civic Buildings, Slave Market, Military Buildings... etc...
I am already 95% done with a new SDK based XML tags for PrereqOrCivics and PrereqAndCivics. It works, and shows up fine, I just need to get the Obsolencance to work, and I can replace everything with those XML tags and get rid of this callback.
USE_CANNOT_CONSTRUCT_CALLBACK: I believe this is used for Zappara's upgrade paths for buildings. Correct me if I am wrong.
Dom Pedro has a XML tag called 'Replace Buildings" which removes specified buildings from a city when a building is completed. I believe this could be used to replace this feature.
USE_GET_UNIT_COST_MOD_CALLBACK: A wonder? I don't know where this is used. Can someone figure it out?
USE_GET_BUILDING_COST_MOD_CALLBACK: Same as above...
USE_CANNOT_TRAIN_CALLBACK: Inquisitors.
Phungus came up with a way to do this without callbacks. I already have his SDK changes merged, I just need to add the new XML.
USE_CAN_TRAIN_CALLBACK: Inquisitors again?
Any other comments, suggestions?