FANDOM


A "Diplomatic Reaction" is the term for an action a player takes, which another player might like or dislike enough to cause a shift in Visible Relation, and other diplomatic variables. The person taking an action will be referred as the "triggering player", the other the "reacting player". Each Diplomatic Reaction has a base strength and message associated with it, depending on the source event. However, the message can be "empty" meaning the event will only change the variables, but the AI does not intend to talk to the human player about it. Note that if the triggering players is another AI, the message is ignored, it would serve no purpose as it wouldn't be shown to the human player, and AI to AI Diplomacy is not detailed enough to have a warning message based system. As such, Diplomatic Reactions that repeatedly generate warnings leading to a war or broken treaty will not do so between AI players, unless the loss of Visible Relations causes them to do so through the Need for War check.

Sources of Diplomatic Reactions Edit

-Successfully trading a spell in Player to AI diplomacy, where the spell given has a higher research cost than the spell received generates a +5 base strength with no message. In the unofficial 1.50 patch, this is a +7 event if the research cost is equal or higher.

-At the end of turn, holding a Wizard's Pact has a 50% chance of generating a base strength +random(1-3) event with no message. In the unofficial 1.50 patch, the chance for this is 1/3 only.

-At the end of turn, holding an Alliance has a 50% chance of generating a base strength +random(1-6) event with no message. In the unofficial 1.50 patch, the chance for this is 1/3 only, and the strength of the even is +random(1-4).

-At the end of turn, if 50*(Player Astrologer Military strength/ AI astrologer Military strength)<=random(100), and the player has a larger Military Strength than the AI, and at a 5% chance only on top of the previous two checks, a -10 strength Diplomatic Reaction is generated with the message type "7", a warning for building up troops. The 1.50 unofficial patch completely removes this source of Diplomatic Reaction, because intentionally worsening relations with someone stronger than yourself for no direct reason is a rather stupid strategy. This also disregarded treaty status, if anything an ally should be happy to have a strong friend, instead of telling them to get rid of all those soldiers, further making this a bad and counter-intuitive reaction. This reaction can only happen towards the human player.

-For each wizard [X], at end of turn, if the human player controls (Land Size+1)*3 or more cities, where Land Size goes from 0 to 2 (1.31), 3 (1.40) or 4 (1.50), there is a 25% chance to proceed and calculate Y=(Land Size*3 -Town Count) / (6+Land Size-Difficulty Level)*random(4)/3*4. If X is not the human player, then halve Y. If Y would be less than -15, then it becomes -15 instead. Then every AI wizard generates a Diplomatic Reaction with a base strength Y and a message type "0xE", a warning for trying to take over the world by overextension, towards wizard X. Note that this contains a major bug! The human player's total city count is checked even if X is not the human player. As such, if the human player controls too many cities, everyone else's relations will start to be penalized for it, although at a halved rate compared to the human player's! The 1.50 unoffifical patch fixes this bug, and changes the conditions and calculations to allow a bit more cities as well : First, wizard X has to control (Land Size+1)*4 cities to trigger this reaction, and then Y=(Land Size*4 -Town Count) / (6+Land Size-Difficulty Level)*random(4)/3*4 is used. Note that in all versions, the 25% chance to generate the reaction is not per reacting wizard but global, every wizard in the game will generate the reaction simultaneously -although some might decide not to display the message itself if the trigger was the human player! If there is an Alliance between the two wizards, no reaction is triggered for them in all versions.

-In AI to AI Diplomacy, there is a low random chance of generating a +5+random(1-5) strength event between any two AI players.

-An AI player declaring War will generate a Diplomatic Reaction with a special value as event strength that exceeds all possible other values. This is done to put the war declaration message in the queue and make sure no other event overrides it. This type of reaction has no effect aside from storing the intended message. The same thing happens when breaking a treaty.

-If a unit is standing in a position that violates a Wizard's Pact or Alliance, or at a 5% chance if it just stands in the range of a wizard in general, a Diplomatic Reaction with base strength -(random(1-5)) is generated, with a warning message. In the 1.50 unofficial patch, this is updated to use the message that refers to the treaty instead of the generic one, if one is present.

-If a unit violates a treaty for three turns in a row, a -5 base strength Diplomatic Reaction is generated with a message that mentions breaking the treaty. In the 1.50 unofficial patch, this message is replaced by the one that says the reason for breaking the treaty are the troops building up near the border instead of using a generic treaty breaking message.

-Defeating a wizard generates a Diplomatic Reaction of -40 from every other wizard, with a message type of 7 (building up too much troops/ trying to take over the worlds etc warning). In the unofficial 1.50 patch however, each wizard reacts differently. Those who were at War with the eliminated wizard perform a Diplomatic Reaction of +50 strength, while those who had None as the treaty status with the eliminated wizard will generate a strength 0 event instead. In all cases, the message type used will be "0xE", the message used for overextending/controlling too many towns. Yes, this means that the eliminated wizard's enemies will like the one doing them a favor significantly more, but they'll still put up a facade and use a warning message text towards the human player to make sure the human player won't go overboard with his/her conquest.

-Banishing a wizard generates a Diplomatic Reaction of -20 from every other wizard, with a message type of 7 (building up too much troops/ trying to take over the worlds etc warning). In the unofficial 1.50 patch however, each wizard reacts differently. Those who were at War with the eliminated wizard perform a Diplomatic Reaction of +25 strength and will use message type "6", which thanks the human player for helping them out by attacking their enemy, while those who had None as the treaty status with the eliminated wizard will generate a strength 0 event instead. Additionally, message type used will be type "0xE" unless there was a positive reaction.

-If the human player has a Wizard's Pact or Alliance, and moves to attack a friendly unit or city, and do not cancel the order when the window for confirmation on breaking the treaty is shown, a Diplomatic Reaction of base strength -40 is generated, using a generic "treaty is broken" message type. In the unofficial 1.50 patch, it will use the message type "20", "I'm breaking this treaty because you attacked" and will use an event strength of -20.

-If an attack was made against a non-neutral, non-outpost town, and the attacker wins, a Diplomatic Reaction of -40 is generated, with message type "9", "you attacked my city". Additionally, this counts as an act of war, and will automatically Declare War in the attacker's name to the defender. In the 1.50 unofficial patch, this behavior also extends to outposts.

-If an attack was made against a non-neutral, non-outpost town, but the defender wins, a Diplomatic Reaction of -20 is generated, but -60 instead if the attacked city was containing the Fortress of the defender. In both cases, the message type used is "9". In the unofficial 1.50 patch, the reaction strength is -25 or -41 instead. In this case, no automatic War Declaration happens, because the city did not change owners.

-At the end of the combat, the defender will generate a Diplomatic Reaction towards the attacker based on the amount of troops they lost in the combat. This uses message type "8", "you killed my troops warning". Unfortunately, the counting of dead units is buggy, in fact, the counter resets after every unit, so only the very last unit entering the battle counts. If it is not owned by the defender, or is not dead, there will be no reaction at all. Likewise, units raised as undead or zombies, since they don't actually die, are ignored. The 1.50 unofficial patch fixes these problems and also changes the amount of reaction strength associated by each type of unit to the following : -30 for each hero lost, -random(1-5) for each other unit lost, an additional -random(20) if the lost unit was a settler or engineer. Finally, -7 for any unit that survived but got transformed into zomibes or undead by the enemy. The reaction strength is the sum of all of these values for every unit involved in the battle that belonged to the defender. This reaction is separate from the one generated for attacking the city, if the battle happened at a city.

-Casting a city curse generates a Diplomatic Reaction with message type "0xD", a warning for cursing a city. The following spells grant the following event strength :

-- Evil Presence, Famine, Chaos Rift : -5 in 1.40 and earlier, or -6 in the 1.50 patch.

-- Pestilence : -8 in 1.40 and earlier, or -10 in the 1.50 patch.

-- Earthquake : -9 in all versions.

-- Call the Void : -20 in 1.40 and earlier, or -40 in the 1.50 patch.

-- Corruption : -25 in 1.40 and earlier, or -5 in the 1.50 patch.

--Raise Volcano : -50 in 1.40 and earlier, or -10 in the 1.50 patch.

-Casting Black Wind, Fire Storm, Ice Storm on units causes a Diplomatic Reaction of strength -3, with a message type 8 (warning for killing my troops).

-Starting to cast the Spell of Mastery triggers a -50 Diplomatic Reaction from every other wizard, and another -25 every turn while the spell is being cast with the warning message referring to casting the Spell of Mastery being unacceptable.

-Casting or maintaining a hostile Global Enchantment generates a Diplomatic Reaction with a strength depending on the spell, at full strength when the spell is completed, and at 10% of that amount, rounded down, in every turn afterwards. The list of the hostile enchantments, and the reaction strength to them is the following, first number referring to 1.40 and earlier, second number referring to the 1.50 unofficial patch :

--Eternal Night : -12 / -12

--Evil Omens from Life and Nature wizards only : -20 / -20

-- Zombie Mastery : -14 / -3

-- Aura of Majesty : +10 / +10

-- Wind Mastery : -4 / -4

-- Suppress Magic -25 / -25

-- Nature's Wrath from Chaos and Death wizards only : -20 / -20

-- Chaos Surge from anyone not owning a Chaos book : -10 / -10

-- Doom Mastery : -8 / 0

-- Great Wasting : -20 / -20

-- Meteor Storm : -15 / -15

-- Armageddon : -25 / -25

-- Tranquility from Chaos wizards only : -20 / -20

-- Life Force from Death wizards only : -20 / -20

-- Crusade : -10 / 0

-- Holy Arms : -5 / 0

Diplomatic Reaction process in 1.31 and 1.40 Edit

When a Diplomatic Reaction is triggered, the following process is ran to decide the effects to Visible Relation and other variables.

- First, if there is no contact between the triggering wizard and the reacting wizard, skip the entire procedure. It's not possible to react to someone whose existence is not yet known.

- If the triggering wizard and the reacting wizard are the same person, also skip it.

- If the reacting wizard would be the human player, skip the procedure. It's up to the human player's own decisions and free will to use the Player to AI Diplomacy features any way they want to react to the game situation. As such, hostile actions from an AI wizard towards the human player will not worsen their Visible Relation unless the human player retaliates.

- As a never activating leftover code from Master of Orion, there is a check for Treaty Status being Final War, and one other variable, which is assumed to be the Galactic Council's decision. Such features do not exist in Master of Magic, so these parts of the code useless.

- If the event strength is the special value indicating a Declaration of War or Break Treaty event, then store the event text in the queue with maximal priority, and end the procedure. Changes to variables are done as the effect of the Treaty Break action, or Declaration of War already.

- If the event strength is negative, and the current Visible Relation is also negative, scale down the event strength, the new event strength will be event strength/[1+Visible Relations/-24].

- If the event strength is negative, and the current Visible Relation is positive, double the event strength.

- If the event strength is positive, and the current Visible Relation is positive, scale the event strength down through dividing it by 1+Visible Relations/25

- If the event strength is positive, and the current Visible Relation is negative, double the event strength. However, if this would increase the Visible Relations over +10 if it was added to it right now, change it to the amount that would increase it exactly to +10. Later modifiers might still allow it to exceed this amount.

- If the reacting wizard is Lawful, and the event strength is negative, double it.

- If the reacting wizard is Maniacal, and the event strength is negative, increase it by 50%.

- If the reacting wizard is Maniacal, and the event strength is positive, reduce it by 25%.

- If the triggering wizard is Charismatic, and the event strength is positive, double it.

- If the triggering wizard is Charismatic, and the event strength is negative, halve it.

- If there is a War between the two wizards, it is a negative strength event, and the text message type is 0xE or lower (these are all the warnings that don't refer to an existing treaty), and the triggering player is the human player, reduce the triggering player's Peace Interest by 25% of the absolute value of the event strength, and increase the reacting player's Peace Interest by the same amount. This means that by hurting an enemy, they'll be more willing to form a Peace Treaty. Then, if all the above is true, except disregarding who the triggering player is, set the event strength to zero.

- If both players are AI players, and it is past turn 200, double the strength of positive events.

- If both players are AI players, and it is past turn 200, divide the strength of negative events by 1+(Difficulty Level/2).

- Add the calculated event strength to the Visible Relations of the reacting player as a shortint addition. There is no range/overflow check in this addition, so large changes can cause the value to exceed the limits and turn into a completely different value than intended. Then, if the value is not in the -100 to 100 range, make it -100, or 100 respectively.

- Add the calculated event strength to the Treaty Interest of the triggering player towards the Reacting player. This is a bug and should be added to the other player's variable. Especially so because, in case of the human player, their Treaty Interest is never used at all. Then do the same for Trade Interest.

- Then, take the value of Treaty Interest and Trade Interest of the triggering player and copy it into the identical variable of the reacting player. This is a severe bug, as these variables are not symmetric. In fact, in case of the human player, one of them is never used!

- Adjust Peace Interest based on event strength, not considering all adjustments that happen after the "Lawful" check, including that one. If the event is positive, increase the Peace Interest of the triggering player by this amount. Otherwise reduce the triggering player's Peace Interest by 25% of the absolute value of the event strength, and increase the reacting player's Peace Interest by the same amount.

- Check if the event message mentions the 10th wizard in the game. Note that a game can have a max of 5 wizards, 6 if including the neutrals not led by an actual wizard. This is a bug, it was supposed to check if the message type is the 10th, which is the warning for casting the Spell of Mastery. In that case there would have been a 10% chance to immediately Declare War, but the bug prevents that from happening. The war declaration is treated as though it was coming from the triggering player, in other words, even though the decision is made by the reacting player, the player casting the Spell of Mastery is held responsible for starting the war anyway.

- If there is a message, and the triggering player is human, and the event strength is larger than the strength of the already queued message (if one exists), then replace the message with the current one.

- If there is a War and Visible Relations would exceed -24, set it to -24 instead.

- If there is no Alliance, and Visible Relations would exceed +65, set it to +65 instead.

- Copy the Visible Relations from the reacting player to the triggering player to ensure the symmetry.

- If there is a War, set the Hostility variable to Warlike (3).

- If there is an Alliance, set the Hostility variable to None (0).

- Finally, reset the turn counter for the evaluation of Hostility.

Diplomatic Reaction process in the 1.50 unofficial patch Edit

This section explains how the patch changes the process. Parts that were unchanged are in italics. Completely new parts are bold. Text which is neither implies a feature that was already existing, but now works in a different way.

- First, if there is no contact between the triggering wizard and the reacting wizard, skip the entire procedure. It's not possible to react to someone whose existence is not yet known.

- If the reacting wizard would be the human player, skip the procedure. It's up to the human player's own decisions and free will to use the Player to AI Diplomacy features any way they want to react to the game situation. As such, hostile actions from an AI wizard towards the human player will not worsen their Visible Relation unless the human player retaliates.

- If the event strength is the special value indicating a Declaration of War or Break Treaty event, then store the event text in the queue with maximal priority, and end the procedure. Changes to variables are done as the effect of the Treaty Break action, or Declaration of War already.

- If the event strength is negative, and the current Visible Relation is also negative, scale down the event strength, the new event strength will be event strength/[1+Visible Relations/-24].

- If the reacting wizard is Lawful, and the event strength is negative, double it.

- If the reacting wizard is Maniacal, and the event strength is negative, increase it by 50%.

- If the reacting wizard is Maniacal, and the event strength is positive, reduce it by 25%.

- If the triggering wizard is Charismatic, and the event strength is positive, double it.

- If the triggering wizard is Charismatic, and the event strength is negative, halve it.

- If there is a War between the two players, add the event strength directly to the Peace Interest of the reacting player. If the event type is "warning for killing my troops", only add half of that value, as such actions are natural during War. Afterwards, set the event strength to 0. This is very different from the earlier versions, as the triggering player's Peace Interest is never affected, and it will reduce Peace Interest on negative events, including acts of war, instead of increasing it, however, positive events can increase it, although the only way to do so during War is to cast Aura of Majesty.

- If both players are AI players, and it is past turn 150, increase the strength of positive events by 30%*(Difficulty Level-1). This will reduce it on Easy (0) by 30% and add 90% on Impossible(4).

- If both players are AI players, and it is past turn 150, reduce the strength of negative events by 10%*(Difficulty Level-1). This will increase it on Easy (0) by 10% and subtract 30% on Impossible(4). Events with a strength of exactly -1 are not affected.

- If the message type is "warning for killing my troops", and the trigger is the human player, find all wizards other than the triggering player who are at War with the reacting player. If the absolute value of the event strength is a minimum of 30, and the wizard has no queued message for the human player, there is a 25% chance for the wizard to queue a "thank you for attacking my enemy" type message. In this case, immediately add +9 to the Visible Relation of that wizard towards the human player. This, although contains a message, isn't a Diplomatic Relation and does not go through the normal process, as such, personalities and other modifiers can't alter this shift in relation. Check if there is an Alliance between the wizard and the human player. If yes, and the wizard has at least 2 gold in their treasury, replace the message with a "I grant you a gold reward for attacking our enemy" message, and immediately transfer 30 gold per point of base event strength (ignoring all previous modifiers), or half of their total gold, whichever is lower, to the player. This gold reward is immediate, although the diplomatic message will be queued and show only if the player requests an audience, or ends the turn and no stronger message replaces it.

- If the message type associated with the event is type 8 (warning for killing my troops), and the message already queued this turn is type 9 (warning for attacking my city), regardless of strength, the message type will be transformed to 9, ensuring that the AI will always mention the city if one was attacked, even if the troops killed were valuable enough to cause a higher loss of Visible Relations.

- Add the calculated event strength to Visible Relations, Trade Interest and Treaty Interest, without any of the previously explained bugs.

- If the event message is a warning for casting the Spell of Mastery, there is a 10% chance for immediately Declare War. The war declaration is treated as though it was coming from the triggering player, in other words, even though the decision is made by the reacting player, the player casting the Spell of Mastery is held responsible for starting the war anyway.

- If there is a message, and the triggering player is human, and the event strength is larger than the strength of the already queued message (if one exists), then replace the message with the current one. If the message type is a warning, and there is a Wizard's Pact or Alliance, replace the message type with an identical message that mentions the action is endangering the treaty. If the warning later causes the treaty to actually break, this message can get further replaced there by a "treaty is broken because you did X" type of message, allowing the human player to know why they are losing the treaty. If the queued message is "treaty broken to your attack" and the new one is "attacked my city warning", then replace the message with "Treaty broken to your attack on my city". If the message was any warning, store the message ID "I reject your offer due to your past action X" for possible future use. While this feature was existing prior to this patch, nothing stored a message ID to say to trigger it.

- If there is a War and Visible Relations would exceed -24, set it to -24 instead.

- If there is no Alliance, and Visible Relations would exceed +65, set it to +65 instead.

- Copy the Visible Relations from the reacting player to the triggering player to ensure the symmetry.

- If there is a War, set the Hostility variable to Warlike (3) if it is below.

- If there is an Alliance or Wizard's Pact, set the Hostility variable to None (0).

- Finally, reset the turn counter for the evaluation of Hostility.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.