@Iluvalar I do not understand you either. I do not see any instability, which would prevent balancing. All I can see (in your second post) is that the game is too complicated for your theoretical model
. Which is a failure of your theoretical model for balancing, not of the actual game. Yes, your model needs to take distance and accuracy into account.
And yes, it is realistic that weapons are more accurate at short distance than at long distance, which will likely show up in a physics based model automatically. As of now, the physics based models all will give you near 100% accuracy at a short range. The old code didn't - it would allow flamers to fire 45° off at a chance to enforce low accuracy at 1 tile range, too. Which looks really odd in gameplay, when a bunch of flamer cyborgs doesn't manage to hit a wall, but fires flames all over the place... Yet, at long range, in current code, the shots will still be exactly 1 tile off, even when you miss. So you can't really miss a factory (we're talking 1 tile from the center!), and you can't really miss a battle group when you aim at the central unit.
When switching to a physics based model (or actually anything except the absurd 1-tile-off code we currently have) we will need to rethink accuracy and the effects of accuracy upgrades.
Which is actually why I suggested we could also change accuracy from "shooting accuracy" to "chance to do damage on impact".
So at accuracy 50%, 50% of on-target shots of a MG (which is pretty much 100% at short range!) would not do damage, despite being a hit
. Just because, say, they get reflected of some metallic part of the target. It's actually realistic that not every MG bullet pierces the armor the same way. If you fire a MG at a tank, how many shots do you think do actual damage, and how many get deflected in one way or another?
So I suggest that we break accuracy actually into two parts:
- A chance-to-damage ratio, giving how many shots on target actually do damage.
- A standard deviation (in tiles) at maximum weapon range (which will be linear with actual range! - we may want to use the "base maximum range", to have range upgrades not reduce this precision!)
The first value, we may want to keep high (say 90%+) for long range artillery weapons with area effects. It's the "dud ratio", and we should maybe not display an explosion on impact. It's not as if a tank or building can deflect a missile explosion. For MGs and short range, this will be the most interesting value for weapon upgrades.
The second value is what one would think of as "accuracy" for long ranged weapons. It's how good the weapons aim, an expected deviation from the target. At long range, targets may move - so the shot may still hit the target, it's not guaranteed to miss 50% of shots if we have a standard deviation of 1 tile. For short range weapons, we should keep this value low. It's hard to fire a MG 1 tile off at 8 tiles range, that is like 10° off or so.
If you want to mathematically estimate the total chance - it's something like (1-cdf(stddev*distance/maxdist))*chance-to-damage, where cdf is the CDF of the squared uniform distribution.
I have refreshed my patch (but which just modifies the shot deviation, largely interesting for artillery) to the recent changes in the combat.cpp file, see http://developer.wz2100.net/ticket/3989
but I did not yet implement this two-accuracies approach.