Bullet Kinematics & Fun in Shooter Games

I happened to be thinking about games this weekend and was surprised at how differently I rated a number of first person shooters re: fun factor. After reflecting, I think the game physics have the biggest impact on my personal enjoyment of shooter-style games.

Why is that? Well, I noodled through some kinematics and convinced myself I had an insight or two.

Let's think about a 'target' in motion. Most games adhere to the kinematic equations of motion, where after time t, the player position is given by:

position = v_initial * t + (1/2)at^2

So the player varies their acceleration during the bullet flight time t, which boils down to choosing a reachable final position at time t. Under most normal game constraints, like a maximum player velocity and fixed allowed player acceleration, you wind up with a continuous range of final positions. Even with fixed acceleration, analogous to only 'go left' and 'go right' buttons, a player can generally vary the final position in either direction to any value up to the limit implied by the maximum acceleration by accelerating only during discrete intervals during bullet flight time t.

Now suppose a 'gunner' player shoots a projectile at the target. If the target doesn't realize it has been fired upon and fails to vary its course, the gunner can trivially score a hit by solving the player movement equation. Most players can 'eyeball' this quite trivially and blast away at enemies that do not vary their path.

But what if the target player realizes it is in combah? Under what conditions will a bullet definitely hit?

Assuming a point bullet, if the possible range of target positions at time t given any allowed choice varies in width by less than half the width of the target, the bullet is unavoidable. These conditions change based on whether the object is already in motion: at rest, asuming t total seconds of bullet flight time, and (t-t_totop) seconds spent at top speed, the constraint is:

width/2 < a(ttotop)^2 + vmax(t-t_totop)

At max velocity, this is reduced up to 50%!

width/2 < 1/2(a)(ttotop)^2 + vmax(t-t_totop)

So, there is a discontinuity which implies an ability to dodge the shot, or not dodge the shot, based on the bullet flight time t in relation to the max speed and player acceleration. If you don't have enough time to dodge, you will get hit, period. And if the target is already running at maximum velocity during at the moment the gunner fires, it's harder to dodge as half of it's movement options have been removed. (Explains why Mario seems to get nailed by enemies a bit easier when running and jumping through levels at top speeds, with new enemies appearing and firing randomly as the screen scrolls to keep up).

These equations describe a scenario where we have players that are dodging bullets at a certain range, but cannot dodge once the target and gunner get close. One way to introduce skill / interest into the game is to account for variable player reaction time.

Given a fixed reaction time r after which the final impact position of the bullet is known by the target, a bullet may be dodged or not dodged based on ability to travel at least 1/2 the width of the target from that area within time t-r. (Flight time minus reaction time). Again this implies a discontinuity and perfect strategy, with faster-reacting players able to possibly dodge shots that less-skilled players could not.

Given a fire rate f the gunner may choose a strategy of several position, impact time pairs. The delta between firing times can be regarded as a new possible lower bound constraint on the avoidance time of the target. If the target cannot travel half his width given his initial set of position and velocity vectors within this time he will be hit.

It's also worth mentioning that in a situation with a max allowed velocity there may be a situation where if a series of dodgeable bullets are fired, the need to accelerate near the max velocity to dodge could restrict the total range of reachable positions for the next shot by the target. So a target could be 'herded' by a hail of fire into a situation where a hit is unavoidable, even if an individual shot is avoidable.

So how do these dynamics influence play? Well, if the bullets are not perceivable (or approximately imperceptible because reaction time is too long), but ARE avoidable, the best strategy is to randomly vary the target position within the allowed range while under fire. 'bullet dancing'. The best strategy of the gunner is to fire randomly within the range of possible positions. The expected hit percentage is the fraction of the total positional range occupied by the target. This explains behaviors like side-strafing and bunny-hopping, now-ubiquitous movement randomization patterns especially in close-combat, fast-bullet combat games like Call of Duty. Key winning strategies in these games involve surprise, shot accuracy, and random movement patterns, and combat is generally decided quickly.

On the other hand, if the bullets are perceivable and avoidable given recognition the best strategy is to avoid incoming fire. In a perfectly-skilled game, the gunner might as well not fire, though many shooters collaborating may change the equation. Massively multiplayer shooters like diep.io follow this pattern, with player movement / shot-and-crossfire avoidance skills being the most important. (Or the classic Cyberdemon from Doom---a scary creature that fires a rapid string of 100% avoidable projectiles).

What does this say about games with aiming?
If fun is related to degree of skill/variety of situations encountered in a game, then weapons which vary between dodgeable and undodgeable within normal playing distances, bringing player movement as well as aiming into the forefront would be the most fun. This might explain why my favorite game weapon is the spinfusor from Tribes. This weapon captured dynamics from all the above scenarios --- undodgeable but tough to aim in close-combat situations, dodgeable at long distance, but less so when traveling at top speeds, and with an explosive impact radius that allowed players to be 'herded' into guaranteed impact zones under certain conditions. (Fire one shot along their present course, they brake to avoid, then often get hit with a follow up shot). The truly 3D plane of player movement yet somewhat predictable acceleration profile of the player jetpack also broadened the movement set to an enjoyable degree of complexity, while not to the point that dodging fire was all that easy.

The takeaway for players in my opinion is clear. If guns shoot fast relative to player movements, focus on firing first and moving randomly during combat. If you have more lead time and can see the shots coming, dodge and try to attack in ways that force your opponent into moving predictably. And if you are considering buying that new game, think about whether the movement and weapon set lead to more twitch-based, close-combat scenarios, or the slower chess game of longer-distance combat, and which you enjoy most.