RimWorld

RimWorld

Not enough ratings
Event Probabilities
   
Award
Favorite
Favorited
Unfavorite
Mod, 1.4
File Size
Posted
Updated
207.872 KB
18 Nov, 2023 @ 9:26pm
4 Dec, 2023 @ 6:58pm
3 Change Notes ( view )

Subscribe to download
Event Probabilities

Description
https://github.com/basicsmods/EventProbabilities

Quick notes:
- The options for this mod can be found by looking at the third picture above.
- The textbox input is really wonky. If it's not behaving how you expect, just keep trying to input your text in different ways.
- If you're playing without Royalty, the Psychic Droner Ship / Defoliator Ship / Mech Cluster settings won't do anything.

-------------------------------------------------

TLDR:
You want to lower the chance of something? Lower the number.
You want to raise the chance of something? Raise the number.
You want to look at the current probabilities? Enable dev mode, click the "Open debug logging menu." button. Then check out "Incident Chances", "Raid Strategy Sampled", "Raid Arrivemode Sampled", and "Raid Faction Sampled".

-------------------------------------------------

The source code for the mod is based on Raid and Event Manager mod (https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2891047708). That mod let's you toggle events on/off, but I wanted more control than that so I created this mod by modifying its source code.

-------------------------------------------------

Explanation:

This mod isn't particularly intuitive to use. This is because of the way the game implements all of this stuff and I'm too lazy to implement the mod in a way to make it more intuitive. Here's what you should know if you want to fully understand things:

First let's quickly talk about weighted selection. You can imagine this like a bag of marbles where you reach into the bag and pull out a random marble. But there are different numbers of each type of marble. This is represented by a "weight". This is how Rimworld implements their probabilities. So for example, if eventX has a weight of 4, eventY has a weight of 2, and eventZ has a weight of 1, there's a total weight of 4+2+1=7. The chance of eventX is 4/7 = ~57%, eventY 2/7 = ~29%, etc.

In general, modifying these weights lets you increase/decrease the chance of something happening, but the amount of effect it has is based on the values of all other event weights in its "bag".

When the storyteller decides that it's going to hit your colony with a major event, it first has to decide which event. This could be raid, infestation, manhunter pack, mech cluster, mass animal insanity, off-map problem causer, defoliator ship, psychic droner ship, wastepack infestation. Only the events in that list that are actually valid for your colony will be placed in the "marble bag". The number of "marbles" in the bag corresponding to each event are based on that event's weight (which you can control in the settings for this mod).

So the storyteller pulls out a marble (event) from the bag. If a raid was selected, then the storyteller needs to pick a faction to raid you. This works the same way as the above and uses the faction weights (which you can control in the mod settings).

Now you are going to get raided by a specific faction. The storyteller will next determine what type of raid it is (ImmediateAttack, ImmediateAttackSmart, StageThenAttack, ImmediateAttackBreaching, ImmediateAttackBreachingSmart, ImmediateAttackSappers, Siege). Depending on which faction is attacking, some of these may not be valid (for example, Mechs can only do the two breaching raid types or the StageThenAttack one). This mod only lets you directly modify the chance for breach, mech breach, sapper, and siege. The other choices don't seem that interesting to me and their chances will be indirectly affected by modifying the ones that are exposed anyways.

The last decision the storyteller needs to make is the raid's Arrival type. Again, the potential choices for this will be affected by all the previous decisions. (For example, a tribal faction can't do a center drop raid. Neither can a breach raid.) The choices here are EdgeWalkIn, EdgeDrop, EdgeWalkInGroups, EdgeDropGroups, CenterDrop, RandomDrop. I'm currently only exposing CenterDrop in the mod settings, but if you want more control then feel free to edit the mod files yourself to add more (just copy what I've done for CenterDrop).

The last thing you need to understand about all of this is that many of these weights can be affected by your current Raid Points. Those will come in pairs of (raidPoints, weight). The way this works can be best shown with an example. By default, Sieges have a weight of 0 when below 700 raid points. At 1000 raid points, it has a weight of 1.6. Between 700 and 1000 raid points, its weight will be somewhere between 0 and 1.6 (based on how close you are to 1000).

For events that are structured like the above example, the mod only lets you modify the "target" weight (so 1.6 in that example). For events that have multiple pairs (like mech-faction raids which have weight 0 at 300rp, 1 at 700rp, 1.8 at 1400rp, 2.2 at 2800rp, and 2.6 at 4000rp), the mod settings will expose each of the non-zero thresholds.

-------------------------------------------------

I've also included some random settings for tweaking the way Cassandra's event timings work and one to limit how frequently a mech cluster can occur after another one already has.
8 Comments
Lûte the Goblin 23 Nov, 2024 @ 3:10pm 
Cool, thanks for the reply.
Lûte the Goblin 8 Jan, 2024 @ 4:24pm 
Is this something to be worried about?

https://i.imgur.com/8vgEXzV.png
WolfShine 21 Dec, 2023 @ 3:27am 
Really great mod, keep updating it please :steamthumbsup:
TurtleShroom 19 Nov, 2023 @ 1:09pm 
Yours is vastly better.
basics :)  [author] 19 Nov, 2023 @ 11:13am 
@TurtleShroom I didn't realize another mod already did something like this (otherwise I probably wouldn't have made it, oops). Whether they conflict will depend on how VFE implemented theirs.

If they implemented it in the same way as I did, I'd guess the only conflict would be that whichever mod loads last is the one that takes effect.

If they implemented it differently, they could definitely combine to create some weird effects.

To check the current probabilities in-game, you can enable dev mode, click the "Open debug logging menu" button. Then check out "Incident Chances", "Raid Strategy Sampled", "Raid Arrivemode Sampled", and "Raid Faction Sampled".
TurtleShroom 19 Nov, 2023 @ 3:40am 
Wow, this is impressive. The Vanilla Factions Expanded Events Mod has this in its options too... if I use this Mod, will it conflict with that?
basics :)  [author] 18 Nov, 2023 @ 11:40pm 
shut up baby i know it
angela :) 18 Nov, 2023 @ 11:37pm 
10/10