• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

metatoaster

Reticulator of Splines
138 Badges
Jan 8, 2012
364
461
  • Cities: Skylines
  • Warlock 2: The Exiled
  • Warlock 2: Wrath of the Nagas
  • Sword of the Stars
  • Hearts of Iron III
  • Crusader Kings II
  • Cities in Motion
  • Cities in Motion 2
  • Arsenal of Democracy
  • Stellaris: Digital Anniversary Edition
  • Rome: Vae Victis
  • Tyranny: Gold Edition
  • Crusader Kings II: Reapers Due
  • 500k Club
  • Stellaris: Leviathans Story Pack
  • Europa Universalis IV: El Dorado
  • Magicka: Wizard Wars Founder Wizard
  • Mount & Blade: With Fire and Sword
  • Crusader Kings II: Way of Life
  • Pillars of Eternity
  • Tyranny: Archon Edition
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Tyranny: Archon Edition
  • Achtung Panzer
  • Hearts of Iron IV Sign-up
  • Hearts of Iron IV: Cadet
  • Europa Universalis IV: Rule Britannia
  • BATTLETECH
  • Europa Universalis IV: Rights of Man
  • Stellaris: Apocalypse
  • Stellaris: Humanoids Species Pack
  • Hearts of Iron IV: Expansion Pass
  • Cities: Skylines - Green Cities
  • Europa Universalis IV
  • Stellaris: Synthetic Dawn
  • Hearts of Iron IV: Death or Dishonor
  • Steel Division: Normand 44 Sign-up
  • Surviving Mars
  • Cities: Skylines - Natural Disasters
  • Crusader Kings Complete
  • Europa Universalis IV: Mandate of Heaven
  • Hearts of Iron IV: No Step Back
  • Stellaris: Distant Stars
  • Cities: Skylines - Mass Transit
  • Steel Division: Normandy 44
  • Stellaris - Path to Destruction bundle
  • Crusader Kings II: Monks and Mystics
  • Hearts of Iron IV: Together for Victory
I'm tired of this ridiculous cycle:
  1. Fight war for chokepoint
  2. Win war
  3. Game imposes 10 year of truce with forced open borders (I couldn't believe it at first when I realized the game did that)
  4. AI construction ships cross chokepoint and blob behind it because you don't have enough influence/alloys to plug all the holes fast enough
  5. Fight war for this new chokepoint
  6. Goto #2
Since the forced open borders is hardcoded just to troll us, can we do something about the constructor ship AI? I just want them to be extremely scared of crossing through my territory. If that requires a special starbase building or module to make a system scary, it would be an acceptable limitation.

Alternatively, if there was a way to strongly dissuade the AI from taking systems next to a player, especially a strong and very angry empire who just beat you in a war, that would work too.

(BTW I've looked through existing mods, and the best people can come up with is stuff like ending the truce with a penalty, which feels like an exploit and is impractical if your fleet is deep into enemy territory when the war ends. I'm fine with the truce, it's the open borders for constructors that are offensive.)
 
You could try using ai_should_restrict_system in game_rules to make the ai restrict systems that meet certain criteria:
  • system doesn't have an owner
  • ai doesn't own a neighboring system
  • any neighboring system is owned by another empire which:
    • the ai has a truce with
    • is willing to attack the ai for the systems
      • hostile
      • using unrestricted wars
    • the ai doesn't want to go to war with
      • not rivaling
      • ai has a weaker fleet
  • possibly with exceptions for systems that are particularly tempting, such as ones with habitable planets, bypasses, enclaves, archaeology sites, etc.
That prevents any of their ships from entering the system though, not just constructors, which may give them trouble with any military ships that could get stuck on the wrong side of the chokepoint or with science ship access to debris from the war.

Something else you could experiment with is using those rules to change the ai_weight of starbase_level_outpost in starbase_levels from 1 to 0, but I'm not sure if that would actually effect whether or not the ai would choose to build an outpost - the comments in the file describe it as being used to determine which starbases to upgrade.

Or perhaps go into ship_sizes/00_starbases.txt and use those rules in the potential_construction block for starbase_outpost? That might be the best option. Something like:

Code:
potential_construction = {
    is_scope_type = planet
    is_primary_star = yes
    NOT = { exists = orbital_defence }
    # Added:
    OR = {
        from = { is_ai = no }
        any_neighbor_system = {
            exists = space_owner
            exists = from
            space_owner = { is_same_value = from }
        }
        NOT = {
            any_neighbor_system = {
                exists = space_owner
                exists = from
                space_owner = {
                    has_truce = from
                    has_policy_flag = unrestricted_wars
                    OR = {
                        is_rival = from
                        is_hostile = from
                    }
                    relative_power = {
                        who = from
                        category = fleet
                        value > equivalent
                    }
                }
            }
        }
        # Add OR containing any exceptions the ai should risk war for here
    }
}
 
Thanks a lot @SirBlackAxe for the elaborate answer. The code block you provided looks like a very good starting point. I guess the condition I'd like to put in there is avoiding not only systems neighbouring mine, but any system that would require crossing my territory to get to. Though I imagine that would involve pathfinding (to simplify, always from their capital), which last I heard you don't want to touch with a ten foot pole in Stellaris modding.

What the game would really need is some kind of more fine-grained open borders concept. Such as "open only to ships that were already in the territory when the truce was signed, and they may only move in ways that bring them closer to their home territory." One can dream :p - maybe one of the devs will have a sudden summer inspiration.