Religion

I'm working on develop branch.

Ah nice, has Night given you write permissions? This may should be a branch of its own so we don't have conflicts and I can swap to religion branch and help you test things out while keeping my progress intact.

Are you using SmartGit?

EDIT: perhaps Nationality could also be a "faction", I didn't realize you was the one who worked on that mod.
 
Calm down, calm down:D People may not realize that Nordic (or however you best describe it) is actually a real religion. I have friends that pray to and worship the Nordic gods even today.
It has been an official religion since dawn of time (or at least since the vikings started writing) and while it have had some hard times, it has never been completely gone.

There is this great story from Iceland from the 70s. People were sitting in a bar and getting drunk. One guy claimed to be a "norse priest" and yeah right, it was a drunk man saying silly stuff. One man fetched the nearest woman and said that they wanted to be married the viking way. They then had a great evening in the bar holding a real viking wedding. I assume they thought it was less fun when the next tax reports mentioned "spouse's income" :lol:
The thing is the viking era ended when the pope declared pagans to be outlaws and that the normal rules of declaring war and all that didn't apply to them. Essentially he gave the entire Europe permission to plunder vikings. This is when the Danish king placed a runestone proclaiming Denmark to be a Christian country. Iceland did the same. Today it looks like it was more a political move than a religious move. Iceland never actually told the population what to believe and there has been an uninterrupted legal ability to be wedded and such using norse traditions.

It's not like Scandinavia totally forgot about those times either. The Swedish icebreakers are all named after Norse gods, which is why the only diesel icebreaker ever to reach the north pole is called Woden (that god is better know as Odin). I came across photos of old ships a while ago where I saw that the same is true for Denmark. In 1890 they built two icebreakers called Thor and Mjölnir.

It's a full blown religion and AFAIK it is even an official religion in all of Scandinavia now (there are tax rules for approved religions and such). I have no idea about the number of worshippers and how many are that for fun and how many are actually religious.

We should set up like what we have with Civics in that we can have several types of "faction" promotions. Perhaps we need to create "faction" types, like how there are FF types, but they are actually Civilization Traits. Each faction can have attributes like how many are allowed on each player, which would be 1 in the case of religion, and perhaps information like how the faction spreads.
I already said that it will pick a random religion based on population when making a new unit. We could make each unit with state religion count twice or something.

Sure we could make a new XML, but wouldn't it be better to add them to civics? We can then somehow link civics and promotions. Using civics and promotions, we can make one mod use a certain feature for inventions while another use it for religion and we will truly have a setup where the XML modders are free to use the features as they like. We can already allow promotions with civics. It is quite possible that we can use that feature here with interesting results and very little coding.

I haven't considered the option of changing religion for a unit or player, but using promotions and civics, that shouldn't be hard to do from a coding perspective.

I was simply talking that gameplay wise they don't have religion, thinking of civ4 style. Of course we can add 'pagan' religion too, maybe even all the different pagan religions, why not. It's just might be overkill.
I'm not too sure about that. Norse mythology really stands out and justifies a promotion of its own. Besides just having a promotion with no real effect apart from an icon appearing could be acceptable as well.

Unless you have a solution ready in your head, I'd like to try myself. You can give advises of course.
I have no plans other than what I already mentioned in this thread, though we are still at step 1: agreeing on what the goal is. Coding before finishing this step is likely not the best idea.
 
I'm not too sure about that. Norse mythology really stands out and justifies a promotion of its own. Besides just having a promotion with no real effect apart from an icon appearing could be acceptable as well.

I have no plans other than what I already mentioned in this thread, though we are still at step 1: agreeing on what the goal is. Coding before finishing this step is likely not the best idea.

This sounds like a good stating plan and a goal to me. Just getting Religion to the units, then we can decide what the religion does.

Immigrants, Population Units, and Converts all need religion.

It makes since to add them to Civics, but do we try to make religions different? I liked the devs of Civ4's approach in that all religions had the same effect. That way we don't get accused of religious persecution :)
 
It makes since to add them to Civics, but do we try to make religions different? I liked the devs of Civ4's approach in that all religions had the same effect. That way we don't get accused of religious persecution :)
Remember this is factions, not just religion. I agree that while making religions act differently would be interesting for gameplay, it can easily bring sideeffects that I don't want to deal with.

With out without making factions acting differently, it would make sense to make them civics as we have most of the code present already. For instance we would not need new code regarding savegames as that part of the code will detect longer arrays and save those.

We could make religions do something while they are kept identical. For instance we have features, which only applies when unit and plot have same owner. We could have something like that where they apply if unit and plot owner share faction or if they defend against a unit from a different faction or stuff like that.

For instance if two civs with the same religion allies and they defend against a common enemy, they both get defense bonus when defending against invading forces of a different religion. After all they defend their common faith rather than individual countries.
 
So then I guess the goal would be to make two or three default 'effect states' something like 'Religious Unity', 'Religious Tolerance', and perhaps for want of a better word 'No Religion'.

Religious unity: is about making everyone in your empire 'your religion' everyone of your religion gets a benefit (like combat strength or production bonus) a bit like fealty is and everyone who is not your religion gets a negative.

Religious Tolerance: Is about promoting harmony between the religious groups in your empire and maintaining balance so perhaps some kind of percentage bonus that increases the closer you are to religious equilibrium.

No Religion: Generally less of a bonus as religion is not a part of life, but perhaps the benefit is that you are more immune to 'papal' control and things like inventors are better, but of course your general religious productions like monasteries and churchs are less productive,so it represents a shift in power, making you more immune to papal intrusion, but you have to shift your emphasisaway from 'easier' religious production.

So religion acts as a unifier or deunifier, but has no 'unique' effect. It also gives the possibility to unlock 'holy warriors' for your chosen religion. Crusaders, Jihadists, Berserkers, etc.
 
This sounds like a good stating plan and a goal to me. Just getting Religion to the units, then we can decide what the religion does.

Immigrants, Population Units, and Converts all need religion.

It makes since to add them to Civics, but do we try to make religions different? I liked the devs of Civ4's approach in that all religions had the same effect. That way we don't get accused of religious persecution

In real terms being a certain religion might have a modest gameplay effect (sociologists do say that Protestant work ethic might have some economic effect, perhaps causing slightly higher yield production and/or slightly lower yield demands for units with that promo; Muslim units might get some slight bonus from Jihad fervor when fighting units that aren't Muslim, etc etc.) But it would also seem realistic to let religion promos have very modest or no direct effects seeing that they don't truly cause people to be essentially different, just make them get along with one another less:viking::p. But in other mods Race or Ideology might have a big effect on units having that promotion.

I also like your idea of having the possibility open to add some other types of Faction Promotion, not needing to totally revolve around religion. In many other games like Crusader Kings series they keep track of language/culture identity (eg Occitan, Basque, Norman, West Germanic, etc) which was often just as important as religion. Being able to have one to two types of these kind of categories would be interesting, though we would not want to go overboard in having numerous kinds of this in any given mod.

Maybe a more significant could come from interaction between what the majority of your citizens currently have and what Civic you chose. Ie Civics could be set up to apply a bonus to all units having a certain Favored Faction Promotion matching that civic, or apply a penalty to all units not having that Faction Promotion. When new units are born, your civic choice could have a factor iFavoredGrowthWeighting causing new population born in your cities to be weighted more likely to be of the faction you are favoring. In this way if you conquer a bunch of Muslim lands and choose a Civic that instead favors your own Catholic faction oppressively, you can get penalties causing somewhat less production of yields/fealty/crosses etc from oppressed citizens, but it will also become more likely for new population to come from your favored faction which you can use to gradually assimilate the lands under your control.:king:
 
Still have to ensure in the SDK that unit can have only one religion promotion at time.

My solution is to clear all faction promotions before setting new faction promotion to be true in CvUnit::setHasRealPromotion. There might be better ways to solve this though. Haven't yet tested it since there isn't yet situation where faction does change.

My plan/ to do list:
  1. Set each civilization a starting religion
  2. Initial units follow the starting religion
  3. Born units get religion based on religions of the city population
  4. Immigrants get random religion, maybe weighted somehow
Sounds ok?
 
My solution is to clear all faction promotions before setting new faction promotion to be true in CvUnit::setHasRealPromotion. There might be better ways to solve this though. Haven't yet tested it since there isn't yet situation where faction does change.

My plan/ to do list:
  1. Set each civilization a starting religion
  2. Initial units follow the starting religion
  3. Born units get religion based on religions of the city population
  4. Immigrants get random religion, maybe weighted somehow
Sounds ok?

Make sure starting religion can be NULL for mods like World History where you may start with nothing.

But yeah, that sounds like a good starting foundation.
 
Sounds fine to me. There are two details you haven't mentioned.
  1. how to set the religion of a civ in XML
  2. how the game knows which promotions to pick from when generating a new unit with a random religion

  1. Probably just add a new XML tag "Default Faction" for Civilizations.xml
  2. I have added <bFaction> tag to Faction promotions
Hmmm the <bFaction> could be int too, so that would allow different faction types, like you mentioned earlier.

Make sure starting religion can be NULL for mods like World History where you may start with nothing.

Sure, although for WHM there could be default religions like Shamanism or Animism.
 
Yeah I think having the NULL is a good plan for the USM (Universal Source Mod) just because... because :D
The goal of the source code is to make generic coding. This mean that even though we code a feature and have plans for it for a specific mod or all currently developed mods, we should consider how the code acts if a later XML modder in a later mod do not want this feature.

A way to do this in the specific case is to make faction -1 default and not having any faction promotions. All the code added now should then be ignored in this case. It's a lot easier to implement this case now than it is to add it later.

Say we have GC.getNumFactions(), which returns the number of faction promotions (calculated on XML load). During new unit creation, it should get a faction promotion, but if this function returns 0, nothing happens.
 
There's one problem with presenting different factions as promotions. Religions and ideologies can be easily presented with symbols, but presenting things like nationality or language with symbol can be more challenging. OK, maybe you can use flags but it can be confusing sometimes. Using plain text would be better in my opinion.

Anyway, I'm trying to code it so that the code allows different faction categories.
 
Ah nice, has Night given you write permissions? This may should be a branch of its own so we don't have conflicts and I can swap to religion branch and help you test things out while keeping my progress intact.

Are you using SmartGit?

EDIT: perhaps Nationality could also be a "faction", I didn't realize you was the one who worked on that mod.

Yes, I'm using SmartGit and I have no idea if I have write permissions yet. Would be nice to have own branch, yes. So I can be sure I don't cause damage to your code.

Nationality could be faction, but it has the visual presentation problem I mentioned in post above.
 
Can you let it show a tooltip with the text name and game effects of each promotion when moving the mouse pointer over the "badge" icon for that promotion? I think that would be fine, but if you want to visually set apart FactionPromotions from regular promotions, it should also be possible to display them differently though this would require Python changes.
 
Yes, I'm using SmartGit and I have no idea if I have write permissions yet. Would be nice to have own branch, yes. So I can be sure I don't cause damage to your code.

Nationality could be faction, but it has the visual presentation problem I mentioned in post above.

I wrote a few help hints to Daw in these two posts on using SmartGit


http://forums.civfanatics.com/showpost.php?p=13281326&postcount=224
http://forums.civfanatics.com/showpost.php?p=13281106&postcount=215
 
  1. Set each civilization a starting religion
  2. Initial units follow the starting religion
  3. Born units get religion based on religions of the city population
  4. Immigrants get random religion, maybe weighted somehow

Achieved these goals.
You can now set initial factions for civilizations in xml. If factions are same type only one is added for initial units.But it's possible to have for example initial religion and initial race.
Unit born in city inherits faction(s) from random parent unit in the city. This is both quite realistic and simple to program.
For immigrants I simply gave random faction. I think this requires more work but it's good enough for a start.
For the proof that I'm not lying, attached picture shows units with 2 religions. This was done just for to test the different faction types and normally unit can only have 1 religion.

edit:
I wonder if CvCity::m_aPopulationUnits ever includes things like catapults or ships? Unit obviously shouldn't attempt to inherit the religion of the ship :)
 

Attachments

  • religions.jpg
    religions.jpg
    86.6 KB · Views: 68
Nice. Population units must be able to Found a settlement, so you are good there. We will need a way for the Player to choose his Religion. Civ4 had a whole python interface screen setup, but do we need that? We could just have an Icon on the Screen that Shows your Religion. You click that and it brings up a list of possible Religions for you to choose. Even though it can be any Faction, I'll just call it a Religion since that is what we are using it for in this writing.

Are "Religions" only represented with Promotions in your work so far? I guess we can make them Civics, with the Religion Promotion tied to the Civic. When you click the Religion Icon it brings up a list of possible Religions, based on what Religions are in your Empire. We could have a variable that keep tracks of the Number of Followers for each Religion in your Realm.

We also need a way to Spread Religion. People you set to work as Priests could spread their Religion in that City to get Converts to your State Religion. Each Religion could have a SpecialBuildingType tied to it as well. These buildings Spread the Religion when people work their. It could work similar to Schools and Education. When a Unit has accumulated enough Conversion Points they Convert to the State Religion. Each Religion could have a setting for Conversion Probability, if 100% chance they accumulate the max Conversion Points each turn. If 50% it would represent a Religion that is much harder to Convert.

With Religion being CivicTypes we can have different Effects set up, or they can just be all the same Effect.

We would need to tie this into the Civics Screen as well, in M:C we call them Decrees. Missionaries would Convert villagers to your State Religion, unless you was under the Religions Tolerance Decree, then your Missionaries would produce a Random Religious Convert. We would need to come up with other effects the Piety CivicOptionTypes would have.
 
edit:
I wonder if CvCity::m_aPopulationUnits ever includes things like catapults or ships? Unit obviously shouldn't attempt to inherit the religion of the ship :)

Well if you asked me, I 'd say I don't mind that. Here's the point:

If we are talking about catapults or ships as such, they should rather have no religion at all (because they are all wooden), so that the newborns have nothing to inherit from them.

But if we are talking about ships imaginary crews and catapults imaginary regiments - they of course may and shall have religion. But then the newborns should be welcome to inherit it.

The other way of managing it may be that newborns are allowed to inherit religions only from those working in the city (those counted as the population), not from those garrisoned in the city tile. This would effectively sign catapults, ships, chariots, battle elephants and other military stuff whatsoever off the list.
 
But if we are talking about ships imaginary crews and catapults imaginary regiments - they of course may and shall have religion. But then the newborns should be welcome to inherit it.
And then we are back to debating if mechanical units would need a pilot and if the vehicle or pilot should have the faction.

Thinking of the USSR mod, wouldn't it make sense to have factions for vehicles? Think of "attack tank" with Russian or German faction promotion. There are individual models, but the tanks from each side shared certain aspects. For instance USSR would attack the weak armor, which is from below and they trained dogs to hide under tanks. They then attached bombs to the back of the dogs. On the battlefield, the faction of tanks turned out to play a role the Russians overlooked. They trained on Russian diesel powered tanks and the Germans came with petrol powered tanks. The dogs aimed strait for the smell of diesel because they were trained with diesel powered tanks. Faction differences in mechanical units could play a bigger role than meets the eye at first glance.
 
Top Bottom