RimWorld

RimWorld

Mortar Accuracy
687 Comments
Emph Jul 28 @ 8:02am 
Thanks a bunch! Can confirm that it now works as expected. Appreciate the work.
Hob Took  [author] Jul 27 @ 8:22pm 
@Emph Patch added. Fixes Rimworld 1.6 + YayosCombat + MortarAccuracy causing mortars to be inaccurate. It may take Steam ~1 hour before the update comes through.
i like sprigatito Jul 27 @ 4:55am 
Danke! My pawns are no longer braindead!
Hob Took  [author] Jul 24 @ 1:37pm 
@Saphkey Vanilla does use shooting + manipulation + sight for accuracy, but there are several things vanilla still does not do or has bugs with that may make players want to still use this mod. It is understandable if you don't want to use this mod anymore.

* Bug: With vanilla, if the random cell that is chosen to be targeted is the original target, the shot will miss
* With vanilla, weather affects non-mortar accuracy (bows, guns) but has no impact on mortars
* With vanilla, the target's cover chance affects accuracy (why should a target standing behind a tree cause a mortar shot to be less accurate?)
* With vanilla, firing a mortar does not improve skills
* With vanilla, mortars cannot lead moving targets
* With vanilla, mortars only show accuracy radius, they do not show explosion radius
* With vanilla, there are not options for shooting and/or intellectual to affect mortar shots
Saphkey Jul 24 @ 6:24am 
This is apparently now redundant, as vanilla now uses shooting skill + manipulation + sight for mortar accuracy.

https://rimworldwiki.com/wiki/Mortar_Miss_Radius_Multiplier
Hob Took  [author] Jul 23 @ 12:41pm 
Excellent. I expect to have a fix before the weekend
Emph Jul 23 @ 11:18am 
Sorry for the lack of information. It was pretty late for me when I commented.
The accuracy preview shows the smallest radius with a pawn with 20 shooting and perfect accuracy, however they miss the target by a landslide. I assume yayo's combat logic takes over. With advanced accuracy algorithm disabled my pawn always hits the mark, as expected.
Thanks for the quick response and taking your time looking into this!
Hob Took  [author] Jul 23 @ 11:00am 
@Emph I'm sorry about that. What does not work when both mods are loaded?

Accuracy preview? Mortar does not shoot? Yayo's combat accuracy takes priority over Mortar Accuracy? Target leading does not work?

If you let me know what is broken, then I can look for a solution.
Emph Jul 22 @ 7:19pm 
Unfortunately, it doesn't seem to work with the Advanced Accuracy Algorithm from Yayo's Combat 3 , even if your mod is loaded after. Any chance for a patch?
Hob Took  [author] Jul 20 @ 10:17am 
Spanish and Spanish (Latin) keys updated. They were missing 1 string from a while ago. Thanks @Fedank on github for the report!
MathChrome5010 Jul 20 @ 10:12am 
@Hob Took, thank you for your quick patch! o/
Hob Took  [author] Jul 20 @ 10:07am 
Bugfix released for mod version on Rimworld 1.6. If using 100% accuracy at max skill, mortar shots are now correctly perfectly accurate instead of reverting to vanilla logic.

@MathChrome thanks again for the report!
Hob Took  [author] Jul 19 @ 9:59pm 
I'll have a fix tomorrow.
Hob Took  [author] Jul 19 @ 5:00pm 
Yep that's busted. If the miss radius gets below 0.5 squares, vanilla accuracy takes over. Should be a quick fix.
Hob Took  [author] Jul 19 @ 4:46pm 
Thanks for the debugging! I'm booting up now and I'll test with 20 skill on both.
MathChrome5010 Jul 19 @ 12:05pm 
I just tested it with literally no other mods except Harmony. Doesn't work. It shows what should be the tightest possible accuracy but the shell lands outside it. Colonist skills, mod options, nothing changes the end results at all. It is as if the mod wasn't even there. But it is - because the mod changes the estimated impact radius reticle when aiming a shot, but does nothing else.
Could you look into it? I love this mod.
MathChrome5010 Jul 19 @ 11:55am 
@Hob Took latest version:1.6.4523
Hob Took  [author] Jul 19 @ 10:47am 
@MathChrome I'm sorry it is broken. What version of Rimworld are you playing?
MathChrome5010 Jul 19 @ 5:05am 
Something is wrong with this mod. No matter what pawn or settings I use, even pawns with perfect skills, I always get the worst possible accuracy. Weather is clear, pawn have 20 intellectual and 20 shooting, I have triple checked the mod settings. The shot will always miss it's forced target, going around in a ~15 tile radius. Even when the predicted accuracy shows otherwise.
My modlist shouldn't have anything that impacts mortars at all:
RimHud, Character Editor (no, I haven't messed with item defaults), Nice Bill tab, Ogrestack, Filth vanishes with rain, Doormats and Smart Odyssey. Mortar accuracy is at the top of the list.
Hob Took  [author] Jul 17 @ 2:11pm 
@Iris 1.6 support was added about a month ago
Iris 'Piña' Silbermond Jul 17 @ 12:23pm 
Are there plans for 1.6?
Hob Took  [author] Jul 16 @ 9:25pm 
Excellent debugging! I'm glad it's working for you now.

Yeah, any 1.5 mods loaded on 1.6 are likely to have busted things. There are a lot of subtle changes under the hood in 1.6. It is odd that 1.5 mods are even allowed to be loaded.
The Professor Jul 16 @ 6:56pm 
Update: I did actually have outdated Vanilla Expanded: Security running and disabling THIS resolved the problem - presumably it does something to shells when it adds other artillery.
The Professor Jul 16 @ 6:08pm 
Thanks for the reply.

1.6.4518 with Odyssey. No other weapons/mortars/targeting mods at all. Tried my existing savefile mortar - have deconstructed and reconstructed. Shelf of shells 4 tiles away and accessible. When 'manning mortar' I can select targets, see the predicted accuracy circle, but the colonist who is manning the mortar just... sits there and never loads a shell.
Hob Took  [author] Jul 16 @ 5:04pm 
@The Professor, I need more information to be able to help. Which rimworld version are you one? Any other mods enabled that deal with guns/mortars/targeting?
The Professor Jul 15 @ 9:14pm 
Still having problems - pawns sit there on the mortar and never load it, no matter how many shelsl available and with all shell types accessible.
Klarum Jun 26 @ 11:32pm 
Thank you Hob :)
Hob Took  [author] Jun 26 @ 7:34pm 
1.6 support re-added. All previous Rimworld versions should be un-affected this time
Cu Jun 26 @ 6:04pm 
Awesome. Appreciate the effort, HT.
Hob Took  [author] Jun 26 @ 3:23pm 
To help the most players, I have reverted the 1.6 update so that 1.5 and 1.4 are working again.

I'll re-add 1.6 support tonight.
Hob Took  [author] Jun 26 @ 2:56pm 
Sorry y'all! I will get that fixed tonight for 1.5 and 1.4.

The 1.6 support I added was not intended to change previous versions. Entirely my fault.
Klarum Jun 26 @ 1:14pm 
@Hob Took I am running 1.5 and no mods that affect weapons. Maybe it will work again when 1.6 is live.
Cu Jun 26 @ 12:40pm 
Same prob as Klarum, no one can / will fire weapons - the targetting angle-thingy shows, then they just track the target without actually shooting. Draughted, free range firing, nothing makes any difference. Removed the mod and it works again, so definitely this mod doing it, but I'm running v1.4 so quite possibly just not compatible with current version
Hob Took  [author] Jun 26 @ 10:06am 
@andrewmin133 Thanks for the kind offer! I don't work on commission, but I have added a "Permissions" section to the mod's description. Anyone is free to modify the mod and reupload it, so if you find a modder who does do commissions they may be willing to mod the mod.

For your auto mortar problem, which mortars are these and from what mod? What are your Mod Settings for Mortar Accuracy?

I discovered an edge case last night with Rimworld 1.6 + target leading enabled + the shooter has perfect accuracy results in the vanilla accuracy taking over instead of the mod. This likely exists in Rimworld 1.5 as well.
Hob Took  [author] Jun 26 @ 9:05am 
@Klarum what RimWorld version are you on? Any other shooting related mods?
Klarum Jun 26 @ 4:20am 
This update made all guns and mortars in my game stop shooting...
Hob Took  [author] Jun 26 @ 12:14am 
Updated for Rimworld 1.6! The new version of the mod uses transpiler patching which should make it more compatible with other mods, perhaps even with Combat Extended?
andrewmin133 Apr 13 @ 8:29am 
Hello Hob, thanks for the reply! The auto mortars seem to struggle when targeting enemy pawns in general, especially moving perpendicularly to the firing trajectory (i,e, not moving towards or away but strafing across). would you be interested, by any chance, for a commission to improve target leading? With compensation of course.
Hob Took  [author] Apr 12 @ 6:19pm 
@andrewmin133 All mortar-like things should use target leading based on the Mod Settings option. It is not specifically dependent on a pawn using the mortar, just that the target of the attack is a pawn.

Is there a particular mortar that is not appearing to lead targets? Is your target line locked onto the target?
andrewmin133 Apr 8 @ 4:53am 
Hi, Im trying to test auto mortar defenses but is it possible to make this work for them to lead targets as well? any clarification would be appreciated. thanks
Hob Took  [author] Feb 17 @ 7:08pm 
@Trivia Vanille, absolutely agreed. A trench and HESCO blocks and the sort providing cover makes sense vs a mortar. Unfortunately, the game merely has a single variable for cover percentage. There is not a distinction between overhead cover and other cover.

In vanilla, the cover percentage causes the mortar shot to be more inaccurate which makes no practical sense. Why would the target being behind a tree cause the mortar shot to land elsewhere? Land where it was going to land, just deal less damage.

I don't know if cover affects the blast damage of the shot.
Trivia Vanille Jan 12 @ 8:21pm 
Of course, as mortars are indirect-fire artillery, the shell wouldn't be coming in from a shallow angle either, so low cover like sandbags, single HESCO blocks, or Jersey walls would barely affect the shot at all (but still could catch the shell if the shot wasn't spot-on). However, high cover like a tree trunk, a full-sized wall, or HESCO stack could effectively block any mortar shot fired at the target behind the cover, depending on the velocity of the shell, the material and thickness of the cover, and the type of explosive and fuse in the shell. There's probably a ton of other variables to consider, I'm not an expert by any means, just thought I should mention it since you brought it up in the description... just kinda figure Tynan was probably going for a bit of realism there when he made the formula for it
Trivia Vanille Jan 12 @ 8:20pm 
Hey, just wanted to point out that your target being behind cover would actually affect your shot IRL. It entirely depends on the angle at which the shell comes down from above the target; the steeper the trajectory, the less cover would affect the shot (unless that cover also includes overhead cover, like a roof or, as you mentioned, a tree; I don't believe that the trees in Ribworld actually count as overhead cover, mechanically, although it would be interesting to see if that could potentially be modded in), but the closer your target would have to be. To fully ignore cover, the shell would have to drop pretty much straight down on their head, which would require them to be close enough to the launcher as to make it impossible to actually hit them without destroying the launcher in the process (and by the time the shell landed, the target would have killed the entire mortar team, so there are plenty of more practical ways to accomplish the same goal).
SP4RTAN Jul 14, 2024 @ 1:53pm 
@Astro I mean it doesn't cause any issues. This mod doesn't really affect the automortars since pawns aren't firing them.
Astro Jul 13, 2024 @ 7:23pm 
works with VFE mechanoids automortars right?
hardbrocklife May 8, 2024 @ 6:06am 
Thank you!
J May 3, 2024 @ 7:20am 
@Hob Took:

Got it, thanks for the explanation!
Hob Took  [author] May 3, 2024 @ 4:06am 
I see Rimworld 1.5 has the verb property "forcedMissEvenDispersal" which selects a random angle and radius weighted by a golden ratio to produce an even distribution across all the targeted cells.

BUT, this isn't enabled on the mortar ha
Hob Took  [author] May 3, 2024 @ 3:58am 
@pepsigamer02 In vanilla, after rolling for a random cell to target, if the random cell happens to be the cell we wanted to target (the exact center) then cover is applied and we roll to see if the shot misses due to cover.

In modded, cover has no affect on mortar shots. We merely are determining a random angle + radius to target then let it fire.


As to why the Q&A doesn't talk about sight and manipulation, Rimworld keeps changing how mortar accuracy is calculated and I haven't bothered to keep the Q&A up to date with the sight, manipulation, mortar barrel, difficulty setting, and Rimwold version differences.
Hob Took  [author] May 3, 2024 @ 3:51am 
(skill multiplier) is a 0->2 range multiplier. If we use the mod default values of maximum skill = 75% miss reduction and no skill = -40% miss reduction, these would be the miss values:

Base mortar miss radius = 13 (assuming no weather multiplier)
Colonist with avg skill 0 = 40% increase in radius, 18.2
Colonist with avg skill 10 = 57.5% reduction (halfway between -40% and +75%), 5.525
Colonist with avg skill 20 = 75% reduction, 3.25