Results 1 to 16 of 16

Thread: Number of alliances

  1. #1

    Default Number of alliances

    I added some custom descr_campaign_ai_db.xml , and now crazy AI makes so many alliances. In my current campaign with Venice I'm in war with HRE. HRE has 10 alliances and because of that many factions attacked me. So this is question: can I limit number of alliances that can be made?

  2. #2
    z3n's Avatar State of Mind
    took an arrow to the knee

    Join Date
    Aug 2011
    Posts
    4,640

    Default Re: Number of alliances

    You can't limit the number of alliances directly (or at least no way comes to mind right now).

    What you can do is make a defense decision entry like this, although it will not be a guaranteed fix.

    Code:
                <decision_entry>
                <!--
                ignore those who are not our neighbour
                -->
                    <min_entry    num_settlements = "1" target_faction_standing = "-0.1" is_neighbour = "false"/>
                    <max_entry is_neighbour = "false"/>
                    <faction_attitude defense = "defend_minimal" pts_alliance = "-999" want_ally = "false"/>
                </decision_entry>
    The AI Workshop Creator
    Europa Barbaroum II AI/Game Mechanics Developer
    The Northern Crusades Lead Developer
    Classical Age Total War Retired Lead Developer
    Rome: Total Realism Animation Developer
    RTW Workshop Assistance MTW2 AI Tutorial & Assistance
    Broken Crescent Submod (M2TW)/IB VGR Submod (BI)/Animation (RTW/BI/ALX)/TATW PCP Submod (M2TW)/TATW DaC Submod (M2TW)/DeI Submod (TWR2)/SS6.4 Northern European UI Mod (M2TW)

  3. #3

    Default Re: Number of alliances

    Hi guys, I discovered that if you change the descr_diplomacy like this:

    <item name="offer_alliance">
    <cost modifier="-2.0"/>
    <faction_standing modifier="1.0"/>
    <global_standing modifier="1.0"/>
    </item>


    The AI is very unwilling to ally, one needs to pay a lot for alliances. The problem is that the alliances between AI doesn't happen either. Is it possible somehow to leave this entry as above, but change campaign_ai so that the ai allies between themselves?

  4. #4
    z3n's Avatar State of Mind
    took an arrow to the knee

    Join Date
    Aug 2011
    Posts
    4,640

    Default Re: Number of alliances

    This could help

    (remember you may want other conditions here or for it to be random)
    target_human = false
    pts_alliance=x or want_ally = true
    The AI Workshop Creator
    Europa Barbaroum II AI/Game Mechanics Developer
    The Northern Crusades Lead Developer
    Classical Age Total War Retired Lead Developer
    Rome: Total Realism Animation Developer
    RTW Workshop Assistance MTW2 AI Tutorial & Assistance
    Broken Crescent Submod (M2TW)/IB VGR Submod (BI)/Animation (RTW/BI/ALX)/TATW PCP Submod (M2TW)/TATW DaC Submod (M2TW)/DeI Submod (TWR2)/SS6.4 Northern European UI Mod (M2TW)

  5. #5

    Default Re: Number of alliances

    Even if I make <cost modifier="-0.1"/> it prevents the alliances of ai (whatever negative number). It seems that no matter what I try in the campaign_ai the alliances are very easy to make. I may have in the log: want_ally=0, pts_alliance= -300 and the ai agrees to ally very easy anyway. I am trying to figure something out, because if the alliances were more difficult I could make the ai more trustworthy, otherwise it make the game too easy.
    Last edited by Macaras; March 09, 2022 at 09:13 PM.

  6. #6
    z3n's Avatar State of Mind
    took an arrow to the knee

    Join Date
    Aug 2011
    Posts
    4,640

    Default Re: Number of alliances

    I'm not sure I understand, so you want to prevent alliances in the campaign to the human? Or the AI? Or both?


    edit:

    Nevermind, I understand. So want_ally and pts_alliance doesn't work for you, they still ally. That's pretty strange.


    Is alliance_against in your campaign ai?
    Last edited by z3n; March 09, 2022 at 10:30 PM.
    The AI Workshop Creator
    Europa Barbaroum II AI/Game Mechanics Developer
    The Northern Crusades Lead Developer
    Classical Age Total War Retired Lead Developer
    Rome: Total Realism Animation Developer
    RTW Workshop Assistance MTW2 AI Tutorial & Assistance
    Broken Crescent Submod (M2TW)/IB VGR Submod (BI)/Animation (RTW/BI/ALX)/TATW PCP Submod (M2TW)/TATW DaC Submod (M2TW)/DeI Submod (TWR2)/SS6.4 Northern European UI Mod (M2TW)

  7. #7

    Default Re: Number of alliances

    Is alliance_against in your campaign ai?
    Yes, a lot, I am using piterAI, there are many entries with alliance_against..

  8. #8
    z3n's Avatar State of Mind
    took an arrow to the knee

    Join Date
    Aug 2011
    Posts
    4,640

    Default Re: Number of alliances

    I assume you realized but that is why, you need to remove all alliance_against for any tests using the other 2 (want ally and alliance pts) to be valid.

    Also to quote CavalryCmdr (my experience as well)

    alliance_against

    Kind of a third party reference. If the AI has a positive number here it is added to the “pts_alliance”
    to any faction that is not allied with the faction they want an alliance against. I’m not sure if negative numbers are usable or effective. Update: it is cumulative turn-turn which can result in crazy high (as in 100’s) numbers which in turn will cause am uncontrolled and often undesired, number of alliances as everyone tries to form an alliance against everyone else.
    Use with caution.
    Not sure how the pts are added but I always saw huge numbers of alliances with alliance_against. It was not viable to include it, maybe at a low random chance but I never tried that.
    Last edited by z3n; March 10, 2022 at 11:18 AM.
    The AI Workshop Creator
    Europa Barbaroum II AI/Game Mechanics Developer
    The Northern Crusades Lead Developer
    Classical Age Total War Retired Lead Developer
    Rome: Total Realism Animation Developer
    RTW Workshop Assistance MTW2 AI Tutorial & Assistance
    Broken Crescent Submod (M2TW)/IB VGR Submod (BI)/Animation (RTW/BI/ALX)/TATW PCP Submod (M2TW)/TATW DaC Submod (M2TW)/DeI Submod (TWR2)/SS6.4 Northern European UI Mod (M2TW)

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

    Default Re: Number of alliances

    I can say that PiterAI used.a little to much alliance_against options. When I edited it for BellumCrucis submod first I had plenty unhistorical and strange alliances, so I had to remove them completely and then added in very small amount.

    Also want to remind that most of diplomatic calculations and decisions are located in defence_decisions part so be sure your blocks for alliances are placed there.

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

  10. #10

    Default Re: Number of alliances

    Thanks for your help guys. My impression is that in general in the mods I played the alliances are too easy to make. I wish the AI was much more hesitant to ally with human, and some additional circumstances would be needed, like very good relation, common enemy, similarity of culture etc. My understanding of what happens is that in campaign_ai I can make the AI either want or not want an alliance. But the problem is that even if in the log ai doesn't want an alliance (want_ally=0) usually its still easy start an alliance in the game.

    So far the only way I found that makes alliances difficult is to change the <cost modifier="-2.0"/> or other negative value. But whenever it happens, the ai doesn't want to ally between themselves at all. I check the descr_diplomacy in tsardoms and bellum crucis and the cost is like this:

    <item name="offer_alliance">
    <cost modifier="0.008"/>
    <faction_standing modifier="20.0"/>
    <global_standing modifier="2.0"/>
    </item>

    but this doesn't make alliances difficult to make, it changes the demeanor but the differnece is like between "just accepted" or "accepted". The moment I make cost modifier negative I have to pay a lot for alliance.
    So what I am trying to achieve is keeping the cost modifier negative and find a way to encourage alliances between ai.
    I am checking the log and see that when cost is negative the pts_alliances and alliance_against are either 0 or just the value I set in the campaign_ai, for example:

    Spoiler Alert, click show to read: 
    LTGD: decision parameters 'pisa' (ai_label:default) vs faction 'venice':
    21:53:25.047 [ai.ltgd] [info] <27> military: frontline_balance 3.55631e-005, military_balance 1.53818, military_balance_plus_enemies 0.665995, alliance_military_balance 1.53818, free_strength_balance 9.6367e-005
    21:53:25.047 [ai.ltgd] [info] <27> faction standing: faction_standing -0.21652, target_faction_standing -0.282896, global_standing -0.299296, target_global_standing 0.347029
    21:53:25.047 [ai.ltgd] [info] <27> diplomacy: stance AtWar, num_enemies 1, target_num_enemies 1, has_alliance_against 0, num_turns_allied 0, num_turns_ceasefire -1
    21:53:25.047 [ai.ltgd] [info] <27> trusted_allies: trusted_ally 0, trusted_ally_enemy 0, trusted_ally_protectorate 0
    21:53:25.047 [ai.ltgd] [info] <27> protectorate: is_protectorate 0, is_protectorate_of_catholic 0
    21:53:25.047 [ai.ltgd] [info] <27> papal: excommunicated 0, enemy_excommunicated 0, has_ceasehostilities 0
    21:53:25.047 [ai.ltgd] [info] <27> neighbour: is_neighbour 1, target_weakest_neighbour 0, strongest_neighbour 0, borders_all_our_regions 0
    21:53:25.047 [ai.ltgd] [info] <27> win conditions: is_faction_to_outlive_target 0, is_target_faction_to_outlive 1
    21:53:25.047 [ai.ltgd] [info] <27> misc: production_balance 1.57981, target_religion 0, target_faction venice, num_settlements 5
    21:53:25.047 [ai.ltgd] [info] <27> rand 0.215674, difficulty very_hard, turn_number 24
    21:53:25.048 [ai.ltgd] [info] <27> most_desirable 1, target_human 0, target_is_shadow 0
    21:53:25.048 [ai.ltgd] [info] <27> LTGD: (default) defend decision: defend = defend_deep, defend_priority = -1, at_war = 1, want_peace = 1, want_ally = 0, want_be_protect = 0, alliance_against = 740, pts_alliance = 300


    And this is only because I added an entry:

    <decision_entry>
    <min_entry stance="Neutral" target_human="false"/>
    <max_entry stance="Neutral" target_human="false"/>
    <faction_attitude want_ally="true" pts_alliance = "300" continue = "true"/>
    </decision_entry>

    Anyway, I will try to check some values for alliance_against and pts_alliance..

  11. #11
    z3n's Avatar State of Mind
    took an arrow to the knee

    Join Date
    Aug 2011
    Posts
    4,640

    Default Re: Number of alliances

    Wow, that's a massive number for alliance_against and pts_alliance points! Over 700 and 300?


    You will easily see many alliances with that high of numbers. I strongly suggest removing all alliance_against and pts_alliance alliance still. That's some crazy values! Try starting with very small values for pts_alliance.
    The AI Workshop Creator
    Europa Barbaroum II AI/Game Mechanics Developer
    The Northern Crusades Lead Developer
    Classical Age Total War Retired Lead Developer
    Rome: Total Realism Animation Developer
    RTW Workshop Assistance MTW2 AI Tutorial & Assistance
    Broken Crescent Submod (M2TW)/IB VGR Submod (BI)/Animation (RTW/BI/ALX)/TATW PCP Submod (M2TW)/TATW DaC Submod (M2TW)/DeI Submod (TWR2)/SS6.4 Northern European UI Mod (M2TW)

  12. #12

    Default Re: Number of alliances

    Ok thanks

  13. #13

    Default Re: Number of alliances

    So I think I will give up the idea of negative value for cost modifier.. Unfortunately whatever I do, regardless of alliance against, and pts_alliance - there is no alliances between the ai factions..

  14. #14
    z3n's Avatar State of Mind
    took an arrow to the knee

    Join Date
    Aug 2011
    Posts
    4,640

    Default Re: Number of alliances

    I am not sure how you would do that it may be messing with the fundamental nature of alliance making among AI.


    A cost implies a flat rate to reach the baseline. Maybe a very low rate like 0.000000001?
    The AI Workshop Creator
    Europa Barbaroum II AI/Game Mechanics Developer
    The Northern Crusades Lead Developer
    Classical Age Total War Retired Lead Developer
    Rome: Total Realism Animation Developer
    RTW Workshop Assistance MTW2 AI Tutorial & Assistance
    Broken Crescent Submod (M2TW)/IB VGR Submod (BI)/Animation (RTW/BI/ALX)/TATW PCP Submod (M2TW)/TATW DaC Submod (M2TW)/DeI Submod (TWR2)/SS6.4 Northern European UI Mod (M2TW)

  15. #15

    Default Re: Number of alliances

    Yes, it seems to work ! I tried 0.01 before- and thought that smaller numbers won't change much, but they do. I tested <cost modifier="0.0001"/> and it makes the alliances expensive for human and keep the AI allying with each other! I will test it some more, but it seem to work as intended..

  16. #16
    z3n's Avatar State of Mind
    took an arrow to the knee

    Join Date
    Aug 2011
    Posts
    4,640

    Default Re: Number of alliances

    Glad to hear!
    The AI Workshop Creator
    Europa Barbaroum II AI/Game Mechanics Developer
    The Northern Crusades Lead Developer
    Classical Age Total War Retired Lead Developer
    Rome: Total Realism Animation Developer
    RTW Workshop Assistance MTW2 AI Tutorial & Assistance
    Broken Crescent Submod (M2TW)/IB VGR Submod (BI)/Animation (RTW/BI/ALX)/TATW PCP Submod (M2TW)/TATW DaC Submod (M2TW)/DeI Submod (TWR2)/SS6.4 Northern European UI Mod (M2TW)

Posting Permissions

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