Accuracy

Accuracy system has been an important part of many tactical games, starting from simple to-hit percent and developing into more complex constructions which take into account full and partial cover, weapon and projectile characteristics as well as statistics of the shooter.

Accuracy should have its limits and restrictions, though. Be it different, everyone would just shoot as accurate as possible. Most obvious of these limits is the time cost, and, as a consequence, number of shots you can fire at your turn. This system, while simple, has its disadvantages, particularly for me it’s been hard to balance properly. I often tend to shoot more snapshots than less accurate shots, because it feels more damage-dealing. It gets worse when TU cost for aimed shot leaves no room for other actions, or when there is auto fire available (6-9 shots per turn are pretty devastating in terms of maximal possible damage).

States

I’m going to use slightly different approach. For the start, let’s introduce the aim command and soldier aim states.

By default, soldier is standing still, his weapon is lowered, but directed generally along his sights. In this mode any shots will be counted as snapshots, with heavy accuracy penalty. Aim command, when issued, will change state of the soldier to aiming. This action, as any other action, will cost TU to perform. Aiming presumes that the soldier will concentrate on maximizing accuracy, so one could expect better results as well as better reaction time, but the field of view will be narrowed significantly. Different weapons will have varied parameters of taking aim, for example, optical scope will increase accuracy further, limiting FOV to extremes (this will require implementation of free soldier rotation). From this state soldier can be returned to standing still, of course.

aim_states-300x248

Everything sums up to two firing modes:

Next in the list — retargeting action.

Firing a shot in a real world is almost instant. Still, it has to be somewhat balanced in terms of TU usage, and here’s when retargeting comes in. Essentially, it’s an additional expense of TU, which comes in after every shooting action. Think of it as a time you spend to restore aim after a shot.

shot-costs-300x248

If soldier has TU enough for fire, but not enough to retarget, he will fire as usual, ending the turn in a knocked aim state, which will take a portion of his TU to recover upon start of the next turn.

Introducing movement will be a bit complex. There are two basic types of TBS. One is “i-go-you-go”, where each team has its own turn, and actions are executed immediately (Worms series). Second type is “We-go”, where orders are planned first and executed for all teams simultaneously at the end of the round (Diplomacy, Frozen synapse). Games like X-Com, while falling into the first category, still provide means for some kind of semi-simultaneous action. Turn represent a fixed time interval (around 5-10 seconds), and TU measures how much actions soldier can perform during that fixed amount of time, basically, his speed. While moving your soldiers, you spend actions, not the global time. Notice that TU remains transfer to the enemy turn and can be spent there via reaction fire. This mechanic unites turns into a single round, merging (but not adding) their time intervals. It’s not a truly simultaneous action, of course, but this point of view is important for abstracting the time control mechanism, so it can work in both IGOUGO and WEGO modes. It also helps in understanding discreet movement states.

Soldier begins in standing still, as usual. When you order him to move, he switches to the walking state (a little TU cost). After a while he arrives at the designated place, what state he is now? Well, he isn’t moving anymore, so it’s standing still, right? Wrong. He is still in the walking position. From the game perspective, he is frozen in his moment of movement, and therefore suffers from sight distance, view angle and accuracy penalties. It’s up for you to decide whether he should stop to look around or continue moving.

States can be easily extended and bring variety into the gameplay. One can implement running state, with even more harsh restrictions on shooting/view, but with less TU/tile cost. Perks like gunrunner can modify aim penalty while running. And, of course, aiming and moving states can be nicely connected together, for those tactical breach situations.

Accuracy factors

In ideal conditions there are no such thing as accuracy. Gun barrel is always pointed somewhere, providing directional vector for the bullet with 100% accuracy. But even in a bench test bullets will spread under the whole bunch of factors, which we will classify and use appropriately. Start accuracy of 100% will be subsequently lowered to the final value.

Some factors may fall into more than one category, like running, which inflicts drawbacks on strength, eye and control levels. It could also be dealt with on each level individually, like arm exoskeleton reducing weapon shaking on a strength level, or aforementioned gunrunner perk allowing soldier to compensate control aim penalty for a degree.

Sum of these penalties will give us a variance, which could be used in a normal distribution to produce random deviation angle from expected vector of direct hit (gun-target). All possible deviations will create an infinite expanding cone with an apex at the gun barrel. Small penalty means smaller deviation and better chances to hit. Cross section of the cone by the target plane can be used to estimate hit chances (even though i’m against the exact percentage indicator, something like easy/hard target will be ok).

cone-300x248

Being able to control x and y penalty separately produces a nifty bonus:

niftytricks1-300x248

Spotter sees the alien but cannot open fire, he’s out of TU’s. He requests assistance, reporting enemy position (behind the bushes). Second soldier can only approximate enemy position, so he takes a decent vision aim penalty. If the game applies this penalty evenly to both axis, it could produce unnatural results of soldier firing much higher than bushes. Flattening the vertical axis, on the other hand, will improve results, creating realistic image of soldier trying to hit obstructed target, sweeping through the bushes roughly parallel to the ground.