We-the-People-civ4col-mod / Mod

This is the repository where the mod resides.
89 stars 37 forks source link

Make units be convertable to a profession, also if they are not inside a city. #149

Open ShadesOT opened 6 years ago

ShadesOT commented 6 years ago

Ever sent a missionary to a distant native village just to discover, that that missionary is assigned the normal settler profession and not the missionary profession? I believe, you know what I mean with this issue.

Nightinggale commented 6 years ago

I agree with the problem, but I'm not sure about the solution. How about making it more clear while profession the unit has? Something like taking the profession button and print it on the screen with text next to it. That way it will be much easier to see which profession a unit has. Currently it's not clearly visible on the map if an expert missionary is a missionary profession or no profession.

abmpicoli commented 6 years ago

I think that the problem is that the missionary colonist, and the missionary with the missionary profession are sort of alike... And I really can't see why it is not possible to try to establish a mission with a common colonist, if all that is needed to establish a mission is to change the profession at city screen....

This would also allow many interesting things: I have an indentured servant working as a pioneer , 3 tiles away from the city , and I just got a petty criminal and I would like to place it as a pioneer instead of the servant. I will have to interrupt whatever the pioneer is doing, move it to the nearest city, turn it to a colonist, turn the criminal into a pioneer, and move the criminal back into the plot where the pioneer was... a potential 6 turns lost...

ShadesOT commented 5 years ago

TBH my initial explanation of this issue was not a good one, because I did not just mean missionaries, but why the restricition, which has no apparent value or justification is there at all.

The question is, why the restriction, to allow assignment of profession within cities only, was there in the first place.

The only answer I found is, that it makes sense for all professions except for the missionary profession. The missionary just had to follow within the boundries of the framework set by the code made for all the other professions. What I mean by that is: All units except the missionary need equipment to be assigned to their professions OR they follow their professions inside a city. So for all the units except the missionary it makes perfect sense that they get assigned and reassigned their professions just and only inside a city, because cities are the only place where they can mount and release their equipment, if they need some. And if they don't need equipment for their profession, they will work in the city anyways. Except for the missionary profession, which did not get its own code, I assume, and thus was forced to the restrictions carefully implemented for the other professions.

Nightinggale commented 5 years ago

Isn't there the restriction that missionaries require a certain level of church, like they are commissioned by the church and not just being some self proclaimed "holy people".

ShadesOT commented 5 years ago

What I am suggesting is a XML flag, attached to a profession, which says where this profession can be assigned. This would make the mod more generic and modders would have more options.

ShadesOT commented 5 years ago

Isn't there the restriction that missionaries require a certain level of church. ...

I am not sure if I understand this question right ... there are of course the jesuit missionary units and all the other units, which both can be assigned the missionary profession. Jesuit missionaries have a higher chance of success for their actions (eg founding a mission in a native village).

Nightinggale commented 5 years ago

No I mean can you make missionaries right away or do you need to build a church first. If not, then wouldn't that make sense. Missionaries aren't something, which decide one day to work as missionaries. Instead they are/were commissioned by the church. Even 1000 years before Columbus the monasteries wrote about dispatching missionaries and how it was organized with educating/advising the future missionaries. Getting more people to the chosen faith was serious business. In fact it was business because followers of the church paid the church. The main reason why Protestantism grew up was the fact that the church collected money and downright issued taxes.

ShadesOT commented 5 years ago

I mean can you make missionaries right away or do you need to build a church first.

The is no requirement for a city building to commission a missionary. Playtested.

ShadesOT commented 5 years ago

Makes sense to me, because there were enough self proclaimed holy people.

Though, what you wrote about getting paid by the church, makes sense in terms of history. To me this could be a part of a bigger and deeper game mechanic, like religious motivated factions and wars.

Nightinggale commented 5 years ago

During the 16th century, some European kings tried to get rich by controlling the world. We all know they went to the new world, but they also went east. Japan is interesting because unlike the natives in America, the Japanese wrote what happened when they were exposed to the "new world conquest tactics" done primarily by Spain and Portugal. The Japanese writings have been preserved and so have some rather significant Portuguese documents meaning we have events told from both sides.

Ultra short told from memory. The king of Portugal learned that there was a very rich land. Portugal followed the right faith and they didn't meaning Portugal had some holy right to control this new land and take the wealth from them (a Portuguese document actually says something like that). It should be easy to gain control because the land consisted of a lot of countries and they had lots of internal wars. However gaining control wasn't easy:

While the Portuguese wrote this, it's confirmed from Japan. It looks like using every single solder from all European countries combined wouldn't be enough to conquer Japan. No western country ever attacked Japan with military before WW2. Direct attack was just not an option.

Instead the king sent missionaries. They were told to convert the general population and making Portugal a proxy for the holy land, converts would follow orders and eventually pay taxes. At least that was the plan. It looks like Spain had the same idea, though AFAIK they haven't actually preserved their documents to confirm this was their thinking.

The Europeans sold muskets and cannons, but only to countries who converted. Being at war, this was very tempting and it lured in some of the countries. The plan worked and they gained more and more converts. It also made the countries even more hostile towards each other because those who refused to convert realized the religious threat, meaning they had even more internal wars. However something unexpected happened. A small and insignificant country called Owari was in on the European hype. Their leader called Oda Nobunaga went European crazy and wanted all the European items he could get, be it useful or just different. He bought lots of muskets and cannons. He developed new tactics and expanded quickly, gaining control of half of Japan or something like that, if not more. Then he was murdered by his retainer, who himself was killed days later. Another retainer called Tomotoya Hideyoshi then became leader. He is the guy famous for building a castle in one night and apparently he did so. At least something spectacular happened because he conquered the unconquerable Gifu castle.

During Hideyoshi's reign, it became relatively peaceful considering it was the sengoku era (aka the warring states era). However now there was a new problem. Converts had started to walk up to people and ask them to convert and if they refused, they killed them. After all denying God was punishable by death. They also destroyed Buddhists temples. To restore public order, Hideyoshi expelled all missionaries.

Hideyoshi died of old age. Oda Nobunaga's third retainer (he had three) decided now was the time to step in and take power. His name was Tokugawa Ieyasu. After another two years of war, he had conquered all of Japan and unified it into one country. He then used the army to clear out bandits and suddenly travel became safe and civilian prosperity flourished. A few years later disaster stroke. Converts decided to take control of a castle and then declare independence and make a Christian state, which essentially would be a colony of Portugal. While they were no match for the army, it became clear that the converts would prevent a peaceful life of the common people. As a result a few new laws came quickly. Being Christian was punishable by death. No foreigners were allowed into the country (one Dutch trading post excepted). Japan left the world for 250 years and didn't open up until the Americans arrived in steam ships in the 1850s.

In the mid 18th century, Portugal was hit by a major earthquake. Lisbon was destroyed and the many fireplaces started fires. People started putting out the fires, but groups of Jesuits started walking around the streets with holy relics and forced everybody to kiss them. If people were putting out fires, they were killed. After all the earthquake was God's will, meaning the resulting fires were God's will. Anybody putting out fires were working against God. Portugal banned Jesuitism after that and all the Jesuits moved to South America. The reason I mention it here is because all the missionaries sent to Japan were Jesuits. Not the Catholics, just Jesuits. They could get the job done and apparently they were good at making internal unrest.

So yes religion and missions played a major role in real world history in the 16th and 17th centuries. The likely tried similar stuff in America, but the natives didn't write it down, meaning their acts are lost to history.

devolution79 commented 5 years ago

I understand that this issue is about convenience, but this comes close to just opening up the WB, then replacing the non-missionary with a missionary. Arguably, becoming a missionary should require a church building or something similar.

Nightinggale commented 5 years ago

I would say we should add an array of building classes to profession infos. Unless the array is empty, a unit can only switch to the profession if standing on a plot with a colony with one of the building classes. Implementing the feature this generic rather than tailoring it to missionaries could come in handy the next time we need a building for a profession. Besides I don't think there is a big difference in coding time/difficulty.

Actual implementation would be something like InfoArray from the CivEffect branch or #128. Maybe maintain a bool array of building classes present in CvCity if it's not easily available already. This should allow very fast checks and prevent this from slowing down the AI when looping professions inside unit loops.

abmpicoli commented 5 years ago

Isn't there the restriction that missionaries require a certain level of church, like they are commissioned by the church and not just being some self proclaimed "holy people".

There isn't, you can make missionaries at any city, with or without a church... It is a good use for criminals (!??), that can become a missionary with the same abilities as an indentured servant or free colonist....

ShadesOT commented 5 years ago

I understand that this issue is about convenience, but this comes close to just opening up the WB, then replacing the non-missionary with a missionary.

Ok, but that is nothing I want to need to have to do if I play my game. :-)

Arguably, becoming a missionary should require a church building or something similar.

I would say we should add an array of building classes to profession infos. Unless the array is empty, a unit can only switch to the profession if standing on a plot with a colony with one of the building classes.

Actually, I kind of get to like this idea.

Implementing the feature this generic rather than tailoring it to missionaries

Yes, the missionary is just the one example we currently have in the game.

Actual implementation would be something like InfoArray from the CivEffect branch or #128. Maybe maintain a bool array of building classes present in CvCity if it's not easily available already.

Let's make it even more generic and add the possibility to make assignment to professions dependable on N different buildings in the city.

There is another important perspective on the topic, namely the AI. Can the AI handle this game mechanic? Does it make calculations on the need for a certain profession at all? Will the need for a certain profession affect its building queue, if it needs to meet the building requirements for this profession? I think unless Erik pulls several hundred lines of more code from his sleeve instantly, the answer to this currently is no. Which leads to the next question of how we make the AI cheat regarding this topic. The thing that comes to my mind first, is this (principally, not related to actual xml tag names):

<profession>
    <name>xyz</name>
    <buildingRequirements>
        <buildingRequirementsHuman>
            <buildingRequirement building="buildingA" />
            <buildingRequirement building="buildingB" />
        </buildingRequirementsHuman>
        <buildingRequirementsAI>
            <buildingRequirement building="buildingA" />
        </buildingRequirementsAI>
    </buildingRequirements>
</profession>

This does not catch it all though - or might not catch it all, if we want the extent of the AI cheat to be affected by the games difficulty level (human players handicap level). But something along these lines.

It is a good use for criminals (!??), that can become a missionary with the same abilities as an indentured servant or free colonist

Criminals as missionaries, ... that would catch the hypocrisy observable throughout history ;-)