1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Religion

Discussion in 'Civ4Col - Medieval: Conquests' started by drjest2000, Jul 31, 2013.

  1. Fullerene

    Fullerene Warlord

    Joined:
    Aug 26, 2009
    Messages:
    228
    Gender:
    Male
    My point was that ships should have no religion and ship shouldn't be the unit that the religion is attempted to inherit from. The current solution will make ship have a religion if you set in XML ship to be free unit in game start. I guess I could make a check that only units able to found a settlement can get a religion promotion. But are all "human" units able to found settlement?

    How about the list would only contain the religions of your noblemen? They are the ruling class of your society anyway. If you have no noblemen you can't convert to state religion.

    Or maybe the priests spread their religion if it is also a state religion. Or is that what you meant? If you have no state religion or you run religious tolerance civic, then even non state religions are spreading.

    I think missionaries should produce convert of their religion. But you should only be able to create missionary of your state religion units. And when you have state religion the immigrating missionaries are always your state religion. Or does the missionary unit get deleted when founding a mission? Then you can't track the religion of the missionary without further coding.
     
  2. Lib.Spi't

    Lib.Spi't Overlord of the Wasteland

    Joined:
    Feb 12, 2009
    Messages:
    3,707
    Location:
    UK
    With the immigration screens, I always thought it would be cool to increase the difference of recruits between screens, so for example the spice rote could have things like muslim scholars and jewish rabbis who have a speciliasm of wnatever, but of course have their respective religions, so you can getg high skilled people at the cost of introducing foreign religions, etc.

    The silk road could have various kinds of asian specialists who bring asian religions to further mess up your unified lands! :D

    These specialists could then be cheaper or better than the european specialists
     
  3. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,354
    We may consider immigration from all screens. Each cross then goes to one trade screen and which one is picked at random where the chance for each depends on where you trade. Maybe 1000 crosses gives you X units if you trade on one screen, but more than X if you spread across multiple screens. Also screens can have increased/decreased chance of delivering different experts. Each trade screen could have a score for each faction. This score is used to pick faction of the new unit. Cross cost of a unit then depends on how compatible your civ population/state faction is with the faction in question. Muslim civs will then get immigration from muslim trade screens while Christian civs will get just a few units from there.

    We have lots of options to make trade screens more interesting but I would like to get the basics going first.
     
  4. Daw

    Daw Emperor

    Joined:
    Sep 30, 2013
    Messages:
    1,782
    I thought the debate on that was over at the conclusion that 'yes, it should', and some ways of doing so suggested, and I was enormously pleased over that.

    Depends on the game timeframe. Speaking of medieval times, the vehicles were quite similar, I think. So it should be the pilot who belongs to a faction. That is, if the pilot exists.

    Spoiler :
    Yes, but unless we are going to have war dogs (and quite useless ones for the reasons you just outlined) it actually does not matter that much in terms of the game, does it?

    Special models to tell a "Panther" from a "T-34" - of course. Different fuel to consume - would be nice if possible. But I am not sure if a faction is a good solution for that.

    Actually, I have gathered a lot of thoughts on the USSR thing, just give me some time to sort of organize them, and I'll be able to offer a more or less structured concept for discussion.


    If the pilot does not exist, I quite support the Fullerene's idea:

    As for the:

    As far as I could see from UnitInfos, only Braves, Pedlers and Great Generals can't. The others can. Though I think Slaves should be unable to both found settlements (because they are not free to settle wherever they like) and share their religion (because, hey, who cares about what 'scum' believes in?).

    That is also an idea I support.

    And that is hard to support. Non-state religions still do spread. It's only that it is much harder for them to do so, but yet still possible. Please correct me if I'm wrong here, but I thought many non-catholic branches of Christianity did survive Inquisition and Religious wars, and all sort of unpleasant stuff.

    After all, like Nightinggale pointed out, norse paganism (I would rather call it polytheism though) is still there, although nordic countries have been officially Christian since when? X century? Same thing with Russian polytheism here. People (even considering themselves Christians) do still celebrate pre-Christian holidays (well, mostly being not aware of their cultural origin). Maslenitsa, for instance, which was a solar cult celebration of spring equinox (understood as victory of day over night, light over darkness, life over death, etc.) in pre-Christian times. Orthodox Church moved its timing because it would interfere with the Lent otherwise, but appeared unable to eliminate this celebration from the culture despite several attempts.

    So, official religion does not entirely prevent unofficial ones from spreading.

    I vote 'yes' to both thoughts.

    And I vote 'no' to this one. Because the main notion of a missionary is to spread their religion. And that means bringing it to people who don't share it (regardless of how welcomed that may be). So I think missionaries of all religions must come at all times, driven by their internal urge to bring holy light of their faith to your people. And then it's the player's decision as to what to do with them: kill as they approach, chain and send to mines, welcome in his palace - whatever the player feels like.
     
  5. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,095
    Location:
    Marooned, Y'isrumgone
    In order to Join a Settlement you have to be able to "canFound" so even slaves canFound. I added a tag to the XML for units that are not allowed to found but can still join a settlment: <bPreventFounding>. So, Serfs, Slaves, Slave Soldiers, Cotters, and the Elite Class "children": Pages, Eunuch, and Recruits, can not Found.

    I feel like all these units should have a Religion. The Civics you choose will determine if their Religion is counted or not. Like under Slavery, a Slaves Religion Could be ignored. But, I have plans to add a feature where say under Wage Labor you have a new Command to "Free Slave", and with gold you can Convert the unit to a Free Colonist with a chance to get a Master or Expert. The Unit would keep his Religion.

    I would consider this if not for all the dead noblemen who refused to listen to their peasantry on religious matters;) Its the majority of the little guys that has caused the most trouble religiously quite often.

    Yes, that is what I meant. But...

    This is a valid point. Missionaries could have a subprofession of all Religions and the Unit will only be able to choose his Missionary Religion. So, each Missionary profession will have its Religion Promotion tied to it. What Missionary is going to be an effective Missionary trying to convert people to a Religion he does not believe in?

    We can add reasons for wanting different religions, good and bad effects, perhaps, and then good and bad effects for attempting to create a one Religion State. We can look to history for inspiration.

    Missionary Units are deleted, except when you are under the Ritualistic Decree. Then they are in stasis until they get their first convert. So, we would need to add a new attribute to "missions" or the City actually that denoted what Religion the mission is.

    This is a good idea however...

    ... I agree with Night, lets get the basics going first.

    You will care when there are 100s of screaming disgruntled slaves runing at you:gripe::gripe::gripe::gripe:. Religion is one thing that can help keep slaves content, depending on how well they are treated. Some slaves such as the Mamluks where better off than your average citizen.

    Yes, it would be good to allow this.
     
  6. Daw

    Daw Emperor

    Joined:
    Sep 30, 2013
    Messages:
    1,782
    Sound splendid to me.

    Do I smell the scent of a Holy War here? ;)

    I agree that the majority of the little people did turn the way of history several times. Christianity started as religion of Roman slaves, and look at it now...

    But history knows examples of the opposite as well, when 100s of screaming disgruntled slaves running at their big men ended up as just 'more work for the hangmen':

    - Spartacus' uprising (well, it was not religious, but still impressive 100s of screaming slaves), although went well in the beginning, ended up quite sour;

    - Baptism of Rus (again) was a quite arbitrary decision of Vladimir the Red Sun, and the rest of the Rus was quite surprised to suddenly learn they are all Orthodox from now on. And it took them next 200 years of severely suppressed uprisings to finally more or less get along with that idea. And yet Russia is mainly Orthodox today.

    So, as history knows it both ways, I have decided I'd also be happy either way.
     
  7. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,354
    Kind of off topic for religion, but wouldn't it be better if we split canFound into canFound and canJoin? We will then check canJoin at runtime and only use canFound when it is actually about founding. On XML read we then force canJoin to be true if canFound is set, regardless of XML settings. Alternatively we store the two bools in the same 32 bit int, which mean we can check both in a single cycle, which will remove the performance concern of having multiple bools to check.
     
  8. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,095
    Location:
    Marooned, Y'isrumgone
    Well put. I think we can add Civic Options that will allow the player to decided how he wants to Rule. If say he choices Charter Law, only the Nobles Religions count.

    There are probably several bunches of code tweaks like this that could perhaps boost performance a bit. I'll add this to the BlackBoard as a code tweak. And perhaps when we have a bunch of them we can do them all at once, hows that sound?
     
  9. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,354
    Sounds good to me.
     
  10. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,095
    Location:
    Marooned, Y'isrumgone
    K, I stickied it to the first page of the blackboard. If anymore of these come up that I don't notice, or you think of, please make a post on the blackboard thread to keep us up to date on what needs done.
     
  11. Fullerene

    Fullerene Warlord

    Joined:
    Aug 26, 2009
    Messages:
    228
    Gender:
    Male
    I pushed my work to 'Fullerene' branch.I still don't fee 100% comfortable using git. Could someone check that my push was successful and working.
     
  12. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,095
    Location:
    Marooned, Y'isrumgone
    Could you make a detailed explanation of all your changes and what is suppose to happen? I was able to pull your changes it seems. Waiting on the DLL to rebuild at the moment then I'll check it out some more.

    I did a quick test with Anglo-Saxons. All my guys are Catholic so it seems to be working :) Good Job!
     
  13. Fullerene

    Fullerene Warlord

    Joined:
    Aug 26, 2009
    Messages:
    228
    Gender:
    Male
    My changes add faction (religion in this case) promotions to units.

    Faction Promotions are defined in Civ4PromotionInfos.XML. They must be first on the list and they have <iFaction> tag. <iFaction> defines the faction type. iFaction has default value of 0 (for some reason -1 didn't work) which means it is not a faction promotion. If iFaction > 0 then it is faction promotion and the number defines the faction type class. Currently all faction are type of 1, meaning they are all religions.

    Civ4CivilizationInfos.xml has tag <InitialFactions>. You can define there factions that are given to free units. If 2 or more factions are same type, only 1 is added. (Unit can have only 1 faction of the same type.)

    Main DLL changes:
    My changes are marked as ///Factions ... ///Factions End

    There's GC.getNumFactions() function that tells the number of faction promotions in game. Currently it reads promotions until it reaches non faction promotion. I think there should be variable for number of factions which is stored during XML reading. There also could be function to get number of factions of different type in the future.

    CvUnit::setHasRealPromotion () has check if promotion is faction promotion. If it is then there is check if unit can found( only unit's that can found can have factions). If faction promotion is to be set true, all faction promotions of the same type are cleared from unit first. (Only 1 religion per unit rule.)

    In CvCity::doGrowth() there is code added that gives new born units factions inherited from random parent unit that is member of m_aPopulationUnits.

    In CvPlayer::doImmigrant() a new immigrant unit is given random faction. Currently the code doesn't do check for different faction types. So if you have for example religions and ideologies as different faction types, unit doesn't get both religion and ideology, just random faction that can be any type.

    Not everything is tested through and the DLL changes have room for improvement. But the foundation for religions is there.
     
  14. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,095
    Location:
    Marooned, Y'isrumgone
    Awesome, Fullerene!

    We should tie Civics into Factions now, where the Civic type sets the Faction instead of number values. To do this we could create the Faction type as such below, placing it after MEDIEVAL_TECH. Python has the GlobalEffectTypes (this is what I am calling them even though there isn't an actual "type" yet) hardcoded so we can't change the order of the first types.

    Code:
    <CivicInfo>
    	<CivicOptionType>NONE</CivicOptionType>
    	<Type>GLOBAL_EFFECT_RELIGION</Type>
    	<Description>Religion</Description>
    	<Civilopedia>TXT_KEY_NEED_DESCRIPTION</Civilopedia>
    	<Strategy>TXT_KEY_NEED_DESCRIPTION</Strategy>
    Then for the Medieval Religions we add for example(not complete code):

    Code:
    <CivicInfo>
    	<CivicOptionType>NONE</CivicOptionType>
    	<Type>RELIGION_CATHOLIC</Type>
    	<Description>Catholic</Description>
    	<Civilopedia>TXT_KEY_NEED_DESCRIPTION</Civilopedia>
    	<Strategy>TXT_KEY_NEED_DESCRIPTION</Strategy>
    	<Button>Art/Buttons/Tech_Categorys/NativeCat.dds</Button>
            <iAIWeight>0</iAIWeight>
            [COLOR="DarkRed"]<InventionCategory>GLOBAL_EFFECT_RELIGION</InventionCategory>[/COLOR]
            <AllowsUnitClasses/>
            <AllowsPromotions>
              <AllowsPromotion>
                <PromotionType>UNIT_RELIGION_CATHOLIC</PromotionType>
                <iChange>1</iChange>
              </AllowsPromotion>
            </AllowsPromotions>
    Religions can then be unlocked by Techs. Then in Civilizations we give an Initial GLOBAL_EFFECT_RELIGION instead of promotions, such as RELIGION_CATHOLIC. So, Civilizations would have RELIGION_CATHOLIC for <InitialUnitFaction>.

    We also need a way to Choose Religion. Perhaps we add an Icon to the Screen that brings up a Popup where you can choose a State Religion. The Icon can be that of the Selected Religion. Only those Religions present in your Civ are allowed. Perhaps too, Religions are "discovered" when a Unit baring that Religion arrives to your Realm. This would require a CvPlayer global array that keeps track of what Religions have entered your Realm. Then when you click the Religion Icon it cycles through this array for available Religions.

    There should be a delay between Changing religions, like 10 turns, and perhaps it causes Anarchy. Perhaps each City has a chance based on factors such as how many Units are not of that Religion, how many units are present of the previous Religion (those will really be ticked off), and number of Military units Garrisoned there.

    That's my initial thoughts on this so far, not certain of best way to code it.
     
  15. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,354
    That question is a symptom of a problem I have been meaning to bring up anyway at some point. It might as well be now.

    The commit message is meant to answer this question. When we read the log in 4 months due to bug hunting, nobody will remember what "Factions DLL" was. Ok, maybe we have an idea, but if we end up having 20+ faction commits, we will need to tell them apart.

    Rather than writing a lengthy reply I decided on adding a few links.
    http://www.slideshare.net/TarinGamberini/commit-messages-goodpractices
    http://who-t.blogspot.de/2009/12/on-commit-messages.html
    https://wiki.openstack.org/wiki/GitCommitMessages

    We will benefit a lot later on if we improve our commit messages.


    I have no comments on the faction update itself yet. I plan to review it when I'm done reviewing the broken code Kailric committed :p
    It turned out to be more complex to solve than I thought. It crashes in the exe as a result of some vanilla code in a file Kailric didn't touch, yet it's Kailric's new code, which triggers a chain of events to make it crash :crazyeye:
     
  16. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,354
    I looked at the faction code. Generally it looks fine. I haven't spotted poorly written code or bugs.

    Code:
    pXML->GetChildXmlValByName(&m_iFaction, "iFaction"[COLOR="Red"], -1[/COLOR]);
    You can set the default value as the third argument. If you don't, then it defaults to 0.

    I don't really have anything else to add at the moment, which I guess is a good thing ;)
     
  17. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,095
    Location:
    Marooned, Y'isrumgone
    Ha ha, I never claimed to be good at arrays and saved game stuff. But, to keep on the topic of Religion, we do have a Delayed Response working now. So, when a Civ demands you to adapt their Religion you can Say, "Let me consult my advisors". Then you can look over all the factors involved in a switch. The turn can not end while you have Diplomacy Responses waiting, nor will the end turn button flash red.
     
  18. Fullerene

    Fullerene Warlord

    Joined:
    Aug 26, 2009
    Messages:
    228
    Gender:
    Male
    Well, I could try to work on this again, been few months. Next step would be to implement what you described on post 54. Is this all still valid, or should we try to update/merge my branch into master or develop branch first?
     
  19. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,095
    Location:
    Marooned, Y'isrumgone
    You can continue development on this in your own branch, so by all means continue to do so:goodjob: This one change will work well with many of the current features as well as planned stuff so I am looking forward to it. :D
     

Share This Page