Results 1 to 5 of 5

Thread: Campaign AI & Diplomacy in Mitteleuropa

  1. #1
    Sinuhet's Avatar Preparing for death
    Join Date
    Mar 2005
    Location
    the Czech republic, EU
    Posts
    1,090

    Default Campaign AI & Diplomacy in Mitteleuropa

    Well, I am serving an emegency right now and it is quite calm atmosphere till yet, so I will start to write a more detailed explanation of a system implemented for campaign AI and diplomacy in Mitteleuropa mod as I have promised in Readme, but I have been very busy to do it ....

    1. Introduction and basics

    The whole system is based on the merging the best features from mods modifying this things, which were available in time of developing the Bohemia mini-mod in January and February 2007. It could appear that it is a bit oldish from this reason, but I have redone the whole thing completely in that time, and what I have seen till yet, nobody has implemented such solutions in any other mod till yet, so this my system is quite unique till yet and is "modern" sufficiently.

    The two strong players stayed in a game in January as for campaign AI and diplomacy modding - Ultimate AI by GrandViZ and Anno Domini implementation of oririgianl ShabaWangys Diplomacy (this whole mod was developed by Re Berengario I mainly in that time although). I have had in that time also some own research done in this field, nevertheless, the important thing was that I didnt need to do things from scratch because I have obtained from both these developers to use their work for Bohemia mini-mod .... Many features and ideas are implemented from this two great mods in my system, nevertheless, I have found out the weak points both of them also, and I had to develop some quite new things, which was necessary for optimal function of the whole system, but were underdeveloped in both basic works, which I have used... I must say that it was a nice intellectual work to merge these two sophisticated products and develop them further on the edge of possibilites of MTW2 engine...

    2. A basic layout of the available systems and used principles

    After this general introduction quite concrete to the particular features. To describe it in more easy way I will compare it to the vanilla campaign AI and diplomacy from time to time, with which is everybody familiar, I assume. The main problem in vanilla is "common" behaviour of all factions. There is not a big difference between factions relations from different cultures and AI is behaving illogically as for creating alliances and then backstabing or almost "regular" breaking of the alliances without any reason. It is simulating the "medieval chaos" maybe, but it is boring after a while ...

    descr_campaign_ai_db.xml file

    Both above mods has tried to solve this basic problem of vanilla by redefining the behaviour of the AI by the way of changing a code in descr_campaign_ai_db.xml file. Both of them are way better then vanilla, and each of them has expanded the file with large parts of the quite original own xml code.

    After doing the tests I have stayed before decision which of them to pick up for my own development. As for the "style" in a game, I have preferred a bit more the Anno Domini solution, which was consistent with also other modified files responsible for campaign AI and diplomatic relations. The Ultimate AI was mainly the critical descr_campaign_ai_db.xml file in that time and other things was largely underdeveloped compared to AnnoDomini - they was in fact too vanilla ones, which crippled (and to some extent also cripples till yet) an otherwise genial piece of software. I have decided to use the GrandViZ work in the end, despite of some my arguing with GrandViZ in that time due to some other problem - descr_dilomacy.xml modding. But I liked and like till yet the logical "cleaness" of the GrandViZ xml code in this file. I was able to see the main ideas in his code than in the ShabaWangys and this was decisive for me because I have been prepared to expand the functionality of the whole thing still a bit more.

    GrandVizs descr_campaign_ai_db.xml file from Ultimate AI mod in that time was revolutionary in several features compared to vanilla.
    It has introduced the new AI flags for all cultures, not only for default, papal_states, catholic and slave, but also for orthodox and islamic factions, and later also for aztecs. This simple trick is very important, because it is opening the filed for more combinations of behaviour depending on cultural differences, which was a huge role in reality of medieval ages. The result of this solution was creating a blocks of faction according to their culture - a huge step forward compared to vanilla "boring uniform factions". GrandViZ has a lot of work to set up the things to be in balance, and the first results was not ideal (huge blocks of allies, too much love and peace between catholic factions etc.), nevertheless the main idea has huge potential and allows an incredibly deep definitions of behaviour and relations between factions, and this mainly compared to RTW engine, where similar things were not possible or were at least very inflexibly implementable via show_me scripting...
    Secondly, it has introduced a solution for preventing a constant and illogical backstabing. The solution was refined later to the current status, when there are especially defined "backstabing routines" against Human Player to let the game to be further a bit unpredictable and there is not only fully rational behaviour of AI further with suprises of type "who is the real skunk" for a Human Player...
    Another things, which are good to mention here also, is a special way of grouping the factions according to their strength, redefinition of behaviour of papal states to have them more passive etc.
    This whole system is enabling "dynamical" changes of mutual relations between factions and also some predictable behaviour as for wars and alliances according to culture and development of particular factions as for their mutual strength and relations.

    However, this system has also its weak points. There is too much inertial behaviour as for alliances and wars. The relations are too much stable sometimes. Another problem was too much passive papal_states, or on the other hand, too much agressive papal_states "taking half of Europe". Quite underdeveloped were then the sections of code for defensive behaviour of the AI.

    descr_character.txt file

    GrandViZ had also another genial idea, which is enhancing the whole campaign and AI behaviour and possibiliteis generally. When one increase a movement ranges of some characters on the campaign map, the whole game is obtaining quite new dynamics and the AI is able to do quick re-groupings of armies and their reposition also in larger empires. This solution is giving "a higher degree of fluidity" to all processes in campaign. This solution is taken from Ultimate AI into Mitteleuropa mod fully, I have done only my own settings of values for some characters (altogether with changing the costs of these characters and their upkeep), the basic idea is the same, however.

    descr_faction_standings.txt file

    Anno Domini campaign AI and diplomacy is by order stronger in this file compared to vanilla and also to Ultimate AI of that times (I have point out this weakness of the Ultimate AI, and then I have found out the "prepared" solution in Anno Domini ). This file is used for changing the mutual faction standings and also global standings. It is a file constructed on the same principles as for scripting side of things like character traits or guilds. CA has developed this part of their own scripting language relatively sufficiently to define flexibly all possible "real world" situations. Anno Domini is using several different "events" and "triggers", which are causing increase or decrease the values of these "standings". To name the most original ones, ther is a system of transgressions and "chivalric" features of family characters on global standing, and together with changes in character traits and ancillaries also implementation of titles based on geographical side of things.


    3. A layout of the whole system and main principles in Mitteleuropa

    descr_diplomacy.xml file

    I have started with modding diplomacy from still another direction already in 2006. I have found out that introducing local and global faction standings values compared to vanilla "conservative settings" to things like making alliances etc. is very strong tool how to change the whole campaign. Based on my own tests, I have overstretched the feasibility of influencing various things by way of changing this file only. GrandViZ has shown me my mistake, nevertheless, our discussion about this was in a bit enemical atmosphere. Nevertheless, GrandViZ has helped me to "revert" the logic of who is "demanding" and who is "offering", and shown me also that this file is for and only for the diplomacy between Human Player and AI and not also for only mutual AI factions dealings, as I assumed originally. However, my first experiences with the agressive settings in this file and their impacts has helped me to tweak the whole diplomatic system "according to" this file, and this way of modding of diplomacy is one of the unique features of the Mitteleuropa mod compared to vanilla or any other mod. GrandViZ have been in mistake in some other thing in this file - the limits of valuse which he has used was beyond the used +-1.0. That my approach of modding of this file is very promising and have a grea potential is clear also after a mere comparison of my modificiation of this file, GrandViZs "conservative and overvalued" modification and settings of values made by CA from MTW2 1.0 to patch 1.2. In fact, CA is now using some of "my" values also, but they are still a lot conservative. From this reasons, I have toned down the setting of mine also a bit in some parts, so there is a situation right now that all of us has gone a bit more to the "middle"....
    Most people are underestimating the power of modification of this file, but it is the point, where you, as Human Player are actively playing the "diplomatic theatre". If the limitations and conditions for your "playing" and reactions of the AI on your stimuli are changed, the impact is huge. So huge, that when you start to modify this file without some accumulated knowledge, you can ruin the game completely. All in this file is very strongly interrelated to descr_faction_standing.txt file also.
    My released version of this mod is a such "in start minimalistic" approach. After strating the campaign, you will not see too much differences in diplomatic dealings with foreign factions compared to vanilla. But the whole system is tweaked according to main principles: 1. just dealing for both sides is the best way in long terms, 2. what you can achieve in diplomacy is strongly related to your factions global_standing and mutual standings of the target faction and yours (local:standing). So, as the game is further during the campaign, you will reach very quickly a point, when you are strongly limited, and all dealings are on not only your voluntaristic acts, but things of finding the "less wrong" solutions like in real life diplomacy...

    descr_campaign_ai_db.xml file

    The main thing which I have introduced in this file and has the huge impact on the whole game is one simple thing. I have implemented a simple routine for negative feed-back of two factions in war. It is only minority of information in the whole code of this file, but the basic idea and balancing the things was very difficult to develop to function in the whole system effectively. Ultimate AI had not such thing in time when I have developed it and relased it then in alfa1 version of Bohemia mini-mod. It is also the reason of the "inertial" behaviour of the AI factions in Ultimate AI as for wars and it has indirectly also an impact on "rock-stable" alliances in this mod. I have implmented this negative feedback via the mild negative global standing value in the end after comprehensive research of various solutions. It is a solution resembling a situation in real life, when the mutual continuing war is starting to be unpleasant to both sides. The situation when you must to do something, because your reserves are empty, the same is valid for your foe, and altoghether you both are starting to be eventual good target for somebody third, staying a bit more far till yet and being more strong then you and your foe... It is extremelly important thing in all system, because existence of this feed-back can let to start the wars more often, and you have high probability that things will be in some balance after some time. That such balance can be in the same time erasing one of the factions completly is another fact. And the whole thing is starting to be a fun, when you as HUman Playser have starting to have bad global standing, but your foe is strong enough and has good global standing from various reasons (yes, you are starting to fight about surviving). These things are again strongly related to the settings in descr_faction_standing.txt file, which is in the Ultimate AI too much aside....
    Another thing, which I ahve changed largely is a possiblity to break alliances in controled way. It is several new defined routines, which are causing sometimes confounding of the MTW2 engine also to the extent, that you give a message that factions "stopped to be foes" (i.e. started to be neutral), but in fact they only break an alliance and stay to be neutral only. THe hardcode for this is apparently underdeveloped in MTW2, but I ahve reached the edge and results are sometimes suprisingly good. So, dont bother to study in detail the dimplomatic messages during campaign, the only right thing is overview of relations in the Diplomacy Pane.
    Still furhter thing was changed in this file compared to original Ultimate AI mod. I ahve redone the defense sections for all AI labels. Nevertheless, the behaviour of the AI is still furhter rather dumb. You will see further full stack army viewing on the foe going on some poor city with limited garrison. This passivity is hardcoded unfortunatelly.
    Last edited by Sinuhet; July 04, 2007 at 03:54 PM.
    My TW games "Battle Formations" projects:
    Sinuhet's ETW Formations v2.0 – for ETW
    Sinuhet's Battle Mechanics v5.0 – for MTW2
    Sinuhet's Battle Mechanics v3.0 – for MTW2
    Sinuhet's AI Battle Formations v7.0 – for RTW 1.5


    In Patrocinivm Svb HorseArcher

  2. #2
    GrandViZ's Avatar Domesticus
    Join Date
    Dec 2006
    Location
    Berlin, Germany
    Posts
    2,026

    Default Re: Campaign AI & Diplomacy in Mitteleuropa

    Hi Sinuhet,

    a good reading, and thank you for the flowers! I know, that our discussions in the past were not always friendly, but I found it promising, that we came along in the end again.

    GrandViZ have been in mistake in some other thing in this file - the limits of valuse which he has used was beyond the used +-1.0.
    I suppose you are refering to these values.

    <item name="offer_protectorate">
    <cost modifier="1.5"/>
    <faction_standing modifier="0.5"/>
    <global_standing modifier="1.0"/>
    </item>

    I'll try to explain, why modifiers and base values are not the same. You are right, when you say, that faction relations and global reputation base values are measured between -1.0 and +1.0. However the modifiers do not refer or equal these values at all.

    A cost modifier of 1.5 means, that the real costs you have to pay for the agreement are 1.5 times higher than the hardcoded base cost, nothing else. You can easily verify this by changing the cost modifier for map exchange offers to 10.0 and see what happens ingame. You'll have to pay ridiculous high amounts of money to get that map.

    The modifiers for faction standing and global standing range between 0 and +1.0. A modifier of 0 means that e.g. faction standing is not taken into account at all, whereas a modifier of +1.0 would mean that the base cost bonus (in case of good relations) or penalty (in case of bad relations) is applied to 100 %. A value of 0.5 would only add 50 % of that hardcoded bonus or penalty.

    You may believe this or not, but I have verified this by many tests. Cost modifiers higher than 1.0 do work and have an effect!

    Best regards
    GrandViZ
    Creator of the Ultimate AI
    Co-Author of Broken Crescent

    Under the Patronage of Trajan

  3. #3
    Sinuhet's Avatar Preparing for death
    Join Date
    Mar 2005
    Location
    the Czech republic, EU
    Posts
    1,090

    Default Re: Campaign AI & Diplomacy in Mitteleuropa

    Hi GrandViZ!

    Thank you for your reaction. I am glad that it is not only my monologue. As for our relations, I think they are perfect now, both of us are doing the same in a bit different way and putting into things his original ideas. That previous debates were a bit hot sometimes is only from reason, that it was true intelectual encounter, such "medieval scholastical disputes".

    In every case, I am very grateful to you for sharing results of your research and developmnet with me and community generally.

    As for the values. Yes, I have been referencing this parts of the code in that xml file. I assume/have assumed till yet further, that CA has a reason why it did not go beyond 1.0 in absolute values for these flags. Nevertheless, it is only marginal thing. If I could take as a premise results of your own tests and that you are true in this 100%, the important thing is a setting of the values througout the whole this file homogenously, their mutual differences and by this way created system of relatively interdependent relations and bounds of all respective flags. In every case, it is possible to implement it satisfactory without going beyond the 1.0 absolute values. The values in the most "important" diplomatic events/dealings (I mean as for differences of the whole system compared to vanilla mainly) in the flags for global and local standings modifiers are at their best mostly in range of 0.0 - 0.5. This principle is now more widely used also in vanilla MTW2 1.2. So the upper limit is imoprtant only in a few of them, and for the system as a whole almost irrelevant....

    Good luck with your mods (with battle AI also - to be honest, I was too busy with my own "big" mod to try this your battle mechanics mod, I freezed the delopment of my own battle mechanics too from this reasons... Nevertheless, I will try it in future definitely (at least from curiosity) and maybe I will obtain some new inspiration from your work again like in campaign AI ....

    Bye Sinuhet
    My TW games "Battle Formations" projects:
    Sinuhet's ETW Formations v2.0 – for ETW
    Sinuhet's Battle Mechanics v5.0 – for MTW2
    Sinuhet's Battle Mechanics v3.0 – for MTW2
    Sinuhet's AI Battle Formations v7.0 – for RTW 1.5


    In Patrocinivm Svb HorseArcher

  4. #4

    Default Re: Campaign AI & Diplomacy in Mitteleuropa

    Wow...

    I know you don't think too much of PR from what I've read in the other thread, but your mod sounds better with every new post. Perhaps you should spend a minute or two 'PRing' your mod. It would be a shame if only this handful of guys knew your mod.

    On the other hand... who cares? At least, you and me know your mod is great.

    BTW: It's very good to watch a discussion of two such 'wise' and mature persons like you. A good and important contrast to the flame-wars that flood some forums. rep for both of you.

  5. #5
    Sinuhet's Avatar Preparing for death
    Join Date
    Mar 2005
    Location
    the Czech republic, EU
    Posts
    1,090

    Default Re: Campaign AI & Diplomacy in Mitteleuropa

    Thanks for a positive feedback, Dimitri
    My TW games "Battle Formations" projects:
    Sinuhet's ETW Formations v2.0 – for ETW
    Sinuhet's Battle Mechanics v5.0 – for MTW2
    Sinuhet's Battle Mechanics v3.0 – for MTW2
    Sinuhet's AI Battle Formations v7.0 – for RTW 1.5


    In Patrocinivm Svb HorseArcher

Posting Permissions

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