RimWorld

RimWorld

175 ratings
Interception Tweaks
   
Award
Favorite
Favorited
Unfavorite
Mod, 1.4, 1.5
File Size
Posted
Updated
649.205 KB
Oct 26, 2022 @ 5:12am
Apr 14, 2024 @ 5:22am
3 Change Notes ( view )

Subscribe to download
Interception Tweaks

Description
Tweaks the way obstacles intercept shots, while providing options to configure previously un-editable settings.

Requires Harmony.


Description
This mod exists for two main reasons:
  • Providing protection - In base Rimworld, a pawn who gets shot at outside of cover has no protection, regardless of how many obstacles might be in the way. The game already has a system for obstacles intercepting shots when they miss, and this mod simply alters that system to apply even when a shot is on target. No more (or at least, less) colonists getting hit because they happened to be one step away from a giant wall of barricades.
  • Open up Configuration - A lot of aspects of the game's interception system are hardcoded with no way to easily change them. Since this mod is already in there changing things, it's opened up most of those hidden away options while also adding several of its own for users to play around with. So in addition to being able to change the chances obstacles of different kinds and sizes intercept a shot, you can also configure how early interceptions can happen (separately from how early friendly fire can happen!), as well as make individual weapons handle differently, like making minigun shots pierce through walls for maximum chaos.
Quick Changes Rundown
There's a lot of possible changes to make with configuration in the mod settings menu, but here's a quick rundown of the changes you'll see from the base game using the mod at its default settings:
  • Obstacles can intercept shots even if those shots were on target. This means that targets outside of cover can still benefit from some protection if there's something in the way of the shot.
  • Interceptions can happen from a shorter distance and ramp up to full effectiveness earlier too. To offset the shorter distance, friendly fire will still only occur after the same distance as the base game (5 spaces), though you can edit that in the mod settings.
  • Any obstacle no matter the size has a chance of intercepting shots, rather than only ones that fill more than 20% of a space. Small objects will still only have a low chance to intercept due to their size, however.
  • There's a slightly increased chance that interceptions will occur when the victim is outside of cover, as a sort of mercy rule.
  • Non-pawn obstacles are slightly more likely to intercept shots. Normally their base block chance is 15% their size (so 15% their cover value*), but the default configuration ups this to 25%
Considerations
Because it plays with the chances of shots being intercepted, this mod will ultimately lead to shots hitting their targets less often, if only slightly. If you're playing with mods that limit ammo, or just don't like clearing out areas to prevent raiders from having some extra protection, the occasional missed shots due to the changes might be mildly annoying.

A lot of this can be mitigated through configuration, though - for example if you don't like that on target shots still get the full protection of obstacles, you can tone those odds down individually, or if you find that your hunters are struggling with all that nature in the way, there's an option to completely disable shot interceptions when shooting at wild animals.

Comparison to Passive Cover
This mod had always been intended to be an alternative version of my similar mod Passive Cover, though I never got around to finishing it before moving on to other projects.

This implementation has no noticeable effect on performance (especially compared to Passive Cover's chugging), a similar or greater level of configuration options, and roughly the same gameplay impact. One minor thing I'd say Passive Cover has over this is feedback - the effect of passive cover gets displayed in the hit chance readouts, whereas interceptions happen invisibly in the background. To be fair that's more of a problem with the game's interception system in general, rather than this mod exclusively.

If you are choosing between the two, I strongly suggest using this one. In fact, I might unlist Passive Cover... I never realised my janky mod would prove so popular, and knowing so many people are putting up with the performance mess of the original hasn't been good for my anxiety :S.

Configuration
Full details about everything that can be edited are provided in the Mod Settings menu, but here's a brief rundown:
  • Shot Effectiveness - Change the effectiveness of interceptions depending on whether the shot was on target, or missed. Note that certain weapons have forced misses, and so are far likely to count as having missed than being on target.
  • Obstacle Categories - Make certain common sorts of obstructions more or less likely to intercept shots.
  • Distance Modifiers - Set how early interceptions can occur, and how far a shot has to travel before interceptions are at their full effectiveness. The default configuration values are somewhat closer than the base game's values.
  • Size - Set the % chance a non-pawn obstacle intercepts a shot based on its size. The default configuration boosts the chances higher than the base game's.
  • Pawn Options - Adjust how likely pawns are to get hit, what adjustments are made when they're prone, and whether any special adjustments are made when they're outside cover. The default configuration gives pawns outside of cover a slight adjustment in their favour.
  • Friendly Fire - Set how far a shot has to travel before friendly fire interceptions can occur, as well as set a modifier to make friendly fire interceptions more/less likely.
  • Hunting - An option is provided to disable interceptions on successful shots against wild animals. This'll help hunting be unaffected by the changes that allow interceptions to happen even on on target shots, which might be a nuisance given all the nature out there in the wilds to get in the way.

Mod Extensions
Included as part of the mod is a Mod Extension that can be used to configure how individual weapon's bullets interact with the interception system. See the file "Example Patch.txt" inside the mod's folder for a commented example of what the extension can do and how to make one.

Compatibility
All I know is this mod could be incompatible with anything that touches on the interception system or has sweeping changes to how projectiles should hit - though it's likely that any mod touching those systems are already implementing their own version of this so there's little point in having both installed.

I don't use many other mods, and even if there were incompatibilities I'm not sure I have the experience to fix them. Feel free to post about compatibility problems in the comments to inform other users, but don't expect anything to be done about them.

The second release of this mod now includes a value in the Mod Extension (doNotManage) that allows patches to prevent particular projectiles from being managed by this mod. See 1.4/Patches/LaserEyePatch.xml for an example that's included with the mod. Do note that because of how things are set up, modifications to interception distances will still be applied regardless.

Known Issues
  • Sometimes shooters are being struck by their own shots, but this is likely a mod compatibility issue, as it doesn't occur with this mod alone.
Popular Discussions View All (2)
1
Jun 1, 2024 @ 6:25am
Making patches to prevent this mod handling certain projectiles
Atkana
2
Feb 16, 2023 @ 5:21pm
extremely short interception weirdness
GonzoGonz
51 Comments
SaMaHaJoGu Mar 5 @ 11:58am 
This is an amazing mod... if I could, I would give it two thumbs up... but one thing I will say is that with the tweaks to make wild animals not included into the interception, on top of my current list of mods, it crashes the game when I hunt a wild animal and, I think, the interception system goes haywire. But I can't collect any logs because the game goes straight down and stops responding. :'( I just know that if I re-enable animals into interception, it doesn't crash.
Ascythian Oct 30, 2024 @ 2:04pm 
@Chip56

Any chance you could upload your patch to the Steam Workshop instead?
Chip56 Jun 1, 2024 @ 6:18am 
@Atkana

Thank you, i just created a patch for Rimlaser and Interception tweaks.

No pawns were harmed in the test run:

Before the patch they hit the embrasure directly in front of them.
After the patch they didnt hit the embrasure with any of the 3 weapons (which use different bullet types) did hit the embrasure directly in front of them.
After this i also moved the 3 pawns directly in a line and neither one of them got hit when they opened fire on the wall at the end of the shooting range.

I uploaded it in case someone else also wants it for Rimlaser or if you want to include it to your mod: https://www.file-upload.net/download-15339331/rimlasertargetpatch.zip.html

I am also going to comment in the discussion a few notes.
Atkana  [author] Jun 1, 2024 @ 1:41am 
@Chip56 I've made a discussion which covers how to make these sorts of compatibility patches. In the case of Rimlaser, the name you want for step B is Rimlaser , and the ID for step C should be Bullet_LaserRifle for the laser rifle. You might be able to instead use Bullet_LaserGeneric to prevent it applying to basically any of the mod's lasers, but you might have to change a bit more of the patch - defName="VFEA_LaserEyeBeam" into @ParentName="Bullet_LaserGeneric" .

Patches are a bit confusing to learn and I haven't tested it, but give it a go and let me know what happens.
NoOne_ReaVen May 26, 2024 @ 10:25am 
Okay, simlar issue as Chip56 but with a defensive turret installation behind an Embrasur and a Sandbag wall. The Turret is a Vanilla Expanded Autocannon and it blows itself up about 4 out of 10 Raids otherwise no issues, cant really blame any mod since 849 Mods active is a hell of a trouble shooting nightmare already im happy to just be able to run my current playthrough at all considering im like 40hrs in and it only crashed/froze/lag spiked 10 times
Chip56 May 24, 2024 @ 3:17am 
So thanks for the hint that allowed me to pinpoint that. So what would be the necassary steps to patch that?
Chip56 May 24, 2024 @ 3:14am 
@atkana:
after your comment i did run a test (only 2 pawns were injured during this trial, none died):
And indeed the vanilla weapons pawn did not hit the pawn/ embrasure right in front of them. Only after moving the poor other pawn right in front of the target (10 tiles away) they got hit as expected.
However the one equiped with a laser rifle from rimlaser (https://steamcommunity.com/sharedfiles/filedetails/?id=1465459039) did hit the pawn/ embrasure right in front of them.
I did try to change the mod load order to see if it makes any difference but the results were the same. Didnt matter which one was first.
Atkana  [author] May 23, 2024 @ 2:06am 
@Chip56 There have certainly been some weird mod conflict issues, but there are (intended) circumstances with just this mod where unintended things can still be hit. Whenever an off-target shot impacts a map tile, the game has a separate check to see what in that tile (if anything) the shot will hit. For the specific mechanics, it loops through everything in that tile and does a % chance check to hit it (modified by things like size), if the check succeeds it hits that thing, whereas if it fails it does the same check for the next thing in the tile (if all checks fail, nothing gets hit). This mod intentionally doesn't modify the check at all.
I don't think to-wild shots are THAT bad that they'd hit 1 tile in front of them, so it could be a mod compatibility issue. If it's only happening for a particular projectile, you can create a patch so this mod doesn't manage it (like the included example for the VE Ancient's eyebeam, which was hilariously blowing up any pawn that used it)
Atkana  [author] May 23, 2024 @ 2:06am 
@Loopy There's configurable modifiers for both missed shots, and how likely pawns are to intercept, so you can probably fudge something together with this mod. Otherwise if you're looking for bullet trajectory calculations, you're probably better off looking elsewhere since that's out of scope for the mod (I think CE might have that?)
Chip56 May 21, 2024 @ 4:23am 
I am not sure if this might be some obscure mod conflict but i did note one thing:

Sometimes my pawns manage to accitently hit an object/pawn directly in front of them in 1.5. However according to the settings it should be distance before friendly fire: 5 tiles and even the minmum distance is set to 5 tiles so unless i misunderstand the settings they should never hit a pawn or an embrasure right in front of them.

Did anyone else something similar?