# Mathematical ranged unit accuracy system idea.

## Recommended Posts

Hi everyone,

I was recently thinking about ranged unit accuracy in the "future alphas" topic. I came up for some accuracy equations for different ranged units. I am trying to account for target speed (maybe this is already factored into the current accuracy system) as well as the number of shots taken since the start of a battle.

n=number of shots since an order is given to the units. ACC# is the accuracy number as it stands currently (could be tweaked) Vtarget is the speed of the unit the ranged unit is firing upon. All values are integers greater than 0.

I can foresee this having a number a number of good effects on gameplay:

• dancing whole armies could be less beneficial as the player who dances between each shot would never build accuracy like a stationary group. Although I think right now changing direction is also hard for ranged units to deal with. If changing direction didn't matter, then dancing would be reduced because .1*Vtarget or .05*vtarget is the most inaccuracy you can generate by moving your units around in front of the enemy.
• It makes battle tactics, positioning, and movement more important as you would want your slingers and in particular archers to stay stationary more, but skirmishers are the more mobile ranged unit so they regain accuracy faster after moving.
• It is a way to make some ranged units be more mobile in battle without making them physically faster in m/s.

example: archer (example ACC#=1) shooting at 10m/s unit after being told to attack it: shot 1=6, shot 2=4, shot 3=3.3, shot 4=3, shot 5=2.8 and so on until -> 2 at n=infinity

slingers and skirmishers would have progressively larger ACC#s.

As you can see, I chose skirmishers to have much faster accuracy buildup, only taking 1 shots before maximum accuracy, and having less moving target penalty. It is expected that skirmishers have a very high base inaccuracy (ACC#) so they would want to run to closer range and get a few powerful volleys in. Also, I think skirmishers should not have a minimum accuracy for 2 reasons: they fought closest to their enemies than other ranged units, in game they are useful to assist heavy melee units.

There is one remaining question that I am not sure about with this mechanic. And it is how should we count n shots. My best guess would be when ranged units are given an order by the player, and count n to be number of shots since last order. I thought about choosing n starts whenever the unit stops moving, however sometimes ranged units decide to move on their own to get in range and this is beyond player control.

Let me know what you guys think! I think it could be a great thing to heighten the vulnerabilities and strengths of different ranged units as well as reduce dancing and improve the strategic depth of battles. Combined with good pathfinding, the good gameplay effects of this are multiplied.

• 4
##### Share on other sites

That is an interesting concept.

7 hours ago, BreakfastBurrito_007 said:

And it is how should we count n shots

It should be possible to count the shots that were aimed at the same target. And then start again when a different target is chosen.

##### Share on other sites

Well I am thinking that ranged units would choose the next closest target in a battle, just from my observations. And we want the effects of this mechanic to be influenced by player input, so if players know about this, they can choose whether or not to avoid moving to keep high accuracy. They can't avoid the accuracy loss from units changing targets which I would expect if shots are counted as number of shots on same target.

My guess is that there is not already some function in 0ad coding history that tracks numbers of shots since last player input, but I may be surprised.

What do you guys think of the scaling of the ranged infantry? do you think my values are reasonable?

##### Share on other sites

Is there any justification for divding 4 by the number of shots? I am not sure how that works probabilitisticly.

##### Share on other sites

Just now, Yekaterina said:

Is there any justification for divding 4 by the number of shots? I am not sure how that works probabilitisticly.

The effect this will have is that ranged units will have the highest starting inaccuracy but after some shots approach their maximum accuracy. Equation-wise this slows the rate at which archers gain accuracy. It will take 3-4 shots as I wrote it (could be changed).

##### Share on other sites

4 hours ago, BreakfastBurrito_007 said:

do you think my values are reasonable?

The values can always be adjusted so the values are not the problem.

What could be a problem is the concept.

1 It basically means that if you do one missclick and move the archers, you ruin your accuracy.

2 Also it seems to be a fairly buggy and abusable concept. Since if units only lose accuracy when they are ordered to, there might be players that find exploits on how to avoid losing accuracy when moving units. So even if you find a way to implement it, you need to double check if there are no exploits.

3. If units lose accuracy after moving, you have difficulty to chase an escaping unit and hit it reliably.

All in all, unless you get a really good code for it, it seems to open more ways to exploit the system than the system is worth in the first place. With how prevalent range units are, it might have the consequence of turning 0AD into a game of exploiting the ranged unit accuracy system. If you can guarantee that there are no such exploits, we could continue the discussion. First I would like to see proof of concept before we can discuss if it is actually applicable to the game.

##### Share on other sites

Posted (edited)

Do you see any benefit to the accuracy calculations?

They would simply be a modifier to existing accuracy values as they exist in 0ad currently. I suppose the only way to abuse the concept is to let your units do whatever and let them shoot things, however, when ranged units are not ordered to chase something, they tend to lose interest and go idle after some chasing.

People seemed to dislike the changes that made skirmishers .6 m/s faster than slings, and slings .6 faster than archers. If this is implemented it brings mobility to be more nuanced than simply how fast the ranged units are. This makes the problems associated with camel archers from a23 or plain archers from a24 reduced without making them slower.

@LetswaveaBookThere are no exploits or bugs in this beyond what is in the equations I wrote. I am not sure how the accuracy system works, but I have heard numbers given out in the balancing discussions such as "2.5". These equations would just take a base accuracy value and make a temporary new one for the current shot.

I think the only way this would become frustrating besides the numbers being off, is when ranged units suddenly start attacking a different target like farms, elephants, heros, palisades. This is already a frustrating problem from a24, but it would be worse if every time you tried to keep ur units from disobeying rules there was a loss of accuracy.

Remember the purpose of this is to 1. make battles more strategic and nuanced 2. reduce the reward of dancing a group of units.

Edited by BreakfastBurrito_007
##### Share on other sites

16 hours ago, LetswaveaBook said:

basically means that if you do one missclick and move the archers, you ruin your accuracy.

This is why I decided to use n=number of shots since last order.

This means that rather than tediously trying to keep ur archers from moving, you just need to pay attention to whether or not a new attack order is worth it.

16 hours ago, LetswaveaBook said:

Also it seems to be a fairly buggy and abusable concept

If "n" can be reliably counted with code, then there are no bugs that would come from these equations. I also don't see how you could abuse this. The only thing I could think of would be turning your units to violent mode and letting them run free. The only problem with this abuse technique is that it usually means all of your units get spread out, won't retreat, and die. Please tell me how a player could retain accuracy while moving.

16 hours ago, LetswaveaBook said:

If units lose accuracy after moving, you have difficulty to chase an escaping unit and hit it reliably.

Again, n is counted as shots since the last order. If you tell your archer to attack a cavalry unit running in a circle around it , each shot will get more accurate until it approaches the asymptote. Ranged units will still definitely be able to chase down other units if they are faster.

##### Share on other sites

this is unnecessarely complicate. prepare time before first shot is way more reasonable way to achieve the same goal. And the goal I don't even agree on. Archers are not too mobile, that's not the problem. main tactics used by archers won't change a bit by making them less mobile: archer spam both in defense and in attack will play almost exactly the same.

• 1
##### Share on other sites

In a24 archers are the most mobile non-horse unit.

I feel the equations are pretty simple to be honest. But then I don't really know how much math is too much to be doing per unit in game lag-wise and code-wise. Do you think archers should be slower than slings and slower yet than skirms?

24 minutes ago, alre said:

that's not the problem

What is the problem with archers in a24?

25 minutes ago, alre said:

prepare time before first shot is way more reasonable way to achieve the same goal

hmm, this is a lot simpler and probably does the same thing. Do you mean prepare time for first shot after order or after movement?

What is the problem with the idea that causes it not to have a positive effect on gameplay? can you explain with example scenarios?

##### Share on other sites

How is this simple? Imagine putting it in the unit card in the game, how would it show out?

I think it's self explanatory how this proposed change will not have an impact on archer spam: that strategy consists on massing up archers and letting them do their job almost autonomously, so... you get it. massed archers, without any micro, can be very effective in defense and also very effective in supporting attacking elephants or siege.

The problem with archers is, I believe, the exact opposite of what you seem to be trying to avoid here: fighting archers with melee or siege towers or cav or any other tactic really, is always pretty micro intensive, while the big advantage of archers is that they work very well just by putting them together and letting them do their job by themselves.

You seem to be overly impressed by archers potential for hit and run, but that's a counterable tactic that fits pretty well in the balance of the game IMO.

• 1
##### Share on other sites

2 hours ago, BreakfastBurrito_007 said:

I also don't see how you could abuse this.

I think it is likely to open some abusive possiblities. How about using the follow command and then not touching the archers but rather move the unit that is being followed?

Also your idea feels to me as trying to prevent people from managing their archers, which I find peculiar.

It can lead to wierd gameplay, suppose the enemy puts his hero in front of the troops, then the archers start shooting the hero. If the hero retreats, then the archer player has to prevent his archers from following the hero and hence accuracy ruined. Wouldn't that be fun?

• 1
##### Share on other sites

8 hours ago, alre said:

You seem to be overly impressed by archers potential for hit and run, but that's a counterable tactic that fits pretty well in the balance of the game IMO.

How is this counterable without cavalry?

8 hours ago, LetswaveaBook said:

Also your idea feels to me as trying to prevent people from managing their archers, which I find peculiar.

This encourages not continuous micro of archers, yes, but it does encourage and reward proper positioning.

8 hours ago, LetswaveaBook said:

How about using the follow command and then not touching the archers but rather move the unit that is being followed?

This is true, that would need to be accounted for if this was to be implemented. I am not sure if people actually use the "follow" mechanic but it could be adjusted to affect the equations differently.

8 hours ago, LetswaveaBook said:

If the hero retreats, then the archer player has to prevent his archers from following the hero and hence accuracy ruined

This is a problem already in the game: units tend to automatically focus particular things, like heros, palisades, farms, eles. This is frustrating even without the mechanic and would certainly need to be fixed before this is implemented. I talked about this earlier but forgot to mention heros.

##### Share on other sites

1 hour ago, BreakfastBurrito_007 said:

How is this counterable without cavalry?

Siege and garrisoning your units in ramms or once you capture buildings. Make sure the captured territory is connected to your territory root and build sentry towers to maintain control.

Maybe archers can run away, but the territory can be captured.

Also not only are archers the most mobile infantry type, they are on the other side also the least mobile. Archers are effective in large groups, not in small ones. That means an archer player needs to keep his units grouped in one spot and can't as easily split up his infantry archers. So you might try to attack from multiple sides and see on which side you can gain territory. I played a game vs. Chrisgtr and I had cavalry archers that he could never defeat. He won in the end by attacking me from various sides. Whenever my cavalry archers were targeted to deal with a treat, Chrisgtr was all-ready attacking somewhere else and retreating the troops I was targeting. That game is another example of the fact that you can win by continuously taking territory of you opponent.

Disappointingly, one medium sized maps, the groups of trees are so large that one group of them is enough for the entire game.

• 1
##### Share on other sites

Posted (edited)

I suppose you guys are right that archers are indeed counterable, its just that it takes much more effort and skill to beat archers than it takes to win with them as @alre said.

6 hours ago, LetswaveaBook said:

Disappointingly, one medium sized maps, the groups of trees are so large that one group of them is enough for the entire game.

This especially true on 4v4s, it can be impossible to get around them (*the groups of archers that develop at the borders of a 4v4). I was hoping to introduce a graduated penalty for mobile accuracy for longer ranged units so that shorter ranged units were more maneuverable. I feel that forests could be a bit smaller in area, and with better pathfinding as I have heard exists in a25, it will be easier to move in general.

Edited by BreakfastBurrito_007