New Diplomacy Options

Yeah, it is intriguing and looks fun if you can take the time to figure it all out. There are those tons of DLC as well, that I will stay far away form until I learn the basics. That what if Aztecs sounds so Cool and would be a neat alternative scenario for M:C. It was mainly four things that conquered the Aztecs: their silly mystic labeling of the Europeans, gun powder, internal political struggles and eventually deceases. They had the manpower a million times over. If they would have discovered Europe first it could have very well went the other way. Europeans where already accustomed to "foreigners" and had immunity to certain deceases so it wouldn't have been so easy for Americans.
 
Yeah they arrive on the western shore of europe in massive numbers...it was terrifying!
Europe has been quite lucky in being well defended by terrain. Europe wouldn't be able to win an all out war, but the enemy armies were unable to arrive in Europe due to either oceans or mountains/deserts. Around year 0, the Roman army for the entire Great Britain was 11k men, which for Europe at that time was quite a decent sized army. Around the same time China merged from 7 countries into a single one. This was settled with an epic battle with half a million soldiers on each side. Imagine if such an army marched to Europe :crazyeye:
Well they were unable to pass the Gobi desert, which pretty much makes it perhaps the most important desert in world history.

China went to the sea and explored prior to Europe and launched an expedition 80 years prior to Columbus, which has become known as the treasure fleet. They were supposed to trade as well as eliminate pirates, which mean they wanted huge cargo hulls, but at the same time use warships. They ended up with 10 ships using a bulkhead technology, which made them strong and at the same time safe as it could flood 2 out of 7 compartments and still carry on without sinking. We know they killed pirates and they travelled far, but how far is disputed. There are indications that they made it as far as South Africa.

Here is a picture of one of the ships compared to Santa Maria (Columbus' flag ship). Imagine if a fleet like that had attacked Europe.
Spoiler :
Field_Notes-1.jpg
 
Yeah the thing that really doomed China was when a particular emperor (can't remember his name) decided to make it illegal to leave china, and set the culture on an isolationist path, as well as rigid conformity that blocked any innovation, right on the cusp of china being ready to dominate the globe...
 
Yeah the thing that really doomed China was when a particular emperor (can't remember his name) decided to make it illegal to leave china, and set the culture on an isolationist path, as well as rigid conformity that blocked any innovation, right on the cusp of china being ready to dominate the globe...
I don't remember his name either, but we should be able to look it up if we really want it. He came to power in the 1420's where he destroyed the treasure fleet as soon as he was able to do so. I recall something about China having only a single new emperor in the 1420's meaning it shouldn't be that hard to identify this guy.

Oh btw China also sailed for America to see what land lies on the other side. They came an estimated 90% to America where they decided that their food supplies told them to turn around and head home. The ocean might be endless. Some people do believe that they made it all the way, but then didn't return to China for various reasons and they examine whenever somebody finds a wrecked Chinese ship on the US west coast. So far all ships with a positive age identification have been 19th century ships though, but quite a number of them are still undated.
 
Well, the name of the Fleet Commander was Zheng He and he is one of M:C's FFs, he was also a eunuch. I actually have a pedia write up on him in the game, one of the few.

According to my research it was Hongxi Emperor, Zhu Gaozhi that started shutting down the expeditions. He came to power after his father the Yongle Emperor, Zhu Di died. Zhu Di's gandson Xuande sent out one last voyage but after that the next Emperors went back to isolationism it seems.
 
I'm adding in three new Diplomacies: Hunting Rights, Contact Info, and Imperial Support. I need to do Imperial Support for the victory condition and it is easier to add in more all at once. Hunting Rights will let your Hunters venture onto Foreign Lands, even without Open Borders. And we can prevent native Players from Hunting on your lands as well. Perhaps Hunting Rights are all turned on for Natives and then you can Declare to a Native Player that you no longer will allow them to Hunt on your lands. Other Players will naturally not be allowed to move on to your borders. Even if you do have Open Borders, that doesn't mean you get to Hunt.
 
I've updated this first post to show the new Diplomacies. We now have options to trade Hunting Rights, this allows hunters to cross borders and also we can Trade Contacts.

I need to add in a Diplomacy option to deny Natives from hunting on your lands. This won't make them happy.

And I am working on the Imperial Support Victory diplomacy at the moment.
 
I pushed the first stage changes for the new diplomacy options.

Trade Contacts seems to be working as intended. Right now the AI values contacts the same as they value Maps, but perhaps depending on the Contact's trade potential with the Player this could be increased.

Trade Hunting Rights just needs to be added to the Diplomacy Screen so you can keep track of what Civs you have Hunting Rights with.

Trade Imperial Support is still a work in progress. I had to do a bunch of trail and error to finally figure out how to make none dual, none annual trades appear on the Diplomacy Screen. They actually had one line of text that I finally read that gave me a hint on how to do this, pretty simple once I figure that out. After a Player accepts to support you, you can see that trade agreement in the Diplomacy Screen with connecting lines in purple (I change Trade Relations to Brown).

I still haven't fully decided on the requirements for Imperial Support and what the effects are, at the moment you just get texts saying you are Supported.

What should the Requirements Be? Perhaps...

Trade Relation with other Player: Makes sense that you have some type of good relations going
Fealty at 50%: At least half your people should support you
Their Attitude: They have to like you

Other Requirement ideas...
Defensive Pact: Should Emperor provide the other Player Help, or should the other Player have to Fight for the Emperor, or Both
Open Borders: Is the Emperor allowed to walk freely on the other player's land

If all these things are required it would really take some Diplomatic skills to gain someone's Support.

Should Supporting an Emperor automatically make you a Vassal?

What should be other effects of Imperial Support?

I also need to add code for what happens when you Declare Emperor and everyone chooses a side. Who controls the REF? What does the Pope do if he does or does not support you? Who declares war, stuff like that?
 
What should the Requirements Be? Perhaps...
I'm not sure what they should be, but I know where they should be: XML.

I also need to add code for what happens when you Declare Emperor and everyone chooses a side. Who controls the REF? What does the Pope do if he does or does not support you? Who declares war, stuff like that?
If everybody supports you, who would REF be anyway? Isn't it like becoming emperor without a fight and provide a diplomatic victory?
 
I would say those who support you become your vassal when you declare emperor, before they should just be an ally.

I think the requirements should be high, high relationship, X number of treaties for X turns, as you have to be seen as a loyal and strong benefactor, they have to know you well enough to entrust their future to your guidance.
 
I would say those who support you become your vassal when you declare emperor, before they should just be an ally.

I think the requirements should be high, high relationship, X number of treaties for X turns, as you have to be seen as a loyal and strong benefactor, they have to know you well enough to entrust their future to your guidance.

Yes, good point, so you must have..

Defensive Pact (or Shared a war?) for so many turns
Must be at least Pleased Attitude
Must have 50% Fealty (anything over is a bonus so that extremely high Fealty could compensate for slaking elsewhere)
Also, you must be the Top contender on their list, this is based on Power, Land, population, etc. (This is where Fealty can help as well)

Also..
Must be willing to accept Open Borders (if not already done so) as once you agree to Support as Emperor you automatically get this agreement. So, you can have Open Borders, but not Support as Emperor because of missing one of the items above.

You then become a Vassal, but not like the current Vassal who joins your team as we are wanting to stay clear of everyone on the same team.

We'll have to implement Vassals having shared vision, which shouldn't be to difficult. Plus add anything extra that Vassals would need to have or share.

I could add a new Diplomacy Option for "Would you mind if I asked.." then they would decided if they "minded" (based on attitude), if not they would say "Yes, I do mind, we are finished here!" or you could be taken to an option menu for more Private things like "What do you think of..." and a new option for "Who do you support for Emperor?"

There was something else I was going to add but can't think of it now, will have to check back later :p
 
I think it should be shared a defensive pact for X turns and if you honour a pact and go to war for them, then it gives a big + to that particular calculation.

So if it was say 100 turns of defensive pact, then honouring the pact and going to war in their defense would count for like half so 50 turns. (numbers are whatever)

but actually honouring the pact is a much bigger sign of trust and commitment.
 
I think it should be shared a defensive pact for X turns and if you honour a pact and go to war for them, then it gives a big + to that particular calculation.

So if it was say 100 turns of defensive pact, then honouring the pact and going to war in their defense would count for like half so 50 turns. (numbers are whatever)

but actually honouring the pact is a much bigger sign of trust and commitment.

That is true, an unhonored pact isn't worth the paper it is signed on. So, yeah, an Honored Pact or a fulfilled request for War would be a huge bonus, sounds great!
 
I am thinking that as the final Conquest draws closer the Invading Civ Leader will start to send Envoys to pester you, warning you of the impending doom. Perhaps offering you a chance to give a gift (which leads to less troops added to his army). This could make the Player's experience more immersive. Throughout history Leaders have done this, sending envoys in an attempt to get the Civ to either submit without a fight, or to at least intimidate them. The Envoys will also be introducing the Player to the Invading Leader so that when he or she finally arrives the Player will be familiar with them.

Just how to do this is the question. The main problem we have is that the EXE handles most of the Diplomacy setup. I don't really want to create a whole Envoy Civ and Player (taking up a Player spot as well), just to get LeaderHead art, so I am thinking we may have a few options, which I am going to talk through as I am unsure how it would work until I do.

We can intercept the LeaderHeadArt tag and place code to get an alternate tag if the LeaderHead type is suppose to use an envoy at that time. This new EnvoyArtDefineTag would be placed in LeaderHeadInfos. This way all you need is the Art.

Or we can add a new LeaderHeadType for Envoys. Then we add code to the CvPlayer::getLeaderType() to get the Envoy Leader instead when we setup the Diplomacy.

I debugged and const char* CvLeaderHeadInfo::getArtDefineTag() const is called to get the Art each time a Diplomacy Screen is popped up. So, LeaderHeadTypes CvPlayer::getLeaderType() const would be called as well. Both of these are DllExport but we've tooled with these types before with no issues.

I'm thinking getArtDefineTag() would be the easiest as you don't have to add a whole new LeaderHead. Since we have no way to define which Player is getting the call for LeaderHeadArt as this comes out of the EXE, we would have to getActivePlayer() and setup a way to get it from there. This we would have to setup as not to crash the Pedia though.

Or, I just noticed, we could use the void CvLeaderHeadInfo::setArtDefineTag(const char* szVal) to define the LeaderHead Art at game start, so that they would use the Envoy Art, then when the Actual Leader is ready to arrive we can then reset the Art.

Looking through the options, I am thinking this last one will be the best if it works. We can set a boolean bEnvoy to CvPlayer and check if the Leader Has an Envoy, if so, change its Art and set bEnvoy to true. Then when the Leader is ready to appear we set bEnvoy to false and change the art back. The Envoy would have the LeaderTypes name, but Envoys do come in the name of their Leader. The Diplomacy message can explain what is happening so this may not be an issue.
 
One trick to add a new leaderhead without using a player slot for it could be to use the player without a leaderhead, which would be the barbarians.

Another idea is to exploit the fact that we have delayed response. We send one event to the exe and deal with it before sending the next. This mean whenever we send an event to the exe, we can set some variables in the DLL. Say we add bAltLH. When the exe use get functions, like getting the leaderhead, the get function in the DLL can return different values depending on bAltLH. (though rather than a bool, I think I would use an enum to make the system more friendly for expansion, but that's besides the point for the concept)

It's a bit like a hack and not particularly nice coding, but if it works, it works and just getting the exe to work with something it wasn't designed for is an achievement in itself.

One drawback I can think of is if it doesn't reset as intended, the graphics in pedia might be... interesting. Maybe we can make a dedicated function, which the exe calls and then another for python to avoid problems in this regard.
 
One trick to add a new leaderhead without using a player slot for it could be to use the player without a leaderhead, which would be the barbarians.

Yeah, I didn't think about that, it could be handy. I was also thinking we could have an actual Player Advisor that Players can associate with, just to add more life to the game. He could ask the Advisor questions about strategy, hints, and such. Of course, we would have to write all this out but it would add to the immersion I bet. And we could perhaps use the Barbarian Player as the Advisor ;)

Ok, I started thinking that my idea to use CvLeaderHeadInfo::setArtDefineTag would not work because CvInfos are not saved, but I tested it and it works. I added some test code to change the Pope with GC.getLeaderHeadInfo(GET_PLAYER(ePlayer).getLeaderType()).setArtDefineTag("ART_DEF_LEADER_OLEG") and it worked. The Pope got a face lift, and it was a persistent one. Since we have the Pedia at the Main Menu, I am thinking that Art is loaded and the variables set at game load, at least for LeaderHeads as when the Diplomacy code retrieved the LeaderHead art it didn't pull it from XML but just used the getArtDefineTag. Still, using this changes the Pedia art as well, but I am thinking we can edit the Pedia Python files to compensate if we went this route, however...

Perhaps we could use the Barbarian LeaderHead spot. The Barbarian is actually in the Pedia and shows up as some vanilla Indian. This should be completely removed. Anyway, when this diplomacy is called we can have a variable set in LeaderHeads for Advisor art, we get the Art, and change the Barbarian's Art. Hmm, there is the issue with Name though, we can change our Name in the options, but looking at the code this is all handled in the exe. There is no setName code in the DLL, even the menu that pop's up is handled by the exe. That causes a problem as we can't change the name, and testing just now we can't change the name in the Diplomacy Screen either as that is done with the exe. Unless, we remove the Barbarian name so it doesn't appear and just use the Diplomacy text to explain who is who, we would have odd names. Is the Barbarian name ever used? All the units are set to Hidden so we never see any Owner. So perhaps we could just set his name to Envoy.

Ugh, if we just had our own Diplomacy Screen this wouldn't be an issue :crazyeye:

So, what would be the simplest solution, hmm....
 
If what we want is to allow a player to have multiple LeaderHeads while talking to somebody, then maybe the answer lies in modding CvPlayer::getLeaderType(). If we set a condition for which LH to use when sending the event to the exe, the exe will use this function to fetch leaders, which will never be used as real leaders for any civ.

I have been thinking of the concept of writing functions, which are only used by the exe and then have different functions, which are only used by the DLL. Doing that will give us a much higher degree of freedom, both for DLL modding and for telling the exe what we want it to do.

It could be done something like this:
PHP:
#IFDEF EXE_EXPOSED
	DllExport LeaderHeadTypes getLeaderType() const;
#ENDIF
In one file, we gather the exe exposed functions and that file defines EXE_EXPOSED before we include header files. The DLL and python would still need access to this info, meaning we add another get function, which depending on what we do may or may not return the same value. By using define like this, we will ensure that the DLL will not use the exe function by accident.

A setup like this will allow us to send "fake" info to the exe to make it do precisely what we want it to do without messing up the DLL or pedia.

I have been thinking about a setup like this for a while, though my main focus for such a setup has been CivEffects, not diplomacy. However in theory it could be used for all exe exposed functions. It would need testing as I'm not sure how the compiler will react to having more DllExport in the class when included in some files than when it's included in some other files.

An alternative approach (which will work regardless of compiler issues) is to define IFDEF EXE_EXPOSED in the makefile. By simply not defining it, the resulting dll will be useless, but the compiler will complain about all the places the DLL uses functions, which are exe only. We could call it some sort of test compile. With a bit of imagination, we might make it test other stuff as well. The downside with this test is that the modder has to activate it manually while the first approach happens automatically each time the DLL compiles.
 
If what we want is to allow a player to have multiple LeaderHeads while talking to somebody, then maybe the answer lies in modding CvPlayer::getLeaderType(). If we set a condition for which LH to use when sending the event to the exe, the exe will use this function to fetch leaders, which will never be used as real leaders for any civ.

I did mention this approach, however, I was attempting to avoid having to add new LeaderHeads just to get the Art from it, but it looks like there is not simple solution. If we can do it with getLeaderType() that would perhaps avoid any Pedia and Wrong Name discrepancies though, so I will attempt to do it this way first.
 
Back
Top Bottom