How to mod Religions


Aug 14, 2010
So I want to change the bonuses for religions so that some religions give a greater happiness bonus, others more gold, or research or health or whatever. I know how to change gold, research and culture but I am wondering if it is possible to change the happiness bonuses as well as the health bonuses. Also I would like to make it so that each additional religion in a city gives an unhappiness bonus of one. Lastly I was wondering if the computers would know how to use this change and pick religions that compliment their strategy and if this could be used with my friends online. Any help with any of this would be greatly appreciated. Please do not post links unless they expressly explain the answers to any of these questions.
but I am wondering if it is possible to change the happiness bonuses as well as the health bonuses.

Is not directly possible.
But easiest thing is here to change the stats of the temples or monasteries.

Also I would like to make it so that each additional religion in a city gives an unhappiness bonus of one.

I guess for that you need C++ coding :dunno:.
Could think of a hacky python solution, but that would not be good.

Stop asking this. People won't answer because you keep posting.

WTF :confused:?
The_J said:
WTF :confused: ?
He made a thread for his question in different forums 4 times.

But an easy way to make them give unhappiness is by modding civicinfos.xml so that all religious civics give unhappiness for more religions.

Sorry I believe it was only two times and I was asked to move it here so I did. Sorry if I offended you.

Thanks for the help The_J. However I have been looking at the XML and correct me if I am wrong but I believe that by using coding similiar to that used for the nation hood civic, but in the state religion XML I should be able to give happiness modifiers to the corresponding temple. Also while doing some research on the site I found a guide to changing health and happiness bonuses supposedly using c++, I regret to say that I am very unfamiliar with the language but it appeared to be very similiar to XML or HTML, however the writer of the guide whose name unfortunately escapes me added an unhappiness bonus to a city which had been nuked. I was wondering how exactly this could be changed to add a negative one bonus for every additional religion in a city. And once again will the computers recognize the difference in the religions and play accordingly. Thanks in advance.
That might be a good idea to use for a Gods of Old mod. I might have to download a few of them and look at their data. I could have sworn I've read one of them have something like this (where additional religions give unhappiness). But I don't usually download other mods. But since I'm now too getting into modding, I might as well download others mods and look at the codes, to learn more from. :)

I'm still new at this, but I'm not sure how religions can be directly modded to give different bonuses. The Gods of Old mod add different bonuses based on the buildings, so you might want to try doing it that way? Another way that MIGHT work is looking at the code for corporation. Copy them to the religions. Not sure how that would work exactly, but it's worth a test.
Cody4418, I'm afraid there is no "code" for something like what you're requesting. XML modding isn't sufficient either so this is really a programming job. While you could most definitely learn the craft as such, it would make no sense to try and explain to you how to implement this before you know what that person is talking about.

Only once you learn programming would you be able to start thinking in terms of how to make the AI aware of you changes and such.
Each civic has a value called iNonStateReligionHappiness in CIV4CivicInfos.xml.

You should be able to set this to -1 to have each religion in a city other than the state religion give -1 happy to the city. If you do this for every one of the civics with CivicOptionType CIVICOPTION_RELIGION then there will be no way to avoid it - although you should probably not set Free Religion to have this since that one rules out having a state religion. There may be some formatting or appearance issues from using the negative number, but it ought to work anyway (there are many places in Civ where they apparently did not consider that using negative numbers could be useful).

There is no existing tag in the XML for doing this with health.
Greatly appreciated God-Emperor that worked like a charm. My question about the XML was could I add something like
<iStateReligionHappiness>1</iStateReligionHappiness> below the <iStateReligionCommerce> and would it work. If so could I do the same with health, espionage, unit experience, hammers, and so on and so forth? Again thanks in advance for anyone who can help.
There is already an iStateReligionHappiness tag (right above the iNonStateReligionHappiness one) in the civics file. No civic in regular BtS uses it, but presumably it does what it says and gives the specified amount of happiness to cities that have the state religion if you are using that civic.

There is also already an iStateReligionFreeExperience tag in the civics file (as used by Theocracy to give +2 xp to units built in cities with the state religion).

Espionage is just a commerce type, so you may be able to specify it in the StateReligionCommerces in CIV4ReligionInfo.xml by just adding a fourth iStateReligionCommerce tag. This should work if they used the standard commerce loading function to parse those tags, but I haven't checked. (The "commerces" are money, research, culture, and espionage, in that order.)

"Hammers" is a type of yield, and there are no yield tags related to state religion.

Health for state religion is also not currently mentioned (I think the Rise of Mankind 2 mod has already added this in, along with about a gazillion other things).

You can't just add tags to the XML at whim. It requires changing the schema for the file just to get the file to be read with new tags in it (if you don't add them to the schema, the attempt to parse the file will fail so nothing in the file will be loaded). At that point it will read the file but the new tags won't do anything. It also takes modifying the DLL to get the new tags to actually do something. And then it takes more fiddling with the DLL to get the AI to actually know about what you have added and make some at least semi-reasonable use of it - this is typically the most complicated part, although it can sometimes be omitted if you are adding an additional effect to something that the AI already knows about (it will just not increase the amount it values the thing to account for the added effect since it doesn't know about the added effect).
So with the Rise of Mankind 2 mod they added health in the religions file if I am understanding what you are saying, but in order to do so they had to alter the dll? I assume that I could add hammers and health and such because since the XML tags exist for civics they could also be used in the religion XML but you're saying not so?
Well, I just checked. Looks like I was wrong and they didn't add health for state religions in RoM - although it has a bunch of additional stuff for civics it is mostly related to the revolutions feature and the one new tag for religion info is, I think, for picking which icon to use for the religion from the gamefonts TGA file (I think it is based purely on the order they appear in the file in regular BtS). (I'm only in my second game with that mod, I guess I was just mistaking general health changes for state religion related health changes. Oops.)

But no, you can't just add tags and expect them to do something. What they do has to be programmed in - for starters you have to modify the relevant class to give it someplace to store the new data before you add the code for it to actually do something with the new data.
Top Bottom