[WOTC]Truly Guaranteed Sitreps and Multiple Sitreps

If you liked this item, please rate it up on Steam Workshop page.

Author: Inertia

Last revision: 13 Jul, 2023 at 18:49 UTC (1)

File size: 221.18 KB

On Steam Workshop

Description:
What this is:

This mod is a substantial improvement over the older [WOTC] Multiple Sitreps 2.0: Guaranteed & Categories mod(at https://steamcommunity.com/sharedfiles/filedetails/?id=2068573223 ) in many aspects. While the old mod performs quite well in simple case like pulling several sitreps from hundreds of sitreps, it fails painfully in specific situations such as guaranteeing the appearance of specific sitreps. This is largely due to its over-reliance on RNG (Random Number Generation), messy code structure, and residual bugs (for instance, certain sitreps won’t appear despite having their chance set at 100%).

Despite these shortcomings of the old mod, it’s crucial to acknowledge that it laid the groundwork and offered valuable insights for the development of this new mod.

This new mod did an overhaul to the vanilla code structure, make code modular and change the code design to be more deterministic, hence achieving 100% reliability in guaranteeing sitreps.

How it works(simple version):

Simple, straightforward, reliable and much easier to understand than the original multiple sitreps mod
First, it shuffles how many sitreps will appear based on variable SitrepChance and SitrepAmount
Then it find all sitreps from the game, put them into a list, and shuffled them
Then if category is not enabled, it picks the first x number of sitreps
If categories are enabled, it checks each sitrep in the list one by one, making sure they are following the group requirement and your category chance requirement, until we have collected x number of sitreps or run towards the end of the list.

How it works(longer version)

Quick summary of the new sitrep pulling process:

The new code first did some RNG simulation to determine how many sitreps should be added to a mission using SitrepChance and SitrepAmount, and let’s call this result "x".

SitrepChance is basically a variable that control the probability distribution of the number of sitreps being added to a mission, aka x. The minimum value for x is 0, and max value for x is SitrepAmount.

SitrepChance
value of x

=100
x will always be SitrepAmount

is high
more likely to get a high x

is low
more likely to get a low x

=0
x will always be 0

Then it find all sitreps from the game, put them into a list, and shuffled them using Fisher-Yates shuffle algorithm.
when running through the shuffled list and checking sitrep to determine if it can be added, the mod checks the following:

  • Regardless of if Categories is on or not, it check if the sitrep satisfy the map requirement which is inherent to specific map/plot and is not controlled by this mod.
  • if Categories is not "On", it ignores everything else and just picks the first x sitreps in the random list.
  • If Categories is "On",
    1. it first checks mutual exclusiveness as determined by the "Group" information,
    2. then it checks which categories the current sitrep being checked is in.
      (Note: this includes uncategorized category if you set UncategorizedInclude to "On". if you set it to "Off", it will ignore uncategorized sitreps")
    3. It then finds the corresponding category chance and rolls a dice against the chance to determine if this sitrep should be added.

The algorithm keeps going until x sitreps have been added OR the sitreps list has been run out(meaning all sitreps have been checked).

Default Behavior and Mod Config

By default this mod make you have a chance to have up to 3 vanilla sitreps(although the chance is very small), but you can have more or less sitreps and control each sitreps’ chance, for both vanilla and modded sitreps. All setting can be configured in XCom_Sitrep_Categories.ini in mod’s root directory, config folder. There are lots of comments and notes in XCom_Sitrep_Categories.ini to help people unfamiliar with the old Multiple Sitreps mod to understand how to set config for the new mod.

Simple Example

If you just want to guarantee 3 sitreps "a","b","c",
you can just delete everything in XCom_Sitrep_Categories.ini and copy paste the following into the file:

[SitrepsGuaranteedandMultiple.X2DownloadableContentInfo_SitrepsGuaranteedandMultiple]
SitrepAmount = 3
SitrepChance = 100
GuerillaOp = "On"
SupplyRaid = "On"
Council = "On"
ResistanceOp = "On"
LandedUFO = "On"
Retaliation = "On"
AlienNetwork = "Off"

Categories = "On"

Cat1Active = "On"
Cat1Amount = 1; <—CatNAmount is NOT used in the new sitrep pulling method
Cat1Chance = 100
+Cat1 = "SitRepNameA"
+Cat1 = "SitRepNameB"
+Cat1 = "SitRepNameC"

UncategorizedInclude = "Off"
UncategorizedAmount = 1
UncategorizedChance = 50

Note

You can find a nice list of sitreps name from various mod for use in XCom_Sitrep_Categories.ini in Nightninja’s old multiple sitreps mod discussion page here:
https://steamcommunity.com/workshop/filedetails/discussion/2068573223/2518023667600858057/

Download
Required DLC:

These DLC should be installed in order to use this item.


XCOM 2: War of the Chosen
Revisions:

Old revisions of this mod are available below. Click the link to download.