Page 1 of 4 1234 LastLast
Results 1 to 20 of 68

Thread: Realistic Faction Diplomacy and Faction Relations

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Turbo's Avatar Civitate
    Join Date
    Oct 2004
    Location
    New Jersey
    Posts
    2,152

    Default Realistic Faction Diplomacy and Faction Relations

    REAL DIPLOMACY ...

    One of the things I've been working on is better simulating the friendships and particularly the hostilities that existed throughout this period. I'm referring for example to the wars between england and france, england and scotland, and the turks and the byzantines. While the descr_strat file allows for the initial settings between nations, as the game progresses, anything becomes possible and usually is.

    I hate unrealistic situations such as long term alliances between a catholic and islamic nation, long term alliances between hated enemies such as HRE and Lithuania or Scotland and England. These situations are strictly fantasy and ruin the feel of the game.

    Fortunately, there is a much more precise way of simulating historical tensions through the descr_faction_standing file. The easiest way to explain how is to take a section of the code I am using in the file and explain how it is done:


    Sample code:
    ;------------------------------------------
    Trigger England
    WhenToTest FactionTurnStart

    Condition FactionType England

    (Line1)
    FactionStanding factions { turks egypt moors mongols timurids } normalise -1 50

    (Line2)
    FactionStanding factions { lithuania byzantium kievan_rus russia } normalise -1 20

    (Line3)
    FactionStanding factions { scotland ireland france } normalise -1 40

    (Line4)
    FactionStanding factions { denmark norway } normalise -1 30

    (Line5)
    FactionStanding factions { portugal sicily } normalise 1 10

    ;------------------------------------------
    ((Explanation of code)

    The '1' and '-1' are the flags for positive and negative relations. The number that follows it is the amount of change. You want to be careful about increasing the positive amount of change as a high number as don't want the AI to be too forgiving.

    In the above code, you are setting the diplomatic settings of other nations towards England. Religion plays an important part in this period, so you want there to be plenty of hostility between Catholic and Islam, and some hostility between Catholic and Orthodox:

    In Line1, Islamic nations normalize their relations with England at a negative number which means that there is strong deterioration every turn.

    In Line2 the Orthodox nations also see their relations deteriorate with catholic england but at a less pronounced rate.

    In Line3 we factor in the historical hatred between France, Scotland, and Ireland against England.

    In Line4 we factor in the tension between Norway/Denmark and England. These nations were driven out of the british isles and harbor no love for England. It is not to the extent that Scotland/France hate England but these nations can become expansionist once again in the Isles.

    In Line5 we simulate the friendship between Norman Sicily and Portugal with England. Relations will slowly improve if there are no hostile actions by Englands towards her friends.

    Conclusion:
    Basically, the diplomatic stance between the above nations and England changes every turn. While alliances will rarely occur between Islamic nations and England they can happen. If there is one, it will deteriorate quickly and relations will become more and more hostile. Alliances between Scotland and England, or England and France will also be shorter term and relations will gradually deteriorate as well. Alliances between Sicily and Portugal will tend to be be a bit stronger and longer lasting.

    =-=
    About the modified file attached:

    In the attached file, many factions have a relationship with other factions. If the faction is not listed, then relationship is neutral and will be determined strictly by the game.

    The changes also factor in the negative and positive consequences of new faction leaders, trade agreement, alliances, breaking alliances, and declaring war have for Catholic nations. These have short term implications. This is only done from the Catholic perspective due to the unity of the religion under the pope (papal_states). Orthodoxy and Islamic nations did not historically have this unity of religious beliefs. Credit to DLV for this idea.

    This code also makes the game less predictable and less passive. Most factions have lifelong enemies and factions that just don't like eachother.

    Bug free. The game recognizes the settings and executes them. You will see periodic wars between Genoa and Venice, England and France, Byzantines versus Turks, etc.

    This is open source code, please feel free to change it anyway you like.

    <<File was updated. I uploaded an earlier version>>
    Last edited by Turbo; February 16, 2008 at 09:27 AM. Reason: Update files
    Work of God

  2. #2

    Default Re: Realistic Faction Diplomacy and Faction Relations

    I don't know if these are errors, but seem to be.....

    Trigger Norway
    WhenToTest FactionTurnStart

    Condition FactionType Denmark

    ;

    Trigger Papal_States
    WhenToTest FactionTurnStart

    Condition FactionType Sicily


    Cheers!

  3. #3
    gracul's Avatar 404 Not Found
    Artifex

    Join Date
    Dec 2007
    Location
    Poland
    Posts
    2,009

    Default Re: Realistic Faction Diplomacy and Faction Relations

    a little bug:

    Trigger Hungary
    WhenToTest FactionTurnStart

    Condition FactionType Poland <--- should be hungary

    FactionStanding factions { mongols } normalise -1 100
    FactionStanding factions { turks egypt moors timurids } normalise -1 50
    FactionStanding factions { byzantium } normalise -1 30
    FactionStanding factions { lithuania russia kievan_rus } normalise -1 20
    FactionStanding factions { poland hre } normalise 1 10

    ;------------------------------------------

  4. #4
    Turbo's Avatar Civitate
    Join Date
    Oct 2004
    Location
    New Jersey
    Posts
    2,152

    Default Re: Realistic Faction Diplomacy and Faction Relations

    Quote Originally Posted by gracul View Post
    a little bug:

    Trigger Hungary
    WhenToTest FactionTurnStart

    Condition FactionType Poland <--- should be hungary

    FactionStanding factions { mongols } normalise -1 100
    FactionStanding factions { turks egypt moors timurids } normalise -1 50
    FactionStanding factions { byzantium } normalise -1 30
    FactionStanding factions { lithuania russia kievan_rus } normalise -1 20
    FactionStanding factions { poland hre } normalise 1 10

    ;------------------------------------------
    Corrected

    Quote Originally Posted by gracul View Post
    a little bug:

    Trigger Hungary
    WhenToTest FactionTurnStart

    Condition FactionType Poland <--- should be hungary

    FactionStanding factions { mongols } normalise -1 100
    FactionStanding factions { turks egypt moors timurids } normalise -1 50
    FactionStanding factions { byzantium } normalise -1 30
    FactionStanding factions { lithuania russia kievan_rus } normalise -1 20
    FactionStanding factions { poland hre } normalise 1 10

    ;------------------------------------------
    Corrected.

    I uploaded an earlier version. The file posted has all the corrections.
    Last edited by Turbo; February 16, 2008 at 09:30 AM.
    Work of God

  5. #5

    Default Re: Realistic Faction Diplomacy and Faction Relations

    Do we need to restart a camp to see changes? Sorry, someone had to ask!

  6. #6
    Turbo's Avatar Civitate
    Join Date
    Oct 2004
    Location
    New Jersey
    Posts
    2,152

    Default Re: Realistic Faction Diplomacy and Faction Relations

    Quote Originally Posted by Vasquez View Post
    Do we need to restart a camp to see changes? Sorry, someone had to ask!
    Good question.

    Anytime you make changes to files, I would restart the campaign. In this case, it is designed around the descr_strat file which is run once at campaign startup. The settings continue the diplomatic trends from there. It won't damage your game by including it however, it may produce some strange anomolies. Remember that your save game may already be headed in a different direction.
    Work of God

  7. #7

    Default Re: Realistic Faction Diplomacy and Faction Relations

    Seems like a nice script! But I won't be using it.

    The whole idea with Total War is "historic-fantasy". At least for me. It is unrealistic to rule the world with Aragon just as it is unrealistic for England to have a long-term Alliance with both the Pope and the Turks. That's the fun of it, re-creating history in your own way !!

  8. #8
    King Yngvar's Avatar Senator
    Join Date
    Nov 2004
    Location
    Norway
    Posts
    1,205

    Default Re: Realistic Faction Diplomacy and Faction Relations

    This looks great, I think I'm gonna try it when I start my next game.. Just have to exterminate some more factions in my current campaign first.

  9. #9

    Default Re: Realistic Faction Diplomacy and Faction Relations

    Thanks for this Turbo

  10. #10

    Default Re: Realistic Faction Diplomacy and Faction Relations

    Sorry Turbo! Forgot to say thanks... great script!

    Cheers!

  11. #11

    Default Re: Realistic Faction Diplomacy and Faction Relations

    Looks like this mod will benefits for a better Campaign AI

  12. #12

    Default Re: Realistic Faction Diplomacy and Faction Relations

    I have played 35 turns as Spain (Leon) with this script, and it has worked very well so far (SS 5.1 w Echad 2.0, RR 0.95 beta, RC 1.41). The factions have generally moved to where they are supposed to with some exceptions (Norway and Denmark are really dukin it out and so are Milan and Sicily). There have also been a couple of alliances break, but no backstabbing so far.

    I ran an extra 50 turns quickly (pressing *next turn* over and over without doing anything) just to see what would happen... and it still looked good, and had developed nicely and not exactly as the script would suggest; for example: Poland-Russia allied, Byz-HRE allied, and ironically England and Scotland were not ever at war with eachother even though Scotland was allied with Ireland, who was at war with England. ***As an aside it always irks me to see Ireland included in SS... Ireland either has 2 or 3 provinces for the whole game with no change and never gets destroyed, which, ironically, is historically accurate enough, but this faction just adds no value to the mod IMO*** Note: I could not run any more turns because the Moors fell upon the Iberian Penisula like a plague and destroyed my faction (they even searched me out on Palma to strike the final blow - now thats hate!).

    I have noticed the map seems a lot `cleaner`then normal WRT how factions are expanding and fighting eachother. Usually the factions in the middle get disjointed, but not in this game, they are all solid (and still were after turn 96).

    One issue for me has always been that the AI tends to want to just go after targets of opportunity and not after an enemy per se... this script defintely helps, as I assume that AI is less likey to attack a faction it has good relations with than bad. Consequently the AI seems a lot more focused.

    I have a some suggestions:

    1) Make the campaign start with the correct factions at war or in alliance with eathother.

    2) Start the campaign with all the relations set correcty (approximately) from abysmal to perfect (or do it through a *turn 1 only* script). Then the ongoing script could be a lot more subtle, which may allow the AI-AI relations to change more, allowing the possibility, even if unlikey, for AI France vs AI England to eventually ally by having their relations change positively by fighting a mutual enemy for a long time for example (then of course they would eventually end up at war again surprise surprise lol).

    3) Have the Papal relations chart at the start of the campaign set correctly... HRE and the Pope did not exactly see eye to eye in those days for example, yet HRE starts at the same standing as everyone esle.

    4) Set the prisoner release-execute-ransom trigger to 1 rather then 80. I don`t know if AI-AI battles are tracked for this, but on autoresolve there are rarely more than 80 prisoners.... so the AI relations would never be affected by this trigger.

    Cheers!

  13. #13
    Turbo's Avatar Civitate
    Join Date
    Oct 2004
    Location
    New Jersey
    Posts
    2,152

    Default Re: Realistic Faction Diplomacy and Faction Relations

    Quote Originally Posted by TzuDevil View Post
    I have played 35 turns as Spain (Leon) with this script, and it has worked very well so far (SS 5.1 w Echad 2.0, RR 0.95 beta, RC 1.41). The factions have generally moved to where they are supposed to with some exceptions (Norway and Denmark are really dukin it out and so are Milan and Sicily). There have also been a couple of alliances break, but no backstabbing so far.

    I ran an extra 50 turns quickly (pressing *next turn* over and over without doing anything) just to see what would happen... and it still looked good, and had developed nicely and not exactly as the script would suggest; for example: Poland-Russia allied, Byz-HRE allied, and ironically England and Scotland were not ever at war with eachother even though Scotland was allied with Ireland, who was at war with England. ***As an aside it always irks me to see Ireland included in SS... Ireland either has 2 or 3 provinces for the whole game with no change and never gets destroyed, which, ironically, is historically accurate enough, but this faction just adds no value to the mod IMO*** Note: I could not run any more turns because the Moors fell upon the Iberian Penisula like a plague and destroyed my faction (they even searched me out on Palma to strike the final blow - now thats hate!).

    I have noticed the map seems a lot `cleaner`then normal WRT how factions are expanding and fighting eachother. Usually the factions in the middle get disjointed, but not in this game, they are all solid (and still were after turn 96).

    One issue for me has always been that the AI tends to want to just go after targets of opportunity and not after an enemy per se... this script defintely helps, as I assume that AI is less likey to attack a faction it has good relations with than bad. Consequently the AI seems a lot more focused.

    I have a some suggestions:

    1) Make the campaign start with the correct factions at war or in alliance with eathother.

    2) Start the campaign with all the relations set correcty (approximately) from abysmal to perfect (or do it through a *turn 1 only* script). Then the ongoing script could be a lot more subtle, which may allow the AI-AI relations to change more, allowing the possibility, even if unlikey, for AI France vs AI England to eventually ally by having their relations change positively by fighting a mutual enemy for a long time for example (then of course they would eventually end up at war again surprise surprise lol).

    3) Have the Papal relations chart at the start of the campaign set correctly... HRE and the Pope did not exactly see eye to eye in those days for example, yet HRE starts at the same standing as everyone esle.

    4) Set the prisoner release-execute-ransom trigger to 1 rather then 80. I don`t know if AI-AI battles are tracked for this, but on autoresolve there are rarely more than 80 prisoners.... so the AI relations would never be affected by this trigger.

    Cheers!
    Thanks for your comments.

    The initial campaign diplomacy settings are in the descr_stat file (at the bottom of this file are the faction settings) not in the faction standing file. If you look at this file, the papal states do start out with some hostility against the HRE. You don't want that to be a constant thing however. Remember that this was really the Pope disliking some of the emperors particularly Fredrick.

    In the case of Russia and Poland - they dislike eachother but hate the HRE and both are friends with Lithuania. This is likely a case of my enemies enemy is my friend. In the case of Genoa and Sicily they both may want an isle and go to war. You still want the game's actions to be the primary determinent but you want some of the historical animosities to play a part.

    I may have to increase the relations between Norway and Denmark. The AI personality for Norway may need to be changed to sailor in the desc_strat to encourage bigger fleets. It would be nice to see the Norwegians making an effort to reestablish themselves in ireland or the britsh isles.

    I personally don't mind Ireland included. The faction that I find completely worthless and fantasy is the Templar faction. I removed them from my game as the poor islamic factions have enough trouble without them starting in an unhistorical position in the holyland. I think it would be better to have another islamic factin instead.
    Work of God

  14. #14

    Default Re: Realistic Faction Diplomacy and Faction Relations

    I figured out how to add extra diplomats for the AI, and plopped them all in North America so they could contact eachother easily... and I did some testing to see if it made a difference with AI/AI diplomacy.

    Here is what I recorded (over a 40 turn test as Ireland):

    Number of events: Includes War, Ceasefire, and Alliance announcements.
    Number of alliances ongoing at turn 40.
    Number of wars onging at turn 40.

    Here are the three samples: *Normal SS (Normal), SS with diplomats in NA (Diplomats), and SS with diplomats in NA and 11 alliances already started at the begining of the game (Alliances).

    I did 2 tests for each option to get a feel for it, though it's obviously not enough to draw any firm conclusions from.

    Normal: Events 52 Alliances 19 Wars 23
    Diplomats: Events 66 Alliances 27 Wars 31
    Alliances: Events 28 Alliances 25 Wars 14

    There was some interesting AI behavior in the Alliances test, aside from being relatively subdued. For example, the Moors allied with Egypt, the Turks, Milan and Sicily before assaulting the Iberian Peninsula (in which Aragon, Spain and Portugal were all allied. This makes sense as the campaign AI factors in the number of alliances and wars a target is in before attacking.

    There definitely seemed to be a lot more diplomatic activity with all the diplomats in NA and there was by far the highest number of ceasfires called, and few wars that turned into alliances. There was a problem however. A number of factions sent ships up to the coast of Ireland to try and go pick up their diplomats.



    In light of this problem, I will try a different approach and retest. The question I have for you Turbo, is how do I spawn in a diplomat alongside the spawned army in your Faction Survival Script? For example, do I just add

    spawn_character
    faction kievan_rus
    character random_name, diplomat, age 30, x 269, y 168

    under the army composition?

    I don't know if this will help, but I believe adding a diplomat to the faction survival spawn may allow for a ceasfire, or for the AI to go round up some allies quickly. I will modify the script and test it... just want a little guidance.

    Cheers!

  15. #15

    Default Re: Realistic Faction Diplomacy and Faction Relations

    In my experience, the AI does a pretty good job of sending their diplomats to the far ends of the earth and stationing them as ambassadors. The problem might simply be that they can't simply build enough diplomats early in the game. Why not just start each faction with a bunch of diplomats (maybe 10 or more) and let the AI do its thing?

  16. #16
    Turbo's Avatar Civitate
    Join Date
    Oct 2004
    Location
    New Jersey
    Posts
    2,152

    Default Re: Realistic Faction Diplomacy and Faction Relations

    Quote Originally Posted by TzuDevil View Post
    I figured out how to add extra diplomats for the AI, and plopped them all in North America so they could contact eachother easily... and I did some testing to see if it made a difference with AI/AI diplomacy.

    Here is what I recorded (over a 40 turn test as Ireland):

    Number of events: Includes War, Ceasefire, and Alliance announcements.
    Number of alliances ongoing at turn 40.
    Number of wars onging at turn 40.

    Here are the three samples: *Normal SS (Normal), SS with diplomats in NA (Diplomats), and SS with diplomats in NA and 11 alliances already started at the begining of the game (Alliances).

    I did 2 tests for each option to get a feel for it, though it's obviously not enough to draw any firm conclusions from.

    Normal: Events 52 Alliances 19 Wars 23
    Diplomats: Events 66 Alliances 27 Wars 31
    Alliances: Events 28 Alliances 25 Wars 14

    There was some interesting AI behavior in the Alliances test, aside from being relatively subdued. For example, the Moors allied with Egypt, the Turks, Milan and Sicily before assaulting the Iberian Peninsula (in which Aragon, Spain and Portugal were all allied. This makes sense as the campaign AI factors in the number of alliances and wars a target is in before attacking.

    There definitely seemed to be a lot more diplomatic activity with all the diplomats in NA and there was by far the highest number of ceasfires called, and few wars that turned into alliances. There was a problem however. A number of factions sent ships up to the coast of Ireland to try and go pick up their diplomats.



    In light of this problem, I will try a different approach and retest. The question I have for you Turbo, is how do I spawn in a diplomat alongside the spawned army in your Faction Survival Script? For example, do I just add

    spawn_character
    faction kievan_rus
    character random_name, diplomat, age 30, x 269, y 168

    under the army composition?

    I don't know if this will help, but I believe adding a diplomat to the faction survival spawn may allow for a ceasfire, or for the AI to go round up some allies quickly. I will modify the script and test it... just want a little guidance.

    Cheers!
    You have to treat the spawned character as its own separate 'army'. Just add it below the 'end' statement of the spawned army. Make sure you add an 'end' statement to the character spawn.

    Good Luck!
    Work of God

  17. #17
    King Yngvar's Avatar Senator
    Join Date
    Nov 2004
    Location
    Norway
    Posts
    1,205

    Default Re: Realistic Faction Diplomacy and Faction Relations

    I may have to increase the relations between Norway and Denmark. The AI personality for Norway may need to be changed to sailor in the desc_strat to encourage bigger fleets. It would be nice to see the Norwegians making an effort to reestablish themselves in ireland or the britsh isles.
    Err, Norway and Denmark were seldom friends. The Scandinavian situation was like this between 1000 and 1300 (just to take examples from history, a brief timeline):
    1000: Norway at war against Swedes, Danes and Vends(western slavs)
    1022-1028: Norway and Denmark at war, Swedes try to help Norway, Denmark conquer Norway
    1030: Norway and Denmark at war, Olav II lead rebellion against the Danes
    1040's-1062: Danish rebellion against Norwegian rule
    1099-1100: Norway and Sweden at war
    1123: Norway invade Sweden on "crusade" against pagans
    1130-Late 1100's: Norwegian civil war, frequent Danish intervention
    Late 1100's-Early 1200's: Denmark and Norway intervene in Swedish civil war on opposite sides.
    1240's/1250's: Frequent Norwegian raids against Denmark
    1280's/1290's: Norwegian raids against Denmark

    This was just taken out of my head, there is probably better descriptions of it elsewhere. My point with it was just to explain that Denmark and Norway were not friends, they were rivals. While Norway may have been the friends of Sweden from late 1100's on they seldom had friendly relations with the Danes. Too bad Sweden is not in the mod though...

  18. #18
    Inhuman One's Avatar Comes Limitis
    Join Date
    Jul 2006
    Location
    Netherlands
    Posts
    12,587

    Default Re: Realistic Faction Diplomacy and Faction Relations

    I think the best solution would be to just change starting relations in a way that it will be far more unlikely for some to become allies, but not impossible.

    While not being at war, some relations could be abysmal or poor at the start, and others could be better.

    I am sure that Sicily would have a bit better relations with muslim factions since a part of their population is muslim.

  19. #19
    Turbo's Avatar Civitate
    Join Date
    Oct 2004
    Location
    New Jersey
    Posts
    2,152

    Default Re: Realistic Faction Diplomacy and Faction Relations

    Quote Originally Posted by Inhuman One View Post
    I think the best solution would be to just change starting relations in a way that it will be far more unlikely for some to become allies, but not impossible.

    While not being at war, some relations could be abysmal or poor at the start, and others could be better.

    I am sure that Sicily would have a bit better relations with muslim factions since a part of their population is muslim.
    It depends on your playing style and how much realism you want from the game. This was an age of extreme devout religious beliefs, hatreds, and intolerance. Old hatreds and feuds didn't disappear in 20-30 years but lasted hundreds of years marked with periodic peace and bloody and ruthless wars.

    Diplomacy in the game is dynamic not static. The initial settings change as the game progresses and rather quickly at that. Early on in the campaign there is a lot less warfare between the nations so the relations tend improve. Since the generic diplomacy automatically improves relations between factions of same religion, centuries of animosity and hatreds disappear quickly. It does not however automatically decrease relations between different faiths.

    Regarding Sicily - it was conquered by the Normans from the Muslims and the Muslims were persecuted as heathen. That there almost no muslim presence in Sicily speaks volumes of the effectivenss of the persecution. There was little or no religious tolerance and relations even between the Orthodox and Catholics was strained.
    Work of God

  20. #20
    Inhuman One's Avatar Comes Limitis
    Join Date
    Jul 2006
    Location
    Netherlands
    Posts
    12,587

    Default Re: Realistic Faction Diplomacy and Faction Relations

    why can Sicily call upon muslim archers then? is that an error?

Page 1 of 4 1234 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •