[SDK REQUEST] Favorite Religion for Leaders?

Grave

1 Goat = 400 Horses
Joined
May 5, 2002
Messages
1,530
Location
Louisiana
Can one of you C++ savy types add a 'Favorite Religion' to each Leader, sort of along the lines of 'Favorite Civic'?

This way, a Leader would be more inclined to adopt their Favorite Religion as their state religion if it's available to them.

Most of my games (around 90%), all the leaders either have Hinduism or Buddihism as their religion, even after all religions have been founded. Islam and Christianity are completely ignored because they appear later in the game.

Anyway, if somebody could look into this, that'd be awesome. Please PM me if you're interested in taking on this endeavour.


Grave
 
I'll see what I can do about this, ok?

One thing, can you give me the default values for the favorite religions for each leader?

Thanks
 
Thanks TheLopez... I was kinda hoping you'd see this! :)

I'm eagar to learn C++, I'm just afraid that, since I've never messed with it before, that I wouldn't be able to come up with exactly what this mod would imply. :)

When you mean 'default values' for the favorite religions for each leader are you refering to the prefered religion for each leader? If so, I was thinking along these lines: (as quick examples... might not be historically accurate)

George Washington: Christianity
FDR: Christianity
Saladin: Islam
Montezuma: [NONE]
Mao Zedong: Buddhism
Qin Shi: Taoism
Hatshepsut: [NONE]
Victoria: Christianity
Elizabeth I: Christianity
Louis XIV: Christianity
Napoleon: Christianity
Frederick II: Christianity
Bismarck: Christianity
Alexander: [NONE]
Huayna Capac: [NONE]
Gandhi: Hinduism
Asoka: Buddhism
Tokugawa: [NONE]
Mansa Musa: Islam
Genghis Khan: Taoism
Kublai Khan: Buddhism
Cyrus: [NONE]
Caesar: [NONE]
Catherine: Christianity
Ivan: Christianity
Isabella: Christianity

Ramesses II: Islam - (representing modern Egypt)
Churchill: Christianity
Augustus: Christianity (representing Holy Roman Empire)
Stalin: [NONE]
Shaka: [NONE]
Hannibal: [NONE]
Brennus: [NONE]
Wang Kon: Buddhism
Mehmed II: Islam
Ragnar: Pagan

I realize there are alot of [NONE]'s in there. In a way it's a placeholder for not having a prefered religion, if the player so chooses. But if this can get up and running, I plan on adding a few more religions for my next add-on mod, once Sevo makes his mod compatable with Warlords.

I'll add Shinto, Egyptian Mythology, Norse Mythology, Greek Mythology, Zoroastrianism, etc. I'll refine them more and not make them so generic/rough sounding, if the Favorite Religion concept becomes more of a reality. :)
 
Cool, thanks...

An update, I am about 30% done:
Done - Update SDK with all favorite religion changes
Done - Compile SDK without any compilation errors or major warnings
Not Done - Update XML files to use new tags (This is the part that will take the most time)
Not Done - Update Python files to use new tags
 
Cool mod. I like it!

It would be nice to add an option - not necessarily a religion choice - for a leader to eschew a religion, altogether.

Adding other religions is a good idea for Alexander and Hatshesput and Montezuma, etc. But it would be nice to reflect Mao and Lenin not wanting religion to spread at all.
 
TheLopez said:
Cool, thanks...

An update, I am about 30% done:
Done - Update SDK with all favorite religion changes
Done - Compile SDK without any compilation errors or major warnings
Not Done - Update XML files to use new tags (This is the part that will take the most time)
Not Done - Update Python files to use new tags

Thanks a million, TheLopez! You never cease to amaze me with your promptness. I know you've helped me in the past, and I always appreciate it! :king:

I'm really interested in seeing your work, once it's all done. Maybe by looking at exactly *how* you made this mod possible, I could learn how to do similar mods myself. :) I figure if I'm going to get back into the modding scene, I best learn how to use the SDK! :)

Wyz_sub10 said:
Cool mod. I like it!

It would be nice to add an option - not necessarily a religion choice - for a leader to eschew a religion, altogether.

Adding other religions is a good idea for Alexander and Hatshesput and Montezuma, etc. But it would be nice to reflect Mao and Lenin not wanting religion to spread at all.

I'd like to create an "anti-religion" in the game. Maybe some form of atheism or agnosticism... for game purposes, it would be another "religion". I just need to sit down and take a look at what I can do to seperate this philosophy, game-wise, from the other religions.

Could you elaborate on a leader eschewing a religion?
 
GraveEatr said:
I'd like to create an "anti-religion" in the game. Maybe some form of atheism or agnosticism... for game purposes, it would be another "religion". I just need to sit down and take a look at what I can do to seperate this philosophy, game-wise, from the other religions.

Could you elaborate on a leader eschewing a religion?

The reason I avoided 'Atheism' or 'Agnosticism' is that I can see a difference between this and 'anti-religion'. The 'anti-religious' leader will apply a negative modifier to another leader with state religion, but will avoid/disallow the presence of religion within his boundaries as well. An atheist leader would not necessarily take this drastic stance - positive modifier with other atheist civs, and preferring atheism (but not disallowing the presence of other religions).
 
I'll work something out... just gotta actally sit down and ponder over it. ;)

I do want some kind of "religion" that would represent the Marxist viewpoint, as you suggested. Something that doesn't allow state religion, yet doesn't spread either. It would go great for that oppressive Police State that I always enjoy running. :)

I do see what you're saying though... I think we're on the same page.
 
TheLopez said:
Cool, thanks...

An update, I am about 30% done:
Done - Update SDK with all favorite religion changes
Done - Compile SDK without any compilation errors or major warnings
Not Done - Update XML files to use new tags (This is the part that will take the most time)
Not Done - Update Python files to use new tags

This looks great, TheLopez. We have been having a similar discussion over at Eusebius World Religion. Can you tell me where to find the SDK code where the AI choses a religion? I'm very interested in understanding this and possibly altering it.

Also I am curious; how much additional work would it be to be able to change the favored religion from Python in addition to XML?

Thanks,
Eusebius
 
Eusebius said:
This looks great, TheLopez. We have been having a similar discussion over at Eusebius World Religion. Can you tell me where to find the SDK code where the AI choses a religion? I'm very interested in understanding this and possibly altering it.

Also I am curious; how much additional work would it be to be able to change the favored religion from Python in addition to XML?

Thanks,
Eusebius

I was thinking this mod concept would compliment your mod very nicely. Would fill in that "secular" gap for Stalin and Mao, as well as Hellenism for Alexander and even Ceasar.
 
Eusebius said:
This looks great, TheLopez. We have been having a similar discussion over at Eusebius World Religion. Can you tell me where to find the SDK code where the AI choses a religion? I'm very interested in understanding this and possibly altering it.

Also I am curious; how much additional work would it be to be able to change the favored religion from Python in addition to XML?

Thanks,
Eusebius

Eusebius,

The best place to start would be by looking at the AI_bestReligion method in CvPlayerAI.cpp. This is where the AI evaluates which religion to pick. Next would be the AI_religionValue method in CvPlayerAI.cpp. This is where the AI gets the value for each religion and uses it in the AI_bestReligion method.
 
TheLopez said:
Cool, thanks...

An update, I am about 30% done:
Done - Update SDK with all favorite religion changes
Done - Compile SDK without any compilation errors or major warnings
Not Done - Update XML files to use new tags (This is the part that will take the most time)
Not Done - Update Python files to use new tags

What XML tags need to be added?

Is it something like (example):

Code:
<FavoriteReligion>NONE</FavoriteReligion>

If it's just the XML... I could do that for you, if you could update the python files. I'm really interested in seeing how you coded the DLL files, because I was trying to work on the Multipule Favorite Civics concept this weekend, and the C++ was kicking my ass.
 
Well, there are actually 4 new tags:
<iFavoriteReligionAttitudeChange>
<iFavoriteReligionAttitudeDivisor>
<iFavoriteReligionAttitudeChangeLimit>
<FavoriteReligion>

these 4 new tags mirror their civic counterpart tags. But don't worry about doing the XML, I'm almost done with it.
 
This is a really great idea. I always was thinking about something like that. It would be great to use INI parser in order to set own religions. SOme MOds have customized religions etc.

Regards
Houman
 
GraveEatr, the mod is done now. I am just finishing up the readme file. One thing though I am going out to dinner with my family and grandparents.

EDIT: Houman - I have exposed the methods needed in python to set leaders favorite religions.
 
For Mao, Stalin, and maybe a few others like the Egyptian pharaohs (the caesars too), create a religion called "Personality Cult." This is a religion where the leader of the state is worshipped as a god. Pharaohs were thought of as "gods," and Mao and Stalin had themselves treated as gods by the public (pins, pictures, statues, etc. - Stalin's successor, Khruschev, strongly criticized Stalin for setting up a personality cult). Kim and wartime Hirohito are other examples of this, but of course they're not in the game.
The advantage to creating this religion is that it is truer to history, probably offends no-one (I hope), and does not present atheism/agnosticism inaccurately (as Wyz Sub10 points out).
 
Armandeus said:
For Mao, Stalin, and maybe a few others like the Egyptian pharaohs (the caesars too), create a religion called "Personality Cult." This is a religion where the leader of the state is worshipped as a god. Pharaohs were thought of as "gods," and Mao and Stalin had themselves treated as gods by the public (pins, pictures, statues, etc. - Stalin's successor, Khruschev, strongly criticized Stalin for setting up a personality cult). Kim and wartime Hirohito are other examples of this, but of course they're not in the game.
The advantage to creating this religion is that it is truer to history, probably offends no-one (I hope), and does not present atheism/agnosticism inaccurately (as Wyz Sub10 points out).

That's a good idea (making it a religion). I thought about this a little before, and I was originally thinking of making it a religious civic, and giving it no State Religion, and maybe give it a large negative boost to WarWeariness.... something along those lines. Then in addition to that also creating an atheistic/agnostic civic thats similiar, but make a few things different about it.
 
TheLopez, you tell us it's done and then say sorry but you've got to do something else for a bit? :lol: You tease! Why not just skip the update and post it when it's done? ;)
 
Well, the release is ready for testing. Any takers?
 
Top Bottom