Page 1 of 2 12 LastLast
Results 1 to 20 of 23

Thread: PiterAI (new Artificial intelligence)

  1. #1

    Default PiterAI (new Artificial intelligence)

    PiterAI- artificial intelligence



    Download: No link.



    Installation instructions:

    1. Install Retrofit mod 1.0 link: http://www.twcenter.net/forums/downl...o=file&id=1581

    unzip in your mods\Retrofit folder
    delete the map.rwm file within the mods\retrofit\data\world\maps\base directory



    Information

    Diplomacy is based on many factors but in short it works as follows:

    From the point of view of campaign difficulty level:

    VH level – AI considers player as its biggest threat so it tries to form alliances against the player and tends to go to war against the player. The AI factions easily form alliances if they consider the player their biggest threat.

    H level – AI considers the player as a threat and tries to form alliances against the player and tends to go to war against the player, but to a more limited extent than on VH level. If an AI faction neighbors a faction that is significantly stronger, it will try to find an alliance against such faction. In such situation AI may propose alliance to the player and be a loyal ally.

    N level – AI tries to form alliances against the strong empires (factions that are significantly stronger than AI) and tends to weaken them. If there are no such strong factions, AI will try to go to war against the player. If AI does not border the player, it tries to attack its weakest neighbor (if it tried to attack the weakest neighbor first, the campaign would be rather boring ).

    In general:

    If the AI’s invasion priorities (i.e. code command driving AI to invade a given target) do not exceed a minimum threshold, the AI will not attack other factions (except for rebel / neutral provinces).


    By using the „opportunistic invasion” command in the options of war and rebel provinces conquer, AI will sometimes ignore its diplomatic priorities. Besides, M2TW AI is bugged anyway.

    Alliances – if an alliance is not aimed against an enemy which is the AI priority target, it works as a „non-aggression pact”. The alliance code includes commands which drive AI to attack a common enemy but if it is not the AI perceived “priority enemy”, the chance that such attack will be executed is rather small (especially on VH difficulty).

    Preparations for war



    The tactics responsible for invasion is rather a slow and “lazy” procedure so the AI will usually gather its armies along the borders before it finally decides to invade. Also AI will train its best available units and agents – do not be surprised when an AI assassin kills your favourite general. For the human player this knowledge is not a big facilitation though, since the fact that AI is gathering its forces along the border does not mean that it is going to invade the player’s faction in the nearest future.


    In some circumstances (for instance when the player does not wage a war with its neighbors), a neutral AI faction will also keep its garrisons on the border, just as it waged a war against the (neutral) player. This AI behavior may change when the it is in war with other factions – in such case it may send all its forces to the endangered front.

    War


    The highest priority of AI is besieging settlements – AI uses almost all its military potential on a given front to besiege settlements. It is probably not the best solution but taking into account the limitations of the M2TW engine it seems to be pragmatic and sufficient – otherwise AI would wander its armies aimlessly over the map.
    Then, as a second priority, AI tries to attack the available targets in range, so sometimes when besieging a settlement, another AI army may come to support the siege or even attack a defending player’s army which stands near the besieged settlement (to help defend it in case of assault), while the first AI army still keeps the siege.
    Finally, AI tries to do an “opportunistic attack”, which in some circumstances may ignore other AI settings and priorities. But thanks to this “opportunistic” possibility, AI is more “intelligent” and able to use some unexpected situations to its benefit. Since AI tries to besiege settlements, sometimes it may happen that it will spare player’s army standing on the bridge / ford and will walk around to lay a siege to a settlement or spare the closest strongly garrisoned settlement to lay a siege to the weaker one.


    - AI trains the troops of good quality, generally better than in the majority of mods I’ve seen and I think even better than in the original EB2 (no offence to the original EB CAI coder) since the troops quality depends mainly on the tactics settings in file descr_campaign_ai_db – I don’t know whether the twc modders know that.


    - The additional advantage of such tactics is the AI ability of starving the besieged settlements – AI will not attack until it is certain that it will win (taking into account the result of the autocalc battle).


    - AI is able to hire the mercenaries, which I did not observe frequently using other M2TW CAIs,


    - Of course AI can spam agents in some circumstances (especially the pesky merchants but these are no longer in EB2),


    - When AI declares a war, it can – especially when the border is long – attack simultaneously with several armies in different places along the border, which can demolish a careless player (I hope you don’t use the unhistorical “reload”).


    - AI uses its agents better,


    - AI can successfully strike with a really good sea invasion. This part of the code is perhaps not perfect but in my view it is quite good in comparison to other M2TW CAIs - I would like to see a CAI code which does it better.


    Defence:


    - Here I coded the AI in such a way that it is not so easy to conquer the settlements by attacking an army standing near the settlement and wiping out the settlement garrison that joins the battle as reinforcements (AI tries to place its armies a bit farther from settlements).

    If the total strength ratio on a given front is unfavorable to AI, it will not attack openly but will rather sit in garrisons or try to defend based on bridges / fords and prepare ambushes in forests. On some occasions AI fooled me with the following scheme: I see a weak army near the forest, attack, the AI withdraws to the forest, I attack… and then I am ambushed by significantly stronger AI army. This is not very frequent but the AI in the old M2TW can show some tricks – it’s a pity that the original authors made so weak use of the AI potential in the vanilla game.

    Even on N difficulty if an AI faction concludes that it no longer have common interests with the player and at the same time the AI faction is not in war against any of its neighbours, it may break the alliance with the player. In such case only relations 10/10 or 9/10 can protect the player from breaking the alliance by the AI. If AI is in war with a non-neighbouring faction, it does not count as a war and AI may break the alliance as soon as its common interests with the player end.
    Thank you for the translation Polehammer.




    Thanks for Araven for help in testing.


    Battle AI: I reworked AI Germanicu
    Last edited by Piterx93; May 05, 2020 at 01:03 AM.

  2. #2

    Default Re: PiterAI (new CAI)

    Nice looking AI, I will test it out when I have the time. Also, I have messaged you about something else, so please reply when you have the time.

  3. #3
    _Tartaros_'s Avatar "Harzschütze"
    Join Date
    Aug 2009
    Location
    kvet.lɪnˌbuʁk
    Posts
    4,492

    Default Re: PiterAI (new CAI)

    hi,
    i´ve got a question. did in piterCai small factions will attack big factions if there is local superiority, regardless the size of the faction?
    i asked because i observed in XCAI´s that a small factions ships it fullstack to an island (5 units garrison) held by a big (human) faction, but don´t attack and leave after some turns, even on very hard and war-status between both faction since the beginning (rating of 01/10).

    edit - i use RealBad AI and found this settings:

    Quote Originally Posted by Piterx93 View Post
    As for the vanilla, and add-ons kingdoms. You can install G5 ReallyBadAI Battle System v5.7 and add my AI.

    You just change the file strat and and additionally config_ai_battle

    <friendly-to-enemy-strength-ratio>1.5</friendly-to-enemy-strength-ratio>



    replace on
    <friendly-to-enemy-strength-ratio>0.5</friendly-to-enemy-strength-ratio>
    i will change it to 0.5 and observe
    Last edited by _Tartaros_; January 16, 2018 at 04:54 PM.

  4. #4

    Default Re: PiterAI (new CAI)

    Quote Originally Posted by _Tartaros_ View Post
    hi,
    i´ve got a question. did in piterCai small factions will attack big factions if there is local superiority, regardless the size of the faction?
    i asked because i observed in XCAI´s that a small factions ships it fullstack to an island (5 units garrison) held by a big (human) faction, but don´t attack and leave after some turns, even on very hard and war-status between both faction since the beginning (rating of 01/10).

    edit - i use RealBad AI and found this settings:



    i will change it to 0.5 and observe
    And how observations? Maybe you have AI on your disk because I lost it.

  5. #5
    _Tartaros_'s Avatar "Harzschütze"
    Join Date
    Aug 2009
    Location
    kvet.lɪnˌbuʁk
    Posts
    4,492

    Default Re: PiterAI (new Artificial intelligence)

    haha, ´ve found the solution indeed. i simply changed the faction charactereristic in descr_strat into "sailor napoleon"
    this worked for me and chandeax (the faction in TGC mods) ships it´s army to naxos (Eastern Roman Empire - very big faction) and attack

    anyway, just a question - do you have the time to implant a PiterAI for TGC-mod?
    i´ve currently use two with an optional switch at gamestart and i´m thinking of replacing the second one (to passive).

  6. #6
    Dismounted Feudal Knight's Avatar my horse for a unicode
    Content Director Citizen

    Join Date
    Aug 2017
    Location
    there!
    Posts
    3,133
    Blog Entries
    1

    Default Re: PiterAI (new Artificial intelligence)

    I'm curious if it is possible for generals to be made less, well, silly. More battle use, less being literally all left behind as one unit garrisons.

  7. #7

    Default Re: PiterAI (new Artificial intelligence)

    Quote Originally Posted by _Tartaros_ View Post
    haha, ´ve found the solution indeed. i simply changed the faction charactereristic in descr_strat into "sailor napoleon"
    this worked for me and chandeax (the faction in TGC mods) ships it´s army to naxos (Eastern Roman Empire - very big faction) and attack

    anyway, just a question - do you have the time to implant a PiterAI for TGC-mod?
    i´ve currently use two with an optional switch at gamestart and i´m thinking of replacing the second one (to passive).
    Do you have this AI on your disk? I am particularly interested in the descr_strat file with changed country borders and my campaign_script.



    You can change the descr_strat file in your modification and enter "ai_label default" everywhere.

    https://drive.google.com/open?id=13r...xMnjworvs-0-7Q

    and install it:

    https://www.twcenter.net/forums/show...r-AI-(new-CAI)

    very important:
    config_ai_battle

    https://drive.google.com/open?id=1XHzbguhMpiKGxLcMnpQXE6gDhWDqMGm7


    It is also very important that there are not too many armies in my opinion. AI stupid when trade and taxes develop too well. Without it, the game is very easy.

    descr_settlement_mechanics

    https://drive.google.com/open?id=1-k...taVxXb2b8fy3mL


    You can ignore descr_campaign_db.

    descr_campaign_ai_db is of course necessary.

    Quote Originally Posted by CommodusIV View Post
    I'm curious if it is possible for generals to be made less, well, silly. More battle use, less being literally all left behind as one unit garrisons.
    Try it: https://www.twcenter.net/forums/show...-intelligence)


    But this only works for kingdom campaigns.
    Last edited by Piterx93; May 03, 2020 at 10:28 AM.

  8. #8
    _Tartaros_'s Avatar "Harzschütze"
    Join Date
    Aug 2009
    Location
    kvet.lɪnˌbuʁk
    Posts
    4,492

    Default Re: PiterAI (new Artificial intelligence)

    hi, it seems like there are two missing " befor two numbers, resulting in a code error. the file is in your Medieval II Bellum Crucis PiterAI
    i´ve uploaded a correct version of descr_campaign_ai_db
    Attached Files Attached Files

  9. #9

    Default Re: PiterAI (new Artificial intelligence)

    Quote Originally Posted by _Tartaros_ View Post
    hi, it seems like there are two missing " befor two numbers, resulting in a code error. the file is in your Medieval II Bellum Crucis PiterAI
    i´ve uploaded a correct version of descr_campaign_ai_db
    Thanks. I thought it was impossible to start the game if there was an error in the code. Fortunately, this was not an important part.

  10. #10
    _Tartaros_'s Avatar "Harzschütze"
    Join Date
    Aug 2009
    Location
    kvet.lɪnˌbuʁk
    Posts
    4,492

    Default Re: PiterAI (new Artificial intelligence)

    no problem, just for info - i´ve added your campaign ai and added some issue you posted for testing right now.

  11. #11

    Default Re: PiterAI (new Artificial intelligence)

    Is this the version for retrofit? it seems that the download link has dissapeared

  12. #12

    Default Re: PiterAI (new Artificial intelligence)

    Quote Originally Posted by Clone_Two View Post
    Is this the version for retrofit? it seems that the download link has dissapeared
    I don't have a link to this AI.

  13. #13
    bitterhowl's Avatar Campidoctor
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    1,695

    Default Re: PiterAI (new Artificial intelligence)

    Always wondered about Germanicus script changes mentioned in OP. You meant battle_config and config_ai_battle changes?

    And here we go with Retrofit https://drive.google.com/file/d/1kQ2...ew?usp=sharing
    Last edited by bitterhowl; May 05, 2020 at 07:57 PM.

    My sister, do you still recall the blue Hasan and Khalkhin-Gol?
    Russian warship is winning. Proofs needed? Go find yourself!

  14. #14

    Default Re: PiterAI (new Artificial intelligence)

    Quote Originally Posted by bitterhowl View Post
    Always wondered about Germanicus script changes mentioned in OP. You meant battle_config and config_ai_battle changes?

    And here we go with Retrofit https://drive.google.com/file/d/1kQ2...ew?usp=sharing
    A small change in config_ai_battle and descr_campaign_ai_db also has a big impact.

  15. #15
    bitterhowl's Avatar Campidoctor
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    1,695

    Default Re: PiterAI (new Artificial intelligence)

    That's true. I'm making tactical changes merging many AI mod's.xml, hope to release soon.

    My sister, do you still recall the blue Hasan and Khalkhin-Gol?
    Russian warship is winning. Proofs needed? Go find yourself!

  16. #16

    Default Re: PiterAI (new Artificial intelligence)

    What is this mod for? For the retrofit mod or for another mod completely?

  17. #17

    Default Re: PiterAI (new Artificial intelligence)

    Quote Originally Posted by sullivanclan1 View Post
    What is this mod for? For the retrofit mod or for another mod completely?
    For the retrofit mod.

  18. #18
    _Tartaros_'s Avatar "Harzschütze"
    Join Date
    Aug 2009
    Location
    kvet.lɪnˌbuʁk
    Posts
    4,492

    Default Re: PiterAI (new Artificial intelligence)

    just for info, your CAI works well in my build and i´m going to see how faction behave diffrently. First observtion is, Rebels attack weak spots (undermaned forts) and AI-faction gathering fullstacks for overwhelming attacks. for now i´m very pleased and see how things progress

  19. #19

    Default Re: PiterAI (new Artificial intelligence)

    Did you make any changes to the mod or kept it the same?

  20. #20

    Default Re: PiterAI (new Artificial intelligence)

    Quote Originally Posted by sullivanclan1 View Post
    Did you make any changes to the mod or kept it the same?

    Only the AI ​​and game mechanics are changed. If I understood the question correctly.

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

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