AI doesn't build added buildings?

fyermind

Chieftain
Joined
Apr 26, 2008
Messages
94
I've been merging K-Mod 1.44b with Gods of Old and I've come into a strange set of problems. It seems that the Python Callbacks don't get called (even with callback values in the XML set to 1), and the AI doesn't seem to build newly added buildings such as the shrines.

This seems to be true for any mods I'm doing to K-Mod, so I don't think I broke something by adding Gods of Old files.

Is this a known issue? Is there a solution?
 
K-Mod blocks a number of python callbacks by default. You can unblock whichever ones you need in "Assets/xml/PythonCallbackDefines.xml".

EDIT: Never mind, that's probably the "XML" you're referring to.
 
Last edited:
Here, I've compiled the DLL with the K-Mod-introduced callback blocks disabled. See if it works with that.
 

Attachments

  • CvGameCoreDLL.7z
    1 MB · Views: 231
Thank you! It seems to be an issue with iValue for new buildings as buildings that found a religion using python don't appear to have any use to the AI at the c++ level. It looks like I need to figure out how to hack the AIs production queue to add these in the appropriate place or change lots of things so that it realizes the buildings found religions and that religions are significantly more powerful.

Is there a visual flowchart anyone has compiled for how the AI makes build/tech decisions?
 
You should consider the iAIWeight value in the building XML, or use additional Python callbacks for building value calculation if you need something more involved.
 
Those aren't seeming to work. I'm not sure why the iAIWeight value doesn't do the thing, but it seems not to. It may be that the buildings are being invalidated from the start because I did something else wrong, I'm unsure. The human can build them just fine.
 
I suggest you try to debug the DLL / add some logging to see if the code actually reaches the value calculation.
 
iAIWeight should work (K-Mod will "interpret" it as additional value equivalent to iAIWeight/4 commerce per turn). But I think that the problem is that those building probably have positive iReligionChange for their religion, but the AI will never build such building if they don't own that religion's holy city. That works ok for K-Mod, but obviously not for a mod where building the shrine founds religion.

This can be fixed if you're able to edit the sourcecode and recompile the DLL; or if you're ok with shrines not making the religions more likely to spread (by setting iReligionChange to 0).
 
Last edited:
@DarkLunarPhanto You are exactly right! Thank you so much. Months of confusion has been solved. I have already split the shrines from the foundations, I just didn't remove spreading from the foundations. I removed that and everything works perfectly!

Now I just need to estimate the value of a holy city in commerce and add the appropriate flavors so Montezuma favors the religion of war and Surry favors the religion of life etc.
 
Top Bottom