Page 6 of 13 FirstFirst 12345678910111213 LastLast
Results 101 to 120 of 250

Thread: Skynet AI

  1. #101
    Jadli's Avatar The Fallen God
    Gaming Emeritus

    Join Date
    Dec 2013
    Location
    Czech Republic
    Posts
    8,528

    Default Re: Skynet AI

    Yay, thats quite an oversight How many poor mods have been unknowingly hit by this I wonder...

    At least I had to "learn" AI modding because of it. Though, I suppose I will still increase num_enemies to 2 in relevant lines (not the ones we were talking above, as those had num_enemies removed).

    Seems it now works as it should, with 30 turns test

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

    Join Date
    Aug 2011
    Posts
    4,640

    Default Re: Skynet AI

    Hmm. I don't recommend changing much in that version (it was made for DaC actually). I don't see the point of wars starting within the first 5 turns between neighbouring factions if there are slaves around.

    Generally a human player would refrain from doing so as well, unless they were "blitzing". And we both know the AI can't blitz.
    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. #103
    Jadli's Avatar The Fallen God
    Gaming Emeritus

    Join Date
    Dec 2013
    Location
    Czech Republic
    Posts
    8,528

    Default Re: Skynet AI

    Quote Originally Posted by z3n View Post
    Hmm. I don't recommend changing much in that version (it was made for DaC actually). I don't see the point of wars starting within the first 5 turns between neighbouring factions if there are slaves around.

    Generally a human player would refrain from doing so as well, unless they were "blitzing". And we both know the AI can't blitz.
    Well, I mean this one (in your original file it says 1)
    Spoiler Alert, click show to read: 
    Code:
    <decision_entry>
                <!--
                *invade immediate vs our allies enemy if we only have >=2 enemy
                -->
                    <min_entry    trusted_ally_enemy = "true"/>
                    <max_entry    num_enemies = "2"/>
                    <faction_attitude at_war = "true" can_force_invade = "true" invade = "invade_immediate"/>
                </decision_entry>


    It seems sense to me I should increase it when every facton has two enemies (slaves + kind of a different kind of slaves), right? Otherwise the AI would never invade their allies enemies?


    Also, if I would need to make a new ai_label for some factions, (in case i would need to enforce that faction to always be at war with other faction, or to never ally to a faction, etc), its fine if I just make a copy of yours "default" ai_label and just add the "diplomacy" decision entries, right? Your AI would still work fine?

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

    Join Date
    Aug 2011
    Posts
    4,640

    Default Re: Skynet AI

    Slaves don't count as enemies afaik, your "different kind of slaves" would since it's not the slave faction.

    You could verify this (i never really checked but in lgtd logs there would be entries like this as per alreadyded's post

    "15:48:07.961 [ai.ltgd] [info] <3> diplomacy: stance AtWar, num_enemies 2, target_num_enemies 0, has_alliance_against 0, num_turns_allied 0, num_turns_ceasefire -1"


    Yes it should be fine that way.
    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. #105
    Jadli's Avatar The Fallen God
    Gaming Emeritus

    Join Date
    Dec 2013
    Location
    Czech Republic
    Posts
    8,528

    Default Re: Skynet AI

    Quote Originally Posted by Jadli View Post
    I suppose I should have specififed what kind of faction would hold the forts in my initial thoughts. Doing it with rebels indeed made AI attack it and so on...

    But then I tried using another (freezed) faction for which I made sure they are always gonna be in good relations with AI, and it works. The AI absolutely doesnt care about it (tested for a lot of turns), neither does it seems to stack armies around or simply being affected by it anyhow. I assume if they were empty, they would care, but now they have no reason. To be clear, my intention is to have a lot of dungeons on the map, that the guild would task the player to take throughout the game, for special rewards and so on. I assume it gonna be the same.
    Small attendum to my "test"... When a faction turns horde, they may besiege some of those forts (as the horde is kinda meant to attack everyone around I suppose), tho they usually dont even finish the siege and move around...

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

    Join Date
    Aug 2011
    Posts
    4,640

    Default Re: Skynet AI

    Forts are broken, we removed them in EBII entirely.
    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. #107
    Jadli's Avatar The Fallen God
    Gaming Emeritus

    Join Date
    Dec 2013
    Location
    Czech Republic
    Posts
    8,528

    Default Re: Skynet AI

    Well, yea... But not my forts, my freezed forts are awesome!

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

    Join Date
    Aug 2011
    Posts
    4,640

    Default Re: Skynet AI

    Sorry what do you mean? I was referring to the AI being unable to cope with forts in general, not just hordes.
    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. #109

    Default Re: Skynet AI

    Quote Originally Posted by z3n View Post
    Forts are broken, we removed them in EBII entirely. [...] I was referring to the AI being unable to cope with forts in general, not just hordes.
    Could you elaborate on this or direct me to where you already have? In this thread we identified two ways to affect AI behavior towards forts. Using the merge_fort_priority_offset and defend_fortified params, I can get the AI to interact with forts more or less how I want them to with the only issue being that they don't attack empty enemy forts (leading me to believe that the AI doesn't attack forts so much as it attacks the units inside the fort). Is there something beyond this which breaks the AI's interaction with forts and would cause you to remove them from the game entirely?

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

    Join Date
    Aug 2011
    Posts
    4,640

    Default Re: Skynet AI

    The AI will often prioritize attacking a fort over attacking a settlement, which is not really the brightest approach. It can also get "broken" in determining what to garrison, the fort or the settlement, sometimes garrisoning the fort almost entirely rather than the settlement which simply doesn't make sense.
    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)

  11. #111
    Jadli's Avatar The Fallen God
    Gaming Emeritus

    Join Date
    Dec 2013
    Location
    Czech Republic
    Posts
    8,528

    Default Re: Skynet AI

    Quote Originally Posted by z3n View Post
    Sorry what do you mean? I was referring to the AI being unable to cope with forts in general, not just hordes.
    I was just joking...

    I was talking about the specific situation in my mod, where I use forts only as dungeons, garissoned by a faction that is freezed via "freeze_ai_faction" and thus AI completely ignores, as I talked about a few months aog

  12. #112

    Default Re: Skynet AI

    Quote Originally Posted by z3n View Post
    The AI will often prioritize attacking a fort over attacking a settlement, which is not really the brightest approach.
    We know that the AI doesn't attack empty forts even if they're inside their own regions and controlled by an enemy faction. This leads me to believe that the AI doesn't actually "see" forts, they only see enemy units garrisoned inside the fort. They can "see" empty settlements and attack them, but not forts. If this is true, then what you're really saying is that the AI sometimes prioritizes attacking enemy armies over attacking enemy settlements... which doesn't seem controversial to me. I guess you could also say that the AI should always prioritize attacking the settlement over attacking a field army, but this doesn't seem like the brightest approach either. ( "One cannot maintain a siege with the enemy behind." - Saladin ;D )

    Do we know how AI armies decide where and when to attack? Presumably they only attack enemies (garrisoned or not) who are weaker than them. What if a strong AI army is presented with three weaker enemy armies of identical composition in the same region, one in a fort, one in the settlement, and one just standing around. Let's also say all three targets are the same distance from the AI army and on the same tile type (same climate, choke value, frontier value, etc.). Which target does the AI pick? How do the targets rank statistically? I haven't run this test (I expect for the most part the AI would just stand there or walk away) but I'd bet there's no difference between how often the AI targets the fort and how often they target the field army. There may be a difference between how often they target the settlement vs. the other two but if the AI is treating garrisoned forts and field armies the same, I'd call that a feature.

    Quote Originally Posted by z3n View Post
    It can also get "broken" in determining what to garrison, the fort or the settlement, sometimes garrisoning the fort almost entirely rather than the settlement which simply doesn't make sense.
    This seems to be a function of the merge_fort_priority_offset value and the individual AI's defend_fortified decisions. I noticed that the Skynet AI (as it appears in DAC at least) with a merge offset of -500 makes the AI allergic to forts such that they're never, ever garrisoned. Conversely, setting the param to an absurdly high value does indeed make the AI garrison their forts at the expense of their settlements. Values closer to 0 seem to be best - you still occasionally see the AI garrisoning forts with too many units, but they usually don't stay there and seem to do just fine defending their settlements as well.

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

    Join Date
    Aug 2011
    Posts
    4,640

    Default Re: Skynet AI

    For the player, the only care about taking over the settlement. What I've seen happen is one of two things, either the AI in the fort (with most of the units) will simply sit there while the player attacks the settlement never realizing that they have to first exit (which takes one turn), then move to attack the player (which takes another turn) or alternatively not do anything at all until the settlement gets taken. At that point they either freeze within the fort sitting there forever or finally move out, or get driven out by the AI / player.


    Do we know how AI armies decide where and when to attack?
    There are multiple variables involved which can also be overriden by a hardcoded "forced" attack (unless you turn that completely off). Basically three things come to mind, one victory condition settlements (which are prioritized over others generally), the strength of the units in the settlement vs their own available "free strength" armies (which aren't assigned to an attack), the distance and whether it's a naval invasion or not.

    However, the AI *only* thinks in terms of regions, it doesn't matter to it that region a is extremely close to region b. Even if it's army within the region could cross into the other region in a single turn and lift a siege, it won't actually do that. Instead it reverts to a long term planning algorithm which slowly dispatches an army to lift the siege in that other region. It won't immediately cross over and attack, this is presumably due to some free strength calculation (which depends on the region).

    If you're referring to solely within a region, I really never tested that extensively with forts after discovering how complicated they make things for the AI. It's simply better to remove them entirely, as they present too many variables to the AI to cope with effectively and can also bug it out as detailed above. If you're interested I suggest turning on the AI lgtd logs, they give a lot more concrete evidence and insight than I could about how to the AI uses invasion decisions, pick priorities and also selects targets.


    This seems to be a function of the merge_fort_priority_offset value and the individual AI's defend_fortified decisions.
    I vaguely recall turning it to -500 to prevent the AI from going into forts as part of an initial effort in EBII, to prove that we could make "fake" minor settlements with trading resources under them generating income and having a name displayed (the idea was to have immortal invisible merchants with names). It never came to fruition though.

    And I agree. What an "offset" probably means in this case, is that 0 is actually the baseline. However, generally I wasn't familiar with coding as I did most of that stuff years ago before I ever received a formal education in it.
    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)

  14. #114

    Default Re: Skynet AI

    Quote Originally Posted by z3n View Post
    For the player, the only care about taking over the settlement.
    This implies that whenever the player invades a region, they make a decision between attacking the settlement and attacking forts and they never decide to attack the forts because they have no value (for the player or the AI) relative to settlements. Therefore, the AI should never defend their forts because only the settlement has value. It follows that when it's the AI's turn to invade a region, they should never attack forts either for the same reason.

    But the AI does attack forts with enemy units in them presumably for the sole reason that there are enemy units in them. Is this not reason enough for the human player to also attack AI forts? When we then we factor in the strategic value of the fort, the upkeep value, and any script-related value, we see that the player does have a reason (or several) to attack forts even if they're still less valuable on the whole than settlements. So if the player has a reason to attack forts, shouldn't the AI try to defend them? Forts don't exist in a vacuum - they have to be in regions with settlements. So if the AI ever decides to defend their forts, you could say it's at the expense of the region's settlement but I don't think this is a bad thing unless forts have no value.

    Quote Originally Posted by z3n View Post
    What I've seen happen is one of two things, either the AI in the fort (with most of the units) will simply sit there while the player attacks the settlement never realizing that they have to first exit (which takes one turn), then move to attack the player (which takes another turn) or alternatively not do anything at all until the settlement gets taken. At that point they either freeze within the fort sitting there forever or finally move out, or get driven out by the AI / player.
    I sometimes see the AI get stuck in their forts when they're in foreign-controlled regions. It's almost as if the AI army was "left behind" and just gets stuck behind enemy lines holed up in their fort. This wouldn't be problematic except that they don't seem to be capable of moving out to attack the settlement even if it's totally defenseless - it's like the AI is no longer controlling the army stuck in the fort at all. I've also seen this happen with armies that the AI moves onto fleets - the fleet just hovers around the coastline and the army never gets off as if the AI still controls the fleet but relinquished control of the army inside. Come to think of it, I've only really observed this peculiar behavior for the England AI in the Britannia campaign. I'll have to look into that.

    For the most part, the AI seems to be really good about combining their forces to fend of a siege of one of their settlements. Conversely, I've never seen them actively defend their forts (even though I'd love it if they did). They sometimes move troops into their forts (when the merge_fort_priority_offset is set to >= 0) but this is the extent of their ability to "defend" them.

    Quote Originally Posted by z3n View Post
    I vaguely recall turning it to -500 to prevent the AI from going into forts as part of an initial effort in EBII, to prove that we could make "fake" minor settlements with trading resources under them generating income and having a name displayed (the idea was to have immortal invisible merchants with names). It never came to fruition though.
    Minor settlements have come to fruition in my mod, hence my interest in this topic.

    Spoiler Alert, click show to read: 



    We're using merge_fort_priority_offset == 0 so that the AI at least passively garrisons their forts (they still won't actively defend them). I don't understand why you would want to make the AI allergic to forts for a minor settlements script.

  15. #115
    Jadli's Avatar The Fallen God
    Gaming Emeritus

    Join Date
    Dec 2013
    Location
    Czech Republic
    Posts
    8,528

    Default Re: Skynet AI

    BTW, I have always been curious regarding one thing....
    What is the difference for an AI, if for exampe an enemy army it wants to attack is nearby or when the army is also nearby, but in different region? I mean, does only the "distance" to the enemy army matter or more matters the region? to bring it to an extreme, if there was as "piece" of other enemy region (including the enemy) next to him and other enemy further away within his region? What would the AI do/choose?

    Aslo, I was wondering about something we tried years back, and not sure if it worked... if you for example wanted to "force" AI to rather attack some region/settlements across a water or an island, does putting a piece of that target region at the coast of the source faction theoretically help?
    Last edited by Jadli; December 21, 2020 at 04:48 AM.

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

    Join Date
    Aug 2011
    Posts
    4,640

    Default Re: Skynet AI

    Ehh sorry guys, I've been busy!

    But the AI does attack forts with enemy units in them presumably for the sole reason that there are enemy units in them. Is this not reason enough for the human player to also attack AI forts? When we then we factor in the strategic value of the fort, the upkeep value, and any script-related value, we see that the player does have a reason (or several) to attack forts even if they're still less valuable on the whole than settlements. So if the player has a reason to attack forts, shouldn't the AI try to defend them? Forts don't exist in a vacuum - they have to be in regions with settlements. So if the AI ever decides to defend their forts, you could say it's at the expense of the region's settlement but I don't think this is a bad thing unless forts have no value.
    My problem was that when the AI garrisons something, my observation is that they take upwards of two turns to finally move where they need to go. They first exit somewhere, then finally move the next turn. Slowing the AI down isn't something I wanted, since it's slow enough already.

    There's other problems too, like the AI sometimes not attacking AI forts because it views it as too strong. Or the player not caring the AI is in a fort or not noticing. Meanwhile the town gets taken and the AI freezes afterwords.

    Basically, they were an unnecessary variable and don't really add that much strategic value aside from that to a player. While also affecting the players challenge because the AI takes so long to ungarrison a fort (moving slowly out).

    What is the difference for an AI, if for exampe an enemy army it wants to attack is nearby or when the army is also nearby, but in different region? I mean, does only the "distance" to the enemy army matter or more matters the region? to bring it to an extreme, if there was as "piece" of other enemy region (including the enemy) next to him and other enemy further away within his region? What would the AI do/choose?
    Well from my observation region matters a lot more than distance. The AI will ignore armies in other regions even if they are in striking distance. I think this is because armies have to join the free strength pool before being allowed to be assigned to a new region. Not really sure how it works, but that's how I guessed it works.


    Aslo, I was wondering about something we tried years back, and not sure if it worked... if you for example wanted to "force" AI to rather attack some region/settlements across a water or an island, does putting a piece of that target region at the coast of the source faction theoretically help?
    I'm not really sure if it helps or not. In theory, it might confuse the AI to think the region is right next to it (land wise), but it will still realize the settlement is across the water. All it probably does is allow "is_neighbour" to be true.

    I think that water is a region of its own (so it realizes it has to enter another region before attacking the main region it wants to take). Like I said though, I'm not sure, since I haven't really mapped that much. What I can say is that invade_immediate, can_force_invade, and invade_buildup get the best results for attacking other regions. Especially when max invade priority is given within a decision.

    It means that if the AI decides to invade a place, it will use the max resources it can (meaning it will be willing to cross the water I'd say). These are all my theories though, and basically 99% of AI modding is guessing how the internal code works clunky as it may be.
    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)

  17. #117

    Default Re: Skynet AI

    Quote Originally Posted by z3n View Post
    ... when the AI garrisons something, my observation is that they take upwards of two turns to finally move where they need to go. They first exit somewhere, then finally move the next turn.
    I don't think this is a problem with forts so much as a problem with the AI moving in and out of residence. They stop after moving out of settlements every time, even if they obviously have movement points left. They also stop after getting off ships every time. I actually have yet to see them do this with forts, but I suppose it wouldn't surprise me. The way the AI moves its units in and out of settlements is quite mysterious and Benny-Hill-music-worthy.

    Quote Originally Posted by z3n View Post
    There's other problems too, like the AI sometimes not attacking AI forts because it views it as too strong.
    The AI definitely attacks forts if they know their army is stronger than the enemy garrison (passes some sort of strength ratio test). They won't attack ungarrisoned forts, but they definitely see the enemy units in the fort and will attack them probably using the same strength ratio calculation as for field armies. So what you're observing here probably doesn't have anything to do with the forts themselves, but just the fact that it takes the AI a long time to build up enough forces to pass the ratio test for attacking a full-stack of enemies (whether they're in the field, settlement, or fort). Additionally, if the fort is way behind their lines and garrisoned with a bunch of units, and they don't have any other reason to send armies behind their own lines, it will take them forever to deal with the fort on their land. In my experience, they will eventually get to it if diplomacy permits, but it will take a while.

    More Thoughts on the Matter

    In my experience with my own mod and vanilla, the presence of forts doesn't seem to have that much of an impact on AI performance. Putting rebel-garrisoned forts all over the map, as I have done, does slightly slow the expansion of AI factions as they take the time to siege all of those forts in their regions. But for the most part, even with the merge priority set to 0, the AI ignores forts and doesn't have an issue defending their own settlements. My only complaint so far has been that the AI can't "see" empty forts and since I_FactionNearTile is the only viable condition for testing if a faction is garrisoning a fort (setting aside spies), it's pretty trivial to cheese the AI by "garrisoning" forts with agents which the AI will never do anything about.

    It's possible that the real reason the AI doesn't attack empty enemy forts is because there's an error in CA's code where they divide by 0 (leading to an overflow value) for the strength ratio test and hence the AI never thinks they'll be able to win the battle. But... from what I can tell, the AI is simply ignoring empty forts and going about their business. If you move an army into their region, they will put units in the settlement to defend it, but if you leave an empty fort in their region, they don't seem to care.

    I reported earlier that the AI can sometimes get stuck in forts (or fleets) and never move out. My only experience of this happening is the England AI in the Britannia campaign, and I've come to realize the real reason for this has nothing to do with forts or England using a special CAI. The Welsh AI rushed England and took almost all of their regions before England could retreat their units and agents. Hence, the England AI was left with only one region on the map (in Ireland, a different landmass) and a bunch of assets all over the map. This sort of... kills the AI. It's not just their armies left behind in forts that have stopped moving, it's their field armies and agents as well. Their faction leader has been standing on the same tile in northern England for about 20 turns now.
    Last edited by Callistonian; December 27, 2020 at 06:33 AM.

  18. #118
    Jadli's Avatar The Fallen God
    Gaming Emeritus

    Join Date
    Dec 2013
    Location
    Czech Republic
    Posts
    8,528

    Default Re: Skynet AI

    Quote Originally Posted by z3n View Post
    Hmm. I don't recommend changing much in that version (it was made for DaC actually). I don't see the point of wars starting within the first 5 turns between neighbouring factions if there are slaves around.

    Generally a human player would refrain from doing so as well, unless they were "blitzing". And we both know the AI can't blitz.
    Though, are you sure you uploaded a correct version?

    Cause in yours is
    Code:
    <decision_entry>                <!--
                        invade immediate (is neighbour, bad standing, weak)
                    -->
                    <min_entry turn_number = "5" stance = "Neutral" target_human = "false" is_neighbour = "true"/>
                    <max_entry stance = "Neutral" frontline_balance = "0.5"/>
                    <faction_attitude at_war = "true" can_force_invade = "true" invade = "invade_immediate"/>
                </decision_entry>
    Which means that the attack will happen only if the frontline balance is smaller than 0.5, which is the exact opposite of what do we want, right? We would rather want it greater than 0.5.... And in DaC they replaced 0.5 with 5.0, so I suppose thats how it was meant to be?


    Also, when in descr_campaign_ai_db we would want to force factions to never attack or defend against a faction, these two decisions entries should be absolutely enought, right?

    Code:
    <decision_entry>                <min_entry    target_faction="papal_states" />
                    <max_entry    target_faction="papal_states" />
            <faction_attitude  defense="defend_minimal" continue="false"/>
         </decision_entry>
    Code:
    <decision_entry>                <min_entry    target_faction="papal_states"/>
                    <max_entry    target_faction="papal_states"/>
                    <faction_attitude invade = "invade_none" continue="false"/>
          </decision_entry>

    Cause the AI havent been entirely cooperative.. sometimes they stack armies around forts filled with units of this faction anyway... (is it better to have continue false or not?)

    EDIT
    Regarding the first part, in the newest DaC they actually also hae there 0.5... Though it confuses me, I probably think this it is doing the opposite than it is actually doing. So it means ration of frontline balance vs tha target, right? So the lower it is, the more likely is the faction to attack the target, right? So when you write it the way you have, hence min entry doesnt specifiy a value for frontline balance and the max_entry specifies 0.5, I assume it means the faction only attacks when the frontline balance is 0 and 0.5 which would be nonsense? So I assume it means the opposite then? That that max value is the lower one and not the bigger one, hence the faction is supposed to attack if it has 0.5 or more?
    Last edited by Jadli; January 02, 2021 at 03:27 PM.

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

    Join Date
    Aug 2011
    Posts
    4,640

    Default Re: Skynet AI

    You're asking me questions about something from almost 4 years ago. Maybe you're right to ask, so that I feel the urge to come back and fix silly mistakes.

    It might have been a typo but honestly, you should probably just remove it. IIRC CavalryCmdr recommended setting the value to 100000.0 or something high (which I agree with), I'm not sure why I put that 0.5 in there, I think it was a typo and should have been 5.0 but in retrospect no value there at all or an extremely high one like CC recommended is even better.


    If you haven't given this a read before I suggest you do, I relied heavily on his advice when starting out modding the AI before progressing. Hopefully you can build on my work too.

    https://medieval2.heavengames.com/m2...ay/index.shtml

    edit:
    Here's the relevant quote

    At first glance this appears fairly straight forward, a value of "2.0" should be twice the strength on border regions and for the most part it is. However the LTGD log (I'll cover that later) tells some interesting tales. Most importantly it is vital to specify "is_neighbour" when using this, secondly when units are on-board a fleet they create an unreadable frontline balance (ranging from 0.000001 or less to 100000.0 or more!) So an AI faction may have a frontline balance greater then 2.0 but actually have almost no troops in the border region, the higher "frontline_balance" being the result of troops on-board a fleet half way around the world. Therefore it is also very important to specify a min and max_entry generally I use 1000.0 and 0.001 as these numbers will never realistically be met with any significant meaning to them but will be met often and mean absolutely nothing but "frontline_balance" cannot effectively be read. "frontline_balance" cannot be used with non-neighbouring factions, it will either be 1.0 or an unreadable and meaningless number.

    He popped into this thread a while back, (I think because he was happy to see people working on the AI again, just like I am now ), you might be able to summon him back with a PM if he reads his email associated with TWC. I think there may be an automated email notification if you receive a PM, not really sure.

    Anyway, I'm here if you have any more questions I'll try to recall what my thought processes were.


    With "continue" I think what the AI does is that it continues within a loop of considering decisions until it hits a decision where continue does not exist. Then it stops (or it simply considers all decisions and if multiple decisions apply it tries to apply all of them). So it might combine invade build up and invade immediate, or the last known applicable decision.

    It's likely it settles on the last known applicable decision as the LTGD logs only have one decision applied (the invade decision and defense decision vs a faction).
    Last edited by z3n; January 03, 2021 at 05:05 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)

  20. #120
    Mr_Nygren's Avatar Berserkir
    Join Date
    Mar 2009
    Location
    Sweden
    Posts
    4,351

    Default Re: Skynet AI

    Hello guys, the very first custom AI I added to Warcraft: Total War was the Skynet AI back in early 2017. I loved in my playtesting how allies would aid the player against a common enemy and this is something I miss in the current version, and in other mods like Hyrule TW.

    However, the Skynet AI had a huge problem - it wouldn't attack strong factions and would just gather armies at the border when a neighbour were seen as too strong to invade. It's true in real-life that a nation wouldn't just attack a stronger faction out of the blue - but that's really boring in the campaign when the AI does nothing and just camp at the border. So after a suggestion from a team-member we changed out the Skynet-AI with the Stainless Steel super-aggressive one - where the AI will attack, attack and attack - which makes for a much more challenging and fun campaign - but I kind of miss the "allies are helping allies"-feature of your AI. Is there any easy way of adding that without removing the hyper-aggressive tendency of the SS-AI?

    Also, the Stainless Steel-AI won't invade continents far away unlike a different AI and I'm thinking maybe if I use that one instead then the ships might move troops to continents from other continents. That "AI ally helping allied player" is something I'd enjoy. Cause in most mods allies fight their own wars and never actually come to the aid of the player.. But I dislike when they are peaceful and just stand at the border like in the Skynet AI of three or four years ago.
    Last edited by Mr_Nygren; January 08, 2021 at 03:38 PM.
    Be your friend's, true friend. Return gift for gift. Repay laughter, with laughter again
    but betrayal with treachery.

    - The Havamal

Posting Permissions

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