Results 1 to 14 of 14

Thread: XAI Kingdoms Integration: The Britannia Campaign

  1. #1

    Icon5 XAI Kingdoms Integration: The Britannia Campaign

    I am looking to integrate, for my own use, the XAI project into my kingdoms install, I have already performed an integration into the retrofit mod, but have ran into problems integrating into the Britannia Campaign.

    What I've been able to do

    First I deleted the Map.whatever file (cant remember the extension right now) and modified the launcher registry keys to point to a config file with the caching turned off, as I have a steam version.

    I was able to just copy in the BAI, Pathfinding and Formations. However the sections of the CAI are giving me more trouble.

    The Diplomacy file was OK, and I was just able to drop that in. And descr_campaign_db.xml was easy enough to set up (Britannia does not need a priest controller)

    descr_faction_standing.txt was also easy enough, I just compared with the one from the XAI and changed values in the default Britannia one where they were relevant.


    The Problem

    Once I came to integrate descr_campaign_ai_db.xml however I hit a bit of a snag. The Britannia campaign uses custom AI labels with a amount of scripting in each (the Welsh alliance with the Baron's Alliance for example) so I couldn't just replace them all with the catholic section, in addition the descr_campaign_ai_db.xml file is seems to be the most complex, so I have no idea how to go about making the integration, especially how most of the file keeps going on about how finely calibrated all the values are.

    So my question is could someone here lend some helpful advice for getting this file worked out.
    Last edited by fudgedragon; July 11, 2010 at 11:46 AM.

  2. #2
    Achilla's Avatar Vicarius
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    2,577

    Default Re: XAI Kingdoms Integration: The Britannia Campaign

    Different AI labels in descr_strat are used to trigger events through campaign scripts.

    I think your safest bet will be studying all pre-existing labels in Britannia campaign, then copy-pasting 'catholic' entry for as many times as there are total different labels in the game.

    Finally, you just replace the names of the new entries from catholic to new entries.

    So say, you have 4 different AI labels in descr_strat, you copy your 'catholic' entry three times in AI files (so it's present 4 times in total), then change the names e.g. to 'baron', 'scotland' etc., whatever is present there.

    All Britannia factions are basically catholic as far as I'm concerned and I doubt there is much reason to change relations too much, unless you want to create massive hate towards England, so it could e.g. use 'islam' label, when the remaining guys are 'catholic' (given what's inside the entries, not how the entries are named in actual AI file, because you just changed the names to reflect what's inside descr_strat as used AI labels).

    You might want to go through AI files a bit and e.g. remove stuff like varying relation with pope/other factions when you build a church/masjid, since it would be a complete nonsense in Britannia campaign and might not necessarily match the actual building tree.

    You shouldn't run into problems with cultures/religions, since they are handled per-each individual faction in another file, however it is all theoretically speaking because we didn't really sit down integrating it to core kingdoms campaigns.

    Their scope felt fairly limited, while our AI relations are able to handle 30+ factions over a big map, so it felt a bit like waste of an opportunity.
    Last edited by Achilla; July 11, 2010 at 12:42 PM.
    Man is but a shadow of his former self, encased in feverish delusions of grandeur.
    Ignorance is your shield, knowledge is your weapon.
    Heart without reason is stupid, reason without heart is blind.


  3. #3

    Default Re: XAI Kingdoms Integration: The Britannia Campaign

    Looking though each of the faction labels seems to show very little differences.
    England seems to have a special clause for turtling when it has a lot of settlements early on in the game, And baron's alliance and the welsh have a line that says that want an alliance with the other, apart from that everything looks normal.

    Appart from the aforementioned lines there is nothing in any of the sections that suggest scripted wars or anything else, so I can guess that that is handled by the ai striving to achieve the territories that the game says it needs to win. I guess the CAI works the same way so should it just be possible to replace the main body of each of the sections with the section for the catholic in the CAI file, leaving the specific sections, or will some other work be required to prep these special sections to work with the CAI.

    the unique sections (in case it helps you advise me are as follows:
    Spoiler Alert, click show to read: 

    for the baron's alliance
    under defend conditions
    Code:
                <decision_entry>
                    <!--
                        BARONS_ALLIANCE, at the start of the game (< turn 50), the barons alliance wants to ally with wales
                    -->
                    <min_entry    target_faction="wales" stance="AtWar"/>
                    <max_entry    target_faction="wales" turn_number="50"/>
                    <faction_attitude    want_peace="true" pts_alliance="10" continue="true"/>
                </decision_entry>
    
                <decision_entry>
                    <!--
                        BARONS_ALLIANCE, at the start of the game (< turn 50), the barons alliance wants to ally with wales 
                    -->
                    <min_entry    target_faction="wales"/>
                    <max_entry    target_faction="wales" stance="Neutral" turn_number="50"/>
                    <faction_attitude    want_ally="true" pts_alliance="10" continue="true"/>
                </decision_entry>
    for wales
    under defend conditions
    Code:
                <decision_entry>
                    <!--
                        WALES, at the start of the game (< turn 50), wales wants to ally with the barons alliance
                    -->
                    <min_entry    target_faction="barons_alliance" stance="AtWar"/>
                    <max_entry    target_faction="barons_alliance" turn_number="50"/>
                    <faction_attitude    want_peace="true" pts_alliance="10" continue="true"/>
                </decision_entry>
    
                <decision_entry>
                    <!--
                        WALES, at the start of the game (< turn 50), wales wants to ally with the barons alliance
                    -->
                    <min_entry    target_faction="barons_alliance"/>
                    <max_entry    target_faction="barons_alliance" stance="Neutral" turn_number="50"/>
                    <faction_attitude    want_ally="true" pts_alliance="10" continue="true"/>
                </decision_entry>
    for england
    under invasion conditions
    Code:
                <decision_entry>
                    <!--
                        England Turtling, If we are in early game (< turn 40), and have more than 15 regions, only invade opportunistic
                        if we're at war,
                        then >>> invade opportunistic
                    -->
                    <min_entry        stance="AtWar" num_settlements="15"/>
                    <max_entry        turn_number="40"/>
                    <faction_attitude    invade="invade_opportunistic" invade_priority="550"/>
                </decision_entry>
    
                <decision_entry>
                    <!--
                        England Turtling, If we are in early game (< turn 40), and have more than 15 regions, do not look for more targets
                        if we're at war,
                        then >>> invade opportunistic
                    -->
                    <min_entry        num_settlements="15"/>
                    <max_entry        turn_number="40"/>
                    <faction_attitude    invade="invade_none"/>
                </decision_entry>
    
                <decision_entry>
                    <!--
                        England Turtling, If we are in early game (< turn 40), and have more than 15 regions, do not look for more targets
                        if we're at war,
                        then >>> invade opportunistic
                    -->
                    <min_entry        num_settlements="15"/>
                    <max_entry        turn_number="40"/>
                    <faction_attitude    invade="invade_none"/>
                </decision_entry>


    Oh and I already dealt with most of the church code. Strangely, dispute not being present in the campaign, many of the Britannia events (such as church building) still modify relations with the papal_states.



    Edit: Had a go at integrating using what I guessed at above. There are still two special ai labels at the top the the file that I missed before now which force a big gang up on the human faction. I haven't got a clue what to do about them, as I figure by that stage the AI doesn't need to be quite so clever, although I figure the loss of the navel invasion code might harm its chances late game. It looks like it might just be the default faction code with massive penalties against the human player, but I cant be sure.
    I'll let you know how it plays
    Last edited by fudgedragon; July 11, 2010 at 03:42 PM.

  4. #4

    Default Re: XAI Kingdoms Integration: The Britannia Campaign

    fudgedragon, were you ever able to successfully integrate XAI into the Brittanias campaign? I've been having a hard time integrating XAI into the crusaders campaign. In my experience, it is not as simple as creating a new batch/cfg file and copying/pasting the XAI files.

    to the XAI team, i know you are busy but if you ever have the opportunity to integrate XAI into one of the four kingdoms expansions, please share what you did.

  5. #5

    Default Re: XAI Kingdoms Integration: The Britannia Campaign

    If you get it working properly, please, if you can be asked, to make it a downloadable version for the less adept I'd love to play the smaller Britannia campaign with a smarter AI.

  6. #6

    Default Re: XAI Kingdoms Integration: The Britannia Campaign

    If i can succeed, I would be more than happy to. Contrary to what every other experienced modder has told me, integrating XAI into the vanilla campaigns is not as simple as unpacking, copying/pasting the XAI files and then creating the batch and config files

    Here are the steps that I have tried so far
    1. Copy one of the expansion mod folders and rename it (crusades to crusades2 or whatever, I renamed mine holyland)
    2. Go into tools folder and run the unpack.bat files for each of the four campaigns
    3. Run the unpack_all. bat file
    4. Delete the two descr_geog files in the main mtw2/data folder
    5. copy and paste the unpacked files from the crusades folder into the holyland folder (or for whatever expansion you are trying to mod)
    6. Add in the XAI files. I made sure to set them all to read only in the properties tab
    7. Change the ai_labels in holyland's descr_strat file to match the XAI labels (islam for turks and egypt, nomad for mongols, etc)
    8. Create a batch and config file in your holyland folder
    9. delete the map.rwm file in the holyland/data/maps/base folder
    10. deleted the pack files in holyland as well as the main mtw2 folder. I noticed from the log that even with cache clearing and the io.file first line, it still reads from the packs first. strange

    Unfortunately, this process did not successfully integrate XAI into the crusades expansion

    XBAI crashes the game and I can tell that XCAI hasn't been integrated properly (venice and mongols are dumb, other factions play like they do in vanilla)
    Last edited by dknight237; December 23, 2010 at 01:15 PM.

  7. #7
    xeryx's Avatar Follow the White Rabbit
    Join Date
    Nov 2006
    Location
    Wyoming, Usa
    Posts
    4,337

    Default Re: XAI Kingdoms Integration: The Britannia Campaign

    Sorry you are having problems. XCAI is more involved to integrate. but the XBAI is plug and play..as long as you have everything patched and are running the KINGDOMS.exe it will work.
    Proudly patronized by B. Ward Click Sig Logo for Downloads, Click forums here and here
    "Do not try and bend the spoon, that is impossible, instead only try and realize the truth.
    There is no spoon, and you will see, it is not the spoon that bends, only yourself."-The Matrix


  8. #8

    Default Re: XAI Kingdoms Integration: The Britannia Campaign

    does XCAI treat emerging factions differently? I mean do you need to do something different than just giving the emerging faction the appropriate ai label?

    Because if that's the case, it would explain why venice and the mongols just sit there and do nothing

    some of my mods made it through. I changed the way reputation worked in the descr_faction standings file and my changes did show up in the crusades expansion.

    XCAI though still won't integrate properly

  9. #9
    xeryx's Avatar Follow the White Rabbit
    Join Date
    Nov 2006
    Location
    Wyoming, Usa
    Posts
    4,337

    Default Re: XAI Kingdoms Integration: The Britannia Campaign

    No XCAI does not treat emerging factions differently. I suspect the AI label is incorrect. Please make sure all instructions for the integrations have been followed step by step. I have to do it, and so do you. You will make mistakes, it's all part of the process. If you get frustrated, just stop for awhile and take many deep breaths.

    Also be aware, on the sitting there and doing nothing, can be related to the save game map bug.
    Last edited by xeryx; January 05, 2011 at 09:58 PM.
    Proudly patronized by B. Ward Click Sig Logo for Downloads, Click forums here and here
    "Do not try and bend the spoon, that is impossible, instead only try and realize the truth.
    There is no spoon, and you will see, it is not the spoon that bends, only yourself."-The Matrix


  10. #10

    Default Re: XAI Kingdoms Integration: The Britannia Campaign

    i double checked and the ai labels are correct so that is not the problem

    What is this save game map bug? I did a search on the forums and could not find anything. Whenever I make any changes to the mod, I always delete the map.rwm file and start a new campaign. I always delete old save games after doing any modding

  11. #11
    xeryx's Avatar Follow the White Rabbit
    Join Date
    Nov 2006
    Location
    Wyoming, Usa
    Posts
    4,337

    Default Re: XAI Kingdoms Integration: The Britannia Campaign

    ok, if you do that then it would not be the save game bug. The original map also has many pathfinding problems as well. This can cause armies to get stuck. but usually happens after a used save. The orders are apparently not saved.

    There maybe and error in the FS file that I need to check into.
    Proudly patronized by B. Ward Click Sig Logo for Downloads, Click forums here and here
    "Do not try and bend the spoon, that is impossible, instead only try and realize the truth.
    There is no spoon, and you will see, it is not the spoon that bends, only yourself."-The Matrix


  12. #12

    Default Re: XAI Kingdoms Integration: The Britannia Campaign

    just to clarify, the mongols sometimes move around but only after a long period of standing still. They wander about aimlessly like vanilla. They really don't attack any other factions. The most that they'll do is sack Baghdad but then they won't take it. They just leave it for the rebels. This is typical vanilla behavior so I don't think I was able to integrate XCAI successfully.

    In KGCM, I can tell I integrated XCAI successfully. Mongols usually do a good job of taking Russia and sometimes go into the middle east

  13. #13
    xeryx's Avatar Follow the White Rabbit
    Join Date
    Nov 2006
    Location
    Wyoming, Usa
    Posts
    4,337

    Default Re: XAI Kingdoms Integration: The Britannia Campaign

    What AI_label are you using for them? verify the spelling and context is the same that is in the Campaign AI.

    You should also check the logging. The logging will tell you what kind of attack and defend decisions that are being made.
    Proudly patronized by B. Ward Click Sig Logo for Downloads, Click forums here and here
    "Do not try and bend the spoon, that is impossible, instead only try and realize the truth.
    There is no spoon, and you will see, it is not the spoon that bends, only yourself."-The Matrix


  14. #14

    Default Re: XAI Kingdoms Integration: The Britannia Campaign

    Quote Originally Posted by xeryx View Post
    What AI_label are you using for them? verify the spelling and context is the same that is in the Campaign AI.

    You should also check the logging. The logging will tell you what kind of attack and defend decisions that are being made.
    I'm using the nomad label for the mongols. It's pretty obvious that I was not able to integrate XCAI successfully. The mongols sit around for about 10-20 turns. Then they just move around the map randomly. Sometimes they will sack baghdad but they won't settle it. This contrasts sharply with my experiences with integrating XCAI in KGCM.

    And it's not just the mongols. Turks never attack me, Venice sits around doing nothing, etc.

    I don't think it is possible to integrate XCAI into the 4 vanilla kingdoms expansions. At least not using the same procedure you use with KGCM or another mod

Posting Permissions

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