I see that English isn't your main language, so some of what I said was probably lost in translation. I will try to be more clear.

1. Imagine two circles around your target: one much bigger than the other. The big circle's radius is the max attack range for the attacker (let's it's an archer so its radius is 1800), and if the attacker was standing at the edge of this circle its attack should have some

**minimum** accuracy. What should that minimum be? 0%? 1%? 10%? For now, ignore the accuracy upgrades and imagine that they don't exist.

The smaller circle's radius is the distance at which the attacker has maximum accuracy. If the attacker is at the edge of (or inside of) this circle when making its attack, the attack should have some

**maximum** accuracy. What should that maximum accuracy be? 100% 99% 90%? How big should the radius of this small circle be? Should its radius be the minimum attack distance for the attacker (in this example with archers that number seems to be 600)? Should its radius be the same size for all units no matter what their min attack range is? Should its radius be 0?

3. Now we include the accuracy upgrades and you should consider this scenario: the archer attacking its target has 60% accuracy from its distance to the target, and has 30% accuracy bonus from upgrades. "Additive" means that the two accuracy numbers are added together: 0.60+0.30 = 0.90. "Multiplicative" means the two accuracy numbers are multiplied together: 0.60*0.30 = 0.18, then 0.60+0.18 = 0.78. (In either case it's possible to have accuracy > 100% but we ignore this for now.) Why does this matter?

- If bonus accuracy is additive, then the accuracy bonus upgrades will function kind of like a floor for accuracy: you can never be
*less *accurate than whatever your tech upgrade level is--this effectively changes the minimum accuracy for the big circle described in 1 above. It also sets a cap on how accurate you have to be to achieve 100% accuracy--this effectively increases the size of the smaller circle described in 1 above.

- If bonus accuracy is multiplicative, then accuracy bonus upgrades will change the shape of the accuracy function and how it scales. For example: A 10% accurate shot with a 30% multiplicative bonus only gains 3% more accuracy (total of 13% accurate), but an 80% accurate shot with a 30% multiplicative bonus gains 24% more accuracy (for a total of 104%). In this example the accuracy upgrades do almost nothing for you if you are far away, but will help you more the more accurate you were to begin with (maybe because the attacker was closer or whatever). This would change a straight, diagonal line shape into half an upwards facing parabola shape.

Again ignoring bonus accuracy for now, you will probably want your accuracy function to look something like this:

View attachment 398376
The red section is a minimum accuracy that is achieved when the attacker is outside/on the big circle. The green section is max accuracy that is achieved when the attacker is inside/on the small circle. You have to decide what d_max and d_min are (the radii of the big and small circles) but they can be constants or depend on the attacking unit's attack range/unit-type/time-of-day/etc. Same applies to a_min and a_max: they can be constants or defined arbitrarily per accuracy check. Technically there is still the possibility of a divide-by-zero here but that can be worked around.

Finally you need to cap/floor the input value of d (which is x in the above formula), the distance to the target, and the output values of the function.