The key thing I want to be able to support as a scripting requirement (either as a complex macro or directly as a Condition) is a DoesNotPartitionEmpires (or somesuch) scripting Condition/Macro, which takes as a condition a list of systems to be excluded from the system graph, and then (in the simplest form I am contemplating) returns a bool which is true if either (i) the excluded systems do not form one or more 'cuts' that divide the system graph into two or more subgraphs with no connections between them, or (ii) even if they do, their are no empire homesystems located outside of the largest of such subgraphs. A primary use would be to enable a location restriction for any special that could generate a Sentinel or Warden, so that they do not wall off an empire from the rest of the galaxy (can make for a very frustrating game if you are stuck on the smaller side of that blockade). I think this could also be used for the experimentor outpost location.
There are surely a variety of ways the main problem could be approached, what I am currently leaning towards is a "MainPartition" Condition, which takes a mandatory parameter "graph_excludes=" or just "excluding=" which specifies a condition for the systems to be excluded when making the partition/cut determination; this MainPartition Condition would then return all the systems which are in the largest subgraph (which, if the excluded systems do not form at least one 'cut' in the main system graph, would be all the non-excluded systems). If the two largest subgraphs are tied in size, then I would probably have this return no Systems (because that is the easiest way to support the kind of decision I want and I don't see a compelling need to accept a situation where the entire galaxy is divided in half by Sentinels/Wardens/Experimentors).
To facilitate this I would change the HasSpecial Condition (and parser) so that it could accepts a list of specials (like many of our other similar Conditions) rather than just a single special.
I would probably make a group of macros to facilitate this being used most easily, I think something like
Code: Select all
PARTITIONING_SPECIALS
'''ANCIENT_RUINS_SPECIAL
HONEYCOMB_SPECIAL
FORTRESS_SPECIAL
PANOPTICON_SPECIAL
GAIA_SPECIAL
'''
HEAVILY_GUARDED_SYSTEMS
'''And [
System
Contains condition = HasSpecial [ [[PARTITIONING_SPECIALS]] ]
]
'''
// Note, the following uses RootCandidate rather than LocalCandidate for efficiency, although that may limit
// the potential uses of this particular macro
NON_EMPIRE_PARTITIONING
'''Or [
ValueTest high = 0 testvalue = GalaxyMonsterFrequency
ValueTest
low = Count condition = And [System Contains Capital]
testvalue = Count condition = And [
MainPartition excluding = Or [ RootCandidate.System [[HEAVILY_GUARDED_SYSTEMS]] ]
Contains Capital
]
]
'''