Changing Shooting Accuracy's Pre-Curve Values and Post-Process Curve

Started by XeoNovaDan, May 07, 2017, 03:59:34 PM

Previous topic - Next topic

XeoNovaDan

As Shooting Accuracy currently stands, the slightest hindrance will have an impact on accuracy of a much larger magnitude, and the 'Careful Shooter' trait will make even a level 1 shooter considerably more accurate than a level 20 (and conversely how a trigger-happy level 20 is slightly less accurate than a level 0), and the almighty mechanoid race. This is down to how tightly packed the pre-curve accuracy values are for each shooting skill above level 3, and also how tightly-packed the middle part of the post-processing curve is. Here's vanilla's ShootingAccuracy def located in the game's files (Mods/Core/Defs/Stats/Stats_Pawns_Combat.xml to be precise) to demonstrate how tightly-packed everything is:



For those that don't know, each pawn has a baseline shooting accuracy value that's determined by their skill level, and this is in turn modified by the pawn's capacities, and traits, and then run through a 'virtual graph' to determine their final accuracy value. The shooting accuracy figure is per tile, so the shooter's accuracy at whatever given range is their accuracy to the power of the distance their target is from them (A = Sd); a 97% accurate shooter shooting at a target (not including other factors) from 25 tiles would have an accuracy of roughly 46.697%, which comes from 0.9725. The post-processing curve is consisted of multiple 'curve points' to form a semi-linear graph, with 'pre-processed' accuracy essentially forming the x-axis, and 'post-processed' accuracy forming the y-axis. The set of co-ordinates are as follows: (0, 0), (0.2, 0.7), (0.5, 0.86), (0.8, 0.93), (0.96, 0.96), (1, 0.98), (1.1, 0.985), (1.3, 0.99), (1.8, 0.995), and (10, 1) - so whatever the pre-curved accuracy is, the post-processed accuracy will be determined by where abouts the pre-curved accuracy sits between the point on the graph above it, and the point below it.

In this post, I'm going to be comparing a level 0 standard shooter, a level 1 careful shooter, a level 13 standard shooter, and a level 20 trigger-happy; the level 0 standard shooter has a pre-curved accuracy of 50%, the level 1 careful shooter has a pre-curved accuracy of 105% (70% multiplied by 1.5x), the level 13 standard shooter has a pre-curved accuracy of 99%, and the level 20 trigger-happy has a pre-curved accuracy of 49.85% (99.7% multiplied by 0.5x). When these values are run through the post-processing curve, we come out with values of 86%, 98.25%, 97.5%, and 85.92% for the level 0, 1, 13, and 20 respectively - something's not right here: the level 1 is considerably more accurate than the level 13, and the level 20 is less accurate than the level 0!

I did hack together a little tool for the purpose of balancing one of my mods with vanilla as a comparison point, but I'm going to use my tool and its output for the purpose of comparison here - albeit with some modification so it's comparing my upcoming suggested solution to vanilla's values. Here's the vanilla part of my tool's output which compares the accuracy figures for each skill level with the vanilla def, with all 3 traits:



Most of you probably won't understand the output for the tool, so here's a brief breakdown: each row has the post-processed accuracy for whatever skill level with whatever trait (if applicable), and the values in brackets indicate that shooter's accuracy at whatever range (e.g. the level 4 standard shooter has a post-processed accuracy of 95.428% and is 79.176% accurate at 5 tiles, 62.689% at 10 tiles, 49.635% at 15 tiles, and so on). As you can see, there is virtually no accuracy progression beyond level 6 shooting with either of the traits due to how tightly-packed the pre-curve values are.

So my proposed change is to put the pre-curved values for lower skill levels in particular at much lower values (and adjust the curve accordingly) so that traits like careful shooter, as well as bionics will no longer make them almost ludicrously accurate until further investment goes into their skill, and so that higher level trigger-happies have some ability to actually hit the broadside of a barn with a machine pistol. Here's the sort of change that I've got in mind:



As you can see, the pre-curve values are spaced much further apart so that skill progression bears some weight to final accuracy with any trait, and with augmentation, and also lower level people will have a hard time getting high accuracy (unless you put in some serious investment), so therefore you need to increase their level to improve what you get out of them - whereas in the pre-curving current state, you can make a super soldier out of even a level 3 shooter with heavy investment as the pre-curve difference between level 3 and 20 is relatively small. While granted, it's not perfect, I have faith that this would be a strong step in the right direction. Now let's see how the accuracy differentials stack up with this set of values in mind:



As you can see, the improvement in accuracy with traits is much more tangible, and higher level trigger-happies have some chance of actually being able to hit something in close-quarters whereas you'd have to put them point-blank in its current state - and even then it's not easy to get a hit out of them. Post-processed accuracy is more or less the same, bar a slight deficit for levels 1, 3, 4, and 5 - but that's ultimately more motivation to level them up anyway, and there's pretty little difference between levels 4 and 6 in terms of accuracy anyway.

As for the comparison we were doing earlier with the level 0 standard shooter, level 1 careful shooter, level 13 ordinary shooter, and level 20 trigger-happy, they now sit at 86%, 95.062%, 97.5%, and 92.606% post-processed accuracy respectively. While again still not perfect, It's a marked improvement over how it currently is, in my opinion.

I'd love to see some feedback on this :)

Tynan

Tynan Sylvester - @TynanSylvester - Tynan's Blog

AngleWyrm

QuoteThe post-processing curve is consisted of multiple 'curve points' to form a semi-linear graph, with 'pre-processed' accuracy essentially forming the x-axis, and 'post-processed' accuracy forming the y-axis.

The set of co-ordinates are as follows: (0, 0), (0.2, 0.7), (0.5, 0.86), (0.8, 0.93), (0.96, 0.96), (1, 0.98), (1.1, 0.985), (1.3, 0.99), (1.8, 0.995), and (10, 1)

Graph courtesy of Wolfram Cloud:
My 5-point rating system: Yay, Kay, Meh, Erm, Bleh

O Negative

Wow! Awesome job putting these numbers together.

Hoping to see this change in A17 :D

XeoNovaDan

Thanks for the feedback so far, and for the little graph AngleWyrm put together. You could also use this change, which further distinguishes the levels below level 6 - because levels 4 to 6 don't see much change. Here's how it looks in XML and on the output:


Tynan

Okay, I now have time to look into this. I think what you're thinking is the correct direction. The post-processing should be more aggressive, allowing the original values to be more "neutral", so the traits can have a more consistent effect across levels. I'll be adjusting this in next build in this direction.

I wrote a table generator this. Oddly, my calculations vary from yours a bit when it comes to the accuracy with the traits. I'm not sure why. Either you've got a bug or I do! Anyway it doesn't change the overall conclusion.



Thanks again to Xeo for analyzing the numbers.
Tynan Sylvester - @TynanSylvester - Tynan's Blog

XeoNovaDan

You're very welcome. Your tool appears to have some weird 0.001% uptick, I'll attach my script. Values are hardcoded, but the area of the key variables is clearly marked.

Python version used was 3.4.4

[attachment deleted by admin due to age]

Tynan

I can't do Python, but thanks anyway.

I actually am looking at balancing this a different way. I'll just make all the base values linear (0.05 per level) and do all the complex stuff in post-process. So traits and health have the same effect as moving up or down levels. Currently experimenting.
Tynan Sylvester - @TynanSylvester - Tynan's Blog

XeoNovaDan

I wish you the best of luck with that :)

No python knowledge really required for this, you only really need to edit the values within the red box (in the screenshot attached) to whatever, and as long as SSR_Skillvals has all 21 values in and SSR_PrecurvePoints is the same length as SRR_PostcurvePoints, you're pretty much good to go. I don't think Python's math module is included by default so you'll want to make the following modifications:

Delete line 56 in the script

Replace line 79 (ln 78 post-deletion of ln 56) with the following:

Postprocess = 0
for x in range (len(psa_comp), 0, -1):
    Postprocess += psa_comp[x-1]


The tool's here if you ever need it though.


[attachment deleted by admin due to age]

Tynan

Thankfully I have access to RW so I just write the code in the game; it reads directly from the game XML.

I have dozens of tools like this actually, they're invaluable for balancing. Turn on dev mode and hit INSERT in the main menu to try them if you want.
Tynan Sylvester - @TynanSylvester - Tynan's Blog

XeoNovaDan

I do remember checking out a few tools out in-game because of my curiosity and thirst to learn more, several months back. Fairly recently used them to balance my weapon expansion mod - it's indeed very convenient to have them there and up-to-date with every little XML change and addition, as opposed to going great lengths to hack a spreadsheet together.

With the whole straight 0.05 accuracy per skill level thing, it'll be interesting how the traits turn out in particular. Only caveat to that though is the fact there are 21 skill levels, so level 20 will have to be 1.05 - or 19 as 1.05 and 20 as 1.1 if 0 is 0.05

Tynan

Data is defined for roughly levels -10 through 30. Of course only 0-20 are used for healthy traitless pawns, but with traits or blindness or bionics they can easily be outside the range.

The effect of traits is simpler now: It's exactly the same as gaining or losing 5 levels.

Tynan Sylvester - @TynanSylvester - Tynan's Blog

Tynan

Followup: Changes are pushed to unstable branch in case anyone wants to look.
Tynan Sylvester - @TynanSylvester - Tynan's Blog

XeoNovaDan

Just checked to see how traits reflect in practice, and some values don't line up: the shooting accuracy offset for careful shooter (and probably trigger-happy too) is actually a factor offset (i.e. x1.25 instead of +0.25). Screenshots are attached.

[attachment deleted by admin due to age]

Zhentar

Those all look correctly offset to me

Edit: misunderstood, ignore me