Open Tbohunek opened 4 years ago
Here is how the Swamps currently look in my game:
To understand why Clear Sky isn't moving anywhere despite most of the Swamps being overrun by renegades and mutants, let's begin by looking at configs\misc\faction_csky.ltx. There, we will see (after filtering out irrelevant parameters):
[expansion_0]
precondition_power = .5
[expansion_1]
precondition_target = mar_smart_terrain_10_5 ; Machine yard
[expansion_2]
precondition_target = mar_smart_terrain_11_11 ; Southern farmstead
[expansion_3]
Now let's look at scripts\sim_faction_brain_human.script. There, we will see that only 'territory' and 'resource' smarts can be registered as power targets for Clear Sky, and only if at least one of the following requirements obtains:
So, only the three 'territory' type smarts Clear Sky already owns are registered as power targets for Clear Sky in my game. These are:
But power targets are not the only kind of faction target. There are also precondition targets. If we look again in sim_faction_brain_human.script, we can see that all of Clear Sky's precondition targets from expansion_0 to its current expansion (expansion_3) get registered as faction targets. There are two:
So, there are only four smart terrains that Clear Sky wants in my game:
Since they have already captured these smarts, there is no incentive for them to move from their current positions.
We can confirm that the analysis above is correct by enabling some additional debug messages in scripts\sim_faction.script and observing how Clear Sky squads are actually assigned individually. If we do that, we will see:
Iteration time for csky is 2329892.
Assigned csky squad with ID [lim_csky_storm_troops] to scripted target [Yard].
Assigned csky squad with ID [1] to scripted target [Clear Sky base].
Assigned csky squad with ID [2] to scripted target [Clear Sky base].
Assigned csky squad with ID [3] to scripted target [Clear Sky base].
Inserted csky squad with ID [6] and dest smart [Old church] to squad_need_task.
Inserted csky squad with ID [29] and dest smart [Machine yard] to squad_need_task.
Inserted csky squad with ID [27] and dest smart [Hidden camp] to squad_need_task.
Inserted csky squad with ID [4] and dest smart [Machine yard] to squad_need_task.
Inserted csky squad with ID [21] and dest smart [Machine yard] to squad_need_task.
Inserted csky squad with ID [28] and dest smart [Fishing hamlet] to squad_need_task.
Inserted csky squad with ID [15] and dest smart [Southern farmstead] to squad_need_task.
Inserted csky squad with ID [25] and dest smart [Fishing hamlet] to squad_need_task.
Inserted csky squad with ID [13] and dest smart [Lookout tower] to squad_need_task.
Inserted csky squad with ID [8] and dest smart [Fishing hamlet] to squad_need_task.
Inserted csky squad with ID [9] and dest smart [Southern farmstead] to squad_need_task.
Graph distance of csky squad with ID [4] to smart [Machine yard] is [0].
Graph distance of csky squad with ID [9] to smart [Machine yard] is [442.35504150391].
Graph distance of csky squad with ID [6] to smart [Machine yard] is [391.31555175781].
Graph distance of csky squad with ID [25] to smart [Machine yard] is [608.14910888672].
Graph distance of csky squad with ID [15] to smart [Machine yard] is [442.35504150391].
Graph distance of csky squad with ID [28] to smart [Machine yard] is [608.14910888672].
Graph distance of csky squad with ID [29] to smart [Machine yard] is [0].
Graph distance of csky squad with ID [13] to smart [Machine yard] is [487.97543334961].
Graph distance of csky squad with ID [21] to smart [Machine yard] is [0].
Graph distance of csky squad with ID [8] to smart [Machine yard] is [608.14910888672].
Graph distance of csky squad with ID [27] to smart [Machine yard] is [715.20190429688].
Graph distance of csky squad with ID [4] to smart [Fishing hamlet] is [608.14910888672].
Graph distance of csky squad with ID [9] to smart [Fishing hamlet] is [483.18765258789].
Graph distance of csky squad with ID [6] to smart [Fishing hamlet] is [298.75302124023].
Graph distance of csky squad with ID [25] to smart [Fishing hamlet] is [0].
Graph distance of csky squad with ID [15] to smart [Fishing hamlet] is [483.18765258789].
Graph distance of csky squad with ID [28] to smart [Fishing hamlet] is [0].
Graph distance of csky squad with ID [29] to smart [Fishing hamlet] is [608.14910888672].
Graph distance of csky squad with ID [13] to smart [Fishing hamlet] is [121.78340911865].
Graph distance of csky squad with ID [21] to smart [Fishing hamlet] is [608.14910888672].
Graph distance of csky squad with ID [8] to smart [Fishing hamlet] is [0].
Graph distance of csky squad with ID [27] to smart [Fishing hamlet] is [242.12115478516].
Graph distance of csky squad with ID [4] to smart [Old church] is [391.31555175781].
Graph distance of csky squad with ID [9] to smart [Old church] is [204.77093505859].
Graph distance of csky squad with ID [6] to smart [Old church] is [0].
Graph distance of csky squad with ID [25] to smart [Old church] is [298.75302124023].
Graph distance of csky squad with ID [15] to smart [Old church] is [204.77093505859].
Graph distance of csky squad with ID [28] to smart [Old church] is [298.75302124023].
Graph distance of csky squad with ID [29] to smart [Old church] is [391.31555175781].
Graph distance of csky squad with ID [13] to smart [Old church] is [194.38157653809].
Graph distance of csky squad with ID [21] to smart [Old church] is [391.31555175781].
Graph distance of csky squad with ID [8] to smart [Old church] is [298.75302124023].
Graph distance of csky squad with ID [27] to smart [Old church] is [507.03057861328].
Graph distance of csky squad with ID [4] to smart [Southern farmstead] is [442.35504150391].
Graph distance of csky squad with ID [9] to smart [Southern farmstead] is [0].
Graph distance of csky squad with ID [6] to smart [Southern farmstead] is [204.77093505859].
Graph distance of csky squad with ID [25] to smart [Southern farmstead] is [483.18765258789].
Graph distance of csky squad with ID [15] to smart [Southern farmstead] is [0].
Graph distance of csky squad with ID [28] to smart [Southern farmstead] is [483.18765258789].
Graph distance of csky squad with ID [29] to smart [Southern farmstead] is [442.35504150391].
Graph distance of csky squad with ID [13] to smart [Southern farmstead] is [394.06573486328].
Graph distance of csky squad with ID [21] to smart [Southern farmstead] is [442.35504150391].
Graph distance of csky squad with ID [8] to smart [Southern farmstead] is [483.18765258789].
Graph distance of csky squad with ID [27] to smart [Southern farmstead] is [706.79443359375].
Printing distance_table before squad-to-smart assignment:
[1] target_smart = [Machine yard], value = [2], pop = [0/3], squads =
[1] squad_id = [4], dist = [0]
[2] squad_id = [21], dist = [0]
[3] squad_id = [29], dist = [0]
[4] squad_id = [6], dist = [391.31555175781]
[5] squad_id = [9], dist = [442.35504150391]
[6] squad_id = [15], dist = [442.35504150391]
[7] squad_id = [13], dist = [487.97543334961]
[8] squad_id = [28], dist = [608.14910888672]
[9] squad_id = [25], dist = [608.14910888672]
[10] squad_id = [8], dist = [608.14910888672]
[11] squad_id = [27], dist = [715.20190429688]
[2] target_smart = [Southern farmstead], value = [2], pop = [0/1], squads =
[1] squad_id = [15], dist = [0]
[2] squad_id = [9], dist = [0]
[3] squad_id = [6], dist = [204.77093505859]
[4] squad_id = [13], dist = [394.06573486328]
[5] squad_id = [4], dist = [442.35504150391]
[6] squad_id = [21], dist = [442.35504150391]
[7] squad_id = [29], dist = [442.35504150391]
[8] squad_id = [28], dist = [483.18765258789]
[9] squad_id = [25], dist = [483.18765258789]
[10] squad_id = [8], dist = [483.18765258789]
[11] squad_id = [27], dist = [706.79443359375]
[3] target_smart = [Old church], value = [1], pop = [0/1], squads =
[1] squad_id = [6], dist = [0]
[2] squad_id = [13], dist = [194.38157653809]
[3] squad_id = [15], dist = [204.77093505859]
[4] squad_id = [9], dist = [204.77093505859]
[5] squad_id = [8], dist = [298.75302124023]
[6] squad_id = [25], dist = [298.75302124023]
[7] squad_id = [28], dist = [298.75302124023]
[8] squad_id = [21], dist = [391.31555175781]
[9] squad_id = [4], dist = [391.31555175781]
[10] squad_id = [29], dist = [391.31555175781]
[11] squad_id = [27], dist = [507.03057861328]
[4] target_smart = [Fishing hamlet], value = [1], pop = [0/1], squads =
[1] squad_id = [28], dist = [0]
[2] squad_id = [8], dist = [0]
[3] squad_id = [25], dist = [0]
[4] squad_id = [13], dist = [121.78340911865]
[5] squad_id = [27], dist = [242.12115478516]
[6] squad_id = [6], dist = [298.75302124023]
[7] squad_id = [15], dist = [483.18765258789]
[8] squad_id = [9], dist = [483.18765258789]
[9] squad_id = [21], dist = [608.14910888672]
[10] squad_id = [29], dist = [608.14910888672]
[11] squad_id = [4], dist = [608.14910888672]
Assigned csky squad with ID [4] to [Machine yard].
Made csky squad with ID [4] unassignable to [Fishing hamlet].
Made csky squad with ID [4] unassignable to [Old church].
Made csky squad with ID [4] unassignable to [Southern farmstead].
Made csky squad with ID [4] unassignable to [Machine yard].
Printing distance_table before squad-to-smart assignment:
[1] target_smart = [Southern farmstead], value = [2], pop = [0/1], squads =
[1] squad_id = [15], dist = [0]
[2] squad_id = [9], dist = [0]
[3] squad_id = [6], dist = [204.77093505859]
[4] squad_id = [13], dist = [394.06573486328]
[5] squad_id = [21], dist = [442.35504150391]
[6] squad_id = [29], dist = [442.35504150391]
[7] squad_id = [28], dist = [483.18765258789]
[8] squad_id = [25], dist = [483.18765258789]
[9] squad_id = [8], dist = [483.18765258789]
[10] squad_id = [27], dist = [706.79443359375]
[2] target_smart = [Machine yard], value = [2], pop = [1/3], squads =
[1] squad_id = [21], dist = [0]
[2] squad_id = [29], dist = [0]
[3] squad_id = [6], dist = [391.31555175781]
[4] squad_id = [9], dist = [442.35504150391]
[5] squad_id = [15], dist = [442.35504150391]
[6] squad_id = [13], dist = [487.97543334961]
[7] squad_id = [28], dist = [608.14910888672]
[8] squad_id = [25], dist = [608.14910888672]
[9] squad_id = [8], dist = [608.14910888672]
[10] squad_id = [27], dist = [715.20190429688]
[3] target_smart = [Old church], value = [1], pop = [0/1], squads =
[1] squad_id = [6], dist = [0]
[2] squad_id = [13], dist = [194.38157653809]
[3] squad_id = [15], dist = [204.77093505859]
[4] squad_id = [9], dist = [204.77093505859]
[5] squad_id = [8], dist = [298.75302124023]
[6] squad_id = [25], dist = [298.75302124023]
[7] squad_id = [28], dist = [298.75302124023]
[8] squad_id = [21], dist = [391.31555175781]
[9] squad_id = [29], dist = [391.31555175781]
[10] squad_id = [27], dist = [507.03057861328]
[4] target_smart = [Fishing hamlet], value = [1], pop = [0/1], squads =
[1] squad_id = [28], dist = [0]
[2] squad_id = [8], dist = [0]
[3] squad_id = [25], dist = [0]
[4] squad_id = [13], dist = [121.78340911865]
[5] squad_id = [27], dist = [242.12115478516]
[6] squad_id = [6], dist = [298.75302124023]
[7] squad_id = [15], dist = [483.18765258789]
[8] squad_id = [9], dist = [483.18765258789]
[9] squad_id = [21], dist = [608.14910888672]
[10] squad_id = [29], dist = [608.14910888672]
Assigned csky squad with ID [15] to [Southern farmstead].
Removed [Southern farmstead] from distance_table since its capacity (1) is saturated (1).
Made csky squad with ID [15] unassignable to [Fishing hamlet].
Made csky squad with ID [15] unassignable to [Old church].
Made csky squad with ID [15] unassignable to [Machine yard].
Printing distance_table before squad-to-smart assignment:
[1] target_smart = [Machine yard], value = [2], pop = [1/3], squads =
[1] squad_id = [21], dist = [0]
[2] squad_id = [29], dist = [0]
[3] squad_id = [6], dist = [391.31555175781]
[4] squad_id = [9], dist = [442.35504150391]
[5] squad_id = [13], dist = [487.97543334961]
[6] squad_id = [28], dist = [608.14910888672]
[7] squad_id = [25], dist = [608.14910888672]
[8] squad_id = [8], dist = [608.14910888672]
[9] squad_id = [27], dist = [715.20190429688]
[2] target_smart = [Old church], value = [1], pop = [0/1], squads =
[1] squad_id = [6], dist = [0]
[2] squad_id = [13], dist = [194.38157653809]
[3] squad_id = [9], dist = [204.77093505859]
[4] squad_id = [8], dist = [298.75302124023]
[5] squad_id = [25], dist = [298.75302124023]
[6] squad_id = [28], dist = [298.75302124023]
[7] squad_id = [21], dist = [391.31555175781]
[8] squad_id = [29], dist = [391.31555175781]
[9] squad_id = [27], dist = [507.03057861328]
[3] target_smart = [Fishing hamlet], value = [1], pop = [0/1], squads =
[1] squad_id = [28], dist = [0]
[2] squad_id = [8], dist = [0]
[3] squad_id = [25], dist = [0]
[4] squad_id = [13], dist = [121.78340911865]
[5] squad_id = [27], dist = [242.12115478516]
[6] squad_id = [6], dist = [298.75302124023]
[7] squad_id = [9], dist = [483.18765258789]
[8] squad_id = [21], dist = [608.14910888672]
[9] squad_id = [29], dist = [608.14910888672]
Assigned csky squad with ID [21] to [Machine yard].
Made csky squad with ID [21] unassignable to [Fishing hamlet].
Made csky squad with ID [21] unassignable to [Old church].
Made csky squad with ID [21] unassignable to [Machine yard].
Printing distance_table before squad-to-smart assignment:
[1] target_smart = [Machine yard], value = [2], pop = [2/3], squads =
[1] squad_id = [29], dist = [0]
[2] squad_id = [6], dist = [391.31555175781]
[3] squad_id = [9], dist = [442.35504150391]
[4] squad_id = [13], dist = [487.97543334961]
[5] squad_id = [28], dist = [608.14910888672]
[6] squad_id = [25], dist = [608.14910888672]
[7] squad_id = [8], dist = [608.14910888672]
[8] squad_id = [27], dist = [715.20190429688]
[2] target_smart = [Old church], value = [1], pop = [0/1], squads =
[1] squad_id = [6], dist = [0]
[2] squad_id = [13], dist = [194.38157653809]
[3] squad_id = [9], dist = [204.77093505859]
[4] squad_id = [8], dist = [298.75302124023]
[5] squad_id = [25], dist = [298.75302124023]
[6] squad_id = [28], dist = [298.75302124023]
[7] squad_id = [29], dist = [391.31555175781]
[8] squad_id = [27], dist = [507.03057861328]
[3] target_smart = [Fishing hamlet], value = [1], pop = [0/1], squads =
[1] squad_id = [28], dist = [0]
[2] squad_id = [8], dist = [0]
[3] squad_id = [25], dist = [0]
[4] squad_id = [13], dist = [121.78340911865]
[5] squad_id = [27], dist = [242.12115478516]
[6] squad_id = [6], dist = [298.75302124023]
[7] squad_id = [9], dist = [483.18765258789]
[8] squad_id = [29], dist = [608.14910888672]
Assigned csky squad with ID [29] to [Machine yard].
Removed [Machine yard] from distance_table since its capacity (3) is saturated (3).
Made csky squad with ID [29] unassignable to [Fishing hamlet].
Made csky squad with ID [29] unassignable to [Old church].
Printing distance_table before squad-to-smart assignment:
[1] target_smart = [Old church], value = [1], pop = [0/1], squads =
[1] squad_id = [6], dist = [0]
[2] squad_id = [13], dist = [194.38157653809]
[3] squad_id = [9], dist = [204.77093505859]
[4] squad_id = [8], dist = [298.75302124023]
[5] squad_id = [25], dist = [298.75302124023]
[6] squad_id = [28], dist = [298.75302124023]
[7] squad_id = [27], dist = [507.03057861328]
[2] target_smart = [Fishing hamlet], value = [1], pop = [0/1], squads =
[1] squad_id = [28], dist = [0]
[2] squad_id = [8], dist = [0]
[3] squad_id = [25], dist = [0]
[4] squad_id = [13], dist = [121.78340911865]
[5] squad_id = [27], dist = [242.12115478516]
[6] squad_id = [6], dist = [298.75302124023]
[7] squad_id = [9], dist = [483.18765258789]
Assigned csky squad with ID [6] to [Old church].
Removed [Old church] from distance_table since its capacity (1) is saturated (1).
Made csky squad with ID [6] unassignable to [Fishing hamlet].
Printing distance_table before squad-to-smart assignment:
[1] target_smart = [Fishing hamlet], value = [1], pop = [0/1], squads =
[1] squad_id = [28], dist = [0]
[2] squad_id = [8], dist = [0]
[3] squad_id = [25], dist = [0]
[4] squad_id = [13], dist = [121.78340911865]
[5] squad_id = [27], dist = [242.12115478516]
[6] squad_id = [9], dist = [483.18765258789]
Assigned csky squad with ID [28] to [Fishing hamlet].
Removed [Fishing hamlet] from distance_table since its capacity (1) is saturated (1).
... confirming that only the four aforementioned smart terrains are faction targets for Clear Sky in my game.
@Tbohunek Now that I've explained why the game currently works the way it does (with SRP v1.1.3), I'll address your concerns:
factions don't stick to hold key positions
They do, but the game's idea of "key positions" may differ from yours. In the SRP, only three 'tiers' of "key positions" are recognized:
In some circumstances, squads may abandon a power target or secondary target to capture a precondition target, but that's the only circumstance where squads will voluntarily stop holding a "key position" (in exchange for another).
factions [...] don't issue enough troops
The game's squad respawn system is rather nuanced, but as a general rule of thumb, a faction will spawn new squads only if it needs to, i.e. if its existing squads are moving around. In Clear Sky's special case, there is an additional requirement: there must be fewer than three squads at the 'Fishing hamlet'. In my game, there are exactly three squads there, so Clear Sky can't spawn new squads. And this situation won't change as long as Clear Sky squads aren't moving. And the reason they aren't moving was explained above: they are satisfied with what they already have.
Let me know what you think should change. One way you could make Clear Sky attempt to capture more 'territory' or 'resource' targets in your own game is to add the following line beneath [expansion_3]
in configs\misc\faction_csky.ltx:
precondition_power = .9
That should make Clear Sky vie for more power targets. If that doesn't work, try .95
or even 1
. Then Clear Sky won't stop taking power targets in the Swamps until they've eradicated all renegades from existence.
Wow, thanks for such a deep dive. :) I would exactly love to eradicate all renegades from existence
, and bandits and Duty/Freedom.. :D
Does this require a new game? Would such a simple trick also exist for Looners and Freedom/Duty?
You focused on Swamps, but since I left Garbage, Looners kept losing Cordon to mutants up to a point where they were only in their base and I had to come and wipe all mutants only for them to take over again before I finished Agrpprom. Like every 10 minutes they lose the northern outpost to Garbage and it's annoying, not to mention that my OCD wants all bandits dead.
Does this require a new game?
No, it'll take effect immediately after loading an existing save.
Would such a simple trick also exist for Looners and Freedom/Duty?
Yes, but the precondition_power
line only affects the expansion (~ faction war stage) for which it's defined in the appropriate configs\misc\faction_*.ltx file. So if you define the parameter in, say, faction_stalker.ltx's [expansion_5]
, it will only take effect after the stalkers have won their faction war against the bandits.
Looners kept losing Cordon to mutants
I occasionally hear this complaint. Mutants have multiple respawn points in the Cordon, but they only respawn at night. Loner squads are hard-coded to become 'braver' between 04:00 and 22:00, and so are likely to re-capture territory from mutants between those times. At night, mutants have the upper hand again. This pattern was likely intended by GSC.
my OCD wants all bandits dead.
You probably already know the solution to that: join the loners and help them capture the depot. Then bandits won't respawn anymore (outside of certain scripted situations, like the train tunnel in Agroprom).
Cool, I did that and watched them for a few hours: now they hold a lot more squads and don't die out, but neither CS nor Looners care about mutants much and they don't chase them, so there are still tons of them. Any way to make them "braver"?
Prior to SRP, it often happened that after taking the Depot, Looners just stopped trying and Bandits took it back...
Cool, I did that and watched them for a few hours: now they hold a lot more squads and don't die out, but neither CS nor Looners care about mutants much and they don't chase them, so there are still tons of them. Any way to make them "braver"?
Because both are only going after the enemy faction, with it being either Renegades or Bandits.
neither CS nor Looners care about mutants
They will only care about mutants if mutants have captured a power target they want to capture. The precondition_power = 1
trick makes it so a faction keeps targeting resource/territory smart terrains while any squads of their main enemy faction exist. Once their main enemy is completely wiped out, they will stop vying for power targets again.
both are only going after the enemy faction
Not exactly. To reiterate what I wrote above: precondition_power = 1
does not cause a faction to target enemy squads per se; it causes them to target resource/territory points, which may or may not be captured by their main enemy. And it will do this while any squads of their main enemy exist.
For some reason, GSC made a faction's _absolutepower depend only on the number and rank of NPCs in that faction's squads, rather than on the number of resource/territory points held by the faction. So, we end up in the strange situation where a faction's _relativepower -- _absolutepower / (_absolutepower + _main_enemy's_absolutepower) -- controls whether they want to capture more territory/resource targets, without however itself being directly affected by the number of territory/resource targets captured by the faction. Capturing power targets only increases a faction's _relativepower indirectly, by giving the faction a reason to spawn more squads to take over more power targets.
Prior to SRP, it often happened that after taking the Depot, Looners just stopped trying and Bandits took it back...
In the unmodded game, the final faction war phase only requires killing the inhabitants of the enemy base, whereas in the SRP, capturing the base is required. Capturing the enemy base prevents the enemy from respawning there (but doesn't prevent enemy squads coming back from elsewhere and retaking the base).
The reason why loners "stop trying" after winning against the bandits is that [expansion_5]
in faction_stalker.ltx contains no directives that would make them vie for more smart terrains after taking the depot.
Great. I was just afraid that increasing the precondition_power
somehow dis-balanced the ratios of mutants as there seem to be plenty. Moreover, it feels like if mutants do not raid so much now, they only breed. Is there maybe some dependency of whether mutants will raid base/spot versus number of guards there?
Is there maybe some dependency of whether mutants will raid base/spot versus number of guards there?
Yes. I've explained how that works in https://github.com/Decane/SRP/issues/69#issuecomment-552226223. Quoting myself:
Under "normal" circumstances in CS [...] squads will only move to a neighboring camp if their squad_power + attack_power exceeds the squad_power of the camp's current occupants.
More squads on a smart terrain obviously means the aggregate _squadpower of the squads on that smart terrain is also higher, and hence under "normal" circumstances, it will take longer for mutants to become 'brave' enough -- i.e. to attain enough _attackpower -- to attack that smart terrain. And in most circumstances, they will eventually attack it, because... I quote my own replies to https://github.com/Decane/SRP/issues/69 again:
[attack_power] rises over time to 100 by 1 point every game hour for mutants.
squad_power must never exceed 25
... which means that even if three loner squads, all with maxed out _squadpower, have captured a point, neighboring mutants will eventually attain an _attackpower rating which, together with the mutant squad's _squadpower rating, produces a sum that exceeds the 3 * 25 = 75 required for them to attack the loner-occupied point.
How about setting a condition, where after victory, a faction always looks out for at least all of the guide destination areas within their reach? How would that be for a compromise? I concur to the complaints about over-breeding mutants. In dark valley and agroprom it's usually quiet, but in cordon, garbage and marches they sometimes destroy the entirety of the locations.
Hey,
I'm really stunned that you still maintain SRP, that's awesome! So far I did not encounter any bug, but maybe something that could still be improved?
I feel that in fraction wars, factions don't stick to hold key positions and don't issue enough troops. Due to this, Renegades capture back half of Swamps, and Mutants capture almost all of Cordon.
Is that maybe something worth fixing, and something that's not too difficult?