Dispersion adjustments. I think at zero -> 2 skill should have a positive dispersion with 3 being the base dispersion of the gun, and 5 -> 10 decreasing the dispersion by 1 degree down to a minimum based on firearm category.
Hard coding the adjustments would allow for any changes in mechanics to cross all .json files and should affect all mods that add firearms as well. I’m pretty rusty at C++ and having a quick look at the ballistics and firearms code made my eyes cross. I’d think a simple check and modifier at the start of the projectile check would probably be what I would do, but I’d have to get real intimate with the code to make sure that’s really the better option.
Here is the dicey problem with firearm ranges then. Arbitrary values for everything means no realistic way to modify the distance any given gun should operate at. At minimum all guns should have their ranges buffed by at least 2 tiles (bows too), and more in some cases. The RM11B should be hitting 25 to 30 squares on a precisely aimed shot with moderate firearm skills, and that’s basing distance off using the Bus as a general idea of how big a tile is. A school bus is typically 45’ long, and the school bus in game is 11 tiles long. That effectively makes 1 tile at least a 4 foot distance in one direction, but a 1.75 foot distance in another (width of a school bus) If you meet in the middle and argue a 2.5 foot square, then at least you have a number to base viable gun ranges off of. You’re still looking at some redonkulous numbers, I.e. pistols that hit out 30 squares as an effective range, so I understand the need to curb that.
I won’t bother trying to stat them out in a meaningful manner. Using the base dispersion is ultimately going to be easier on that front. Muzzle velocity would really be the next number to crunch (which I have so far for every firearm from 5x50 through .45 so far, going down the file list), I notice a couple of guns have a barrel length entry which absolutely affects muzzle velocity, but I don’t know how the game determines the length of a barrel since a lot of guns are missing the entry,
That takes 90% of the math out of the equation and makes determining dispersion modifiers on skill levels a hell of a lot easier. For some reason my brain was thinking it was in radians for some bizarre reason and I was confused on the numbers I was getting. Engineering brain needs more caffeine I think.
Edit: Ultimately I think dispersion should be calculated at the distance to the target if it isn’t already. A shot 2 tiles away shouldn’t miss regardless of the gun unless a jam occurs, while a shot at 20 tiles should have a large change of missing depending on weapon scopes and skill.