The sway movement effect in DayZ is exactly the opposite of real human aiming. In the game ATM the crosshair moves slowest along it's path when it is furthest away from center, and fastest as it passes the center point.
In human aiming the point of aim moves fastest when it is furthest off target (moves fastest back towards center) and moves slowest when it is closest to the center. So the crosshair ATM acts like an orbiting body, this motion is familiar to our eyes.. But it's wrong.
OK
This is about the math of the sway function - it is not complicated math. I explain some stuff about aiming first, if you want to see the math then skip to the conclusion after the diagram.
There are two steps to aiming a weapon - these are quite different ..
Step ONE : Human beings have an instinctive targeting ability - this is because we have binocular vision (specifically targeting eyesight) and are hunters, by instinct and by our inherited physical and mental structure. The act of targeting is unconscious and instinctive, it is built-in to human beings. We do it all the time, cannot help it, and usually do not even notice it, so much it is in our nature.
If you lift an arm and point a finger at a distant object, then observe what happens. Without any concentration on your part, your finger remains pointing AT the target, and continuously recenters ON the targe, your balance, muscles and unconsious mental functions return the finger to the target all the time, by an incessant feedback process. You continually return to center on the target. This is not difficult to do (you can't help doing it when you point at something) and requires no 'effort' from your conscious mind. Even if you move about, turn left or right, jig around, the finger remains pointing at your target without any stress on your part, it is instinctive. You don't need training for this.
OK that's the first element of 'aiming'. It's a natural process, any standard human with normal eyesight and normal nervous system does this.. must do this, it does not require conscious thought even though it is a sophisticated action. Unconscious areas of our mind deal with it.
Step TWO : So yo've got the finger or the crosshair, on the target. Target is "in your sights". Now you concentrate on that, - using my example with your finger - NOW you squint down your arm at your finger and use your conscious mind (for the first time). You see that finger constantly compensating and continuously returning to the center of the target. You watch very carefully and you choose the exact moment the finger moves exactly on to the center target and you fire.
OK, so that is what you do consciously when you fire..you select consciously the moment when your non-stop body-mind targeting instinct returns closest to dead center.
step one is instinct: the natural inbuilt human function
step two is decision: concentration, conscious observation, and selection of the moment.
Many different factors influence how good you are at this (training, drugs, zen, whatever) but my point is that everybody with a standard nervous system can do it.
Main Point is that the first, automatic human targeting ability works so that the further your finger or sight is from center, the FASTER it returns towards center. This is a direct feedback loop, with feedback proportional to the distance from center. Many variables move your finger away, but the force moving it back is stronger the further off target you are, so it moves fastest towards the center when it is at the greatest distance, and moves towards the center slowest when it is already near the center.
°°°
So I was thinking about a sway function that could imitate this experience in the game.
I understand the need for sway (both rested and unrested etc)
But the human instinctive unconscious return-to-center ability is completely unlike the conscious wrist movement of a computer mouse to counteract a generated crosshair displacement.
[sorry about this hand-sketch, I can't plot this on PC as I don't know the exact function BI used - but I guess I know the general function, and it's the wrong one]
In-Game Crosshair Displacement - the crosshair moves FASTEST along this line when it is closest to center, and slowest when furthest away. This is WRONG.
[edit: as a simple explanation of the math - they are using a very common math formula that is used - for instance - to show orbits of objects around a planet, or show a homing missile turning to follow a target (its called a "Kepler orbit equation"), it's used for that kind of stuff - and in this case BI are also moving the zero point of the equation, called the "origin" - all the time (they tweaked the basic equation), so the "orbit" keeps changing..This formula is real easy to find anywhere in programming. It's the first function you'd find under your hand ready to plug in, specially if you didn't give much thought to it)
a ) Because of the random horizontal and vertical displacement applied to the origin of the function, the limits of the function form a rectangular box with rounded corners, instead of a circle
b ) Also because of the variable horizontal/vertical displacement of the origin, the function does not predictably pass through zero (target center) and there is no reason it should ever pass through target zero inside any given time.
[ !! think about that = " ATM there is no reason the crosshair should ever pass through target zero " If you have ever shot in real life you must know how totally WRONG that is : seriously sick snafu !! ]
c ) At present in the game - The movement is at constant areal velocity (allso called "sector velocity"). Therefore the crosshair moves slowest when it is furthest from the center and fastest as it passes close to the center.
Take my point ( c ) and leave the other stuff as it is:
The delta-v (along the path) component, is exactly the opposite of real human aiming. In the game ATM the crosshair moves slowest along it's path when it is furthest away from center, and fastest as it passes the center point.
In human aiming the point of aim moves fastest when it is furthest off target (moves fastest back towards center) and moves slowest when it is closest to the center.
OK - the crosshair speed is a result of the equation used - its a tweaked "ellipse" equation [looks/acts like a Kepler orbit] but the variable " t " is faked, it is not really inside the equation. So the crosshair acts like an orbiting body, this motion is familiar to our eyes.. But it's wrong.
The time t in the function has no effect on motion (right?) that is, the time interval has nothing to do with the 'orbit' parameters, it is simply a pause between plot points:
plot point z
pause t
plot point (z+1)
pause t
.. etc ..
So we can mess with t as we like and it will not alter the form of the plot, t is not inside the trajectory function and does not influence it.
I PROPOSE
make the 'plot interval' t inversely proportional to the distance from center ( r )
result is that the crosshair moves faster at the limits and slower as it passes closest to the target center
in fact, use ( r+[arbitrary constant] ) to avoid divide by zero at target center
t = 1 / ( funct. r ) + n
Try different functions of r, to produce a smooth visual plot effect with observable acceleration near the limits and deceleration near the center
Because you are already using an x,y function to create the tweaked ellipse, then to find r is mega-trivial. One programmer could mess with this for just a few hours (total) to see the effects on how the crosshair moves in the game.
OK that's it. Radical realism-upgrade of the sway function with minimal programming effort.
Also this should be interesting to BI in all their games and simulations, because they are quite proud of their standards of realism on weapons, but here they have let themselves down just by carelessness. They have done something obvious, easy to implement - instead of thinking how it should be. Trying this out could put them a full move ahead of everyone else in realism, for really just a very small expense of thought and testing.
Just to put the cat back where it belongs with the pigeons - my argument about the human aiming instinct means that - in any standard static target shooting competition range, with any standard competition target, a normal human being when familiar with the equipment (that's all it takes) must be able to regularly hit the target inside the outer ring, unless they are truly 'gun shy' or are led by their own education to confuse the innate aiming ability, and think that they cannot or should not 'use a gun'. Anyone (everyone) can do this. It's no big deal.