By Adrian Chmielarz Posted in Witchfire on 2019/02/27
Why does aim assist exist? Why does aim assist exist for mouse and keyboard?
The answer to the first question is easy. Aim assist was invented to make it possible to play first person shooters with the controller. Aiming with the controller is hard and nowhere near the precision that the mouse offers (there’s a reason why for over fifty years the mouse remains the number one pointing device).
Aim assist tries to compensate for the controller’s deficiency, and even though it’s still not the mouse, aim assist techniques have advanced far enough throughout the years for even some PC players to prefer the controller over the KBM.
But why does aim assist exist for mouse and keyboard?
Before I answer that, we need to look at what aim assist means, exactly. In Witchfire, there are two components of aim assist:
Stickiness exists only for the controllers. Not only it’s not necessary for the mouse and keyboard, it would actually get in the way. Muscle memory – like how much hand/arm effort it takes to move the crosshair a certain distance with the mouse – is an extremely important part of aiming. Anything that messes with it – like “random” crosshair slowdowns – would rightly frustrate the player.
So the stickiness is a controller-only thing. I guess it’s easy to understand why bullet magnetism exists for the controllers, too. The same story: pointing with this clunky device is hard even with the stickiness, so let’s help out a bit more and don’t require the player to be pixel-perfect with their aim.
However, that’s not the whole story. I mentioned it already, but in some games, and in Witchfire too, bullet magnetism also affects the mouse and keyboard.
There are two reasons for this:
And this is why bullet magnetism exists both for the controllers and the mouse and keyboard.
For what it’s worth, though, bullet magnetism is not really a bullet magnetism.
There are no curved bullets. That’d be a whole bag of issues, like – if there was any bullet travel time – literally being able to kill enemies behind cover.
Gamers often think that bullet magnetism means large hitboxes. The idea here is that an enemy head is one thing, but there’s another head, an invisible one, that’s slightly larger than the real thing and used to detect collision with the bullets. Which explains why if you miss the real head by just a little, the shot still registers.
Most likely, that’s not it. One example reason is that various weapons usually have different aim assist values (you don’t want a sniper rifle to have the same aim assist generosity as a submachine gun) that also change with distance. Dynamically scaling and morphing (because it could not be just a simple scaling) all the weirdly shaped (from physics point of view) hitboxes is an absolutely unnecessary strain on the processor.
There is a much easier way, and this is what we use:
As you can see, the “bullet magnetism” system is attached to the gun, not the enemy.
There are five circles here, and here’s what they do:
The two outer, dark pink circles are for the stickiness. As soon as the larger circle touches the enemy, the crosshair begins to slow down. It reaches the full slowdown when the smaller circle touches the enemy.
Currently this system traces just the most important bones on the enemy (like the spine) to avoid weird slowdowns when an enemy hand enters the picture for a split second. It’s likely we will redo it in the future so it simply traces the enemy’s capsule (a “hitbox” used for movement and collision with other enemies and the player).
Inside there are two other circles: the larger is dark blue, the smaller is light blue. As soon as the larger circle touches the enemy, the spot that your bullet will hit will move closer to the edge of that circle. You would still miss the shot, though. It’s just that the bullet would hit closer to the enemy.
When the light blue circle touches the enemy, this time the bullet will hit them. In other words, as long as any part of the enemy is inside the light blue circle, it’s a hit.
Finally, there’s the smallest, white circle. This is used to prioritize critical hits (like headshots) over the regular body hits. If you aim at a body part but a critical area (like the head) is inside the white circle at the same time, the bullet will be pushed towards that area rather than hit the body. This helps avoid moments where e.g. you try to score a headshot but the enemy randomly waved their hand and the bullet hits the tip of the finger. Technically correct would not be the best kind of correct in this case.
The red cross inside all these circles is our debug thing that shows precisely where the bullet will land.
This is how it all works under the hood (choose Full Screen to better see the behavior of the red cross). Notice how the red cross changes position dynamically depending on what circle contains what body part. First it sticks to the head even though in theory our crosshair is not precisely on it yet, then later is sticks to the body even though our crosshair has left it.
The clip also highlights another benefit of aim assist: the ability to avoid the clothing issues. Like, a cape should not be something that when hit, depletes the enemy’s health, right? It’s just a cape. But if you shoot the cape, which feels like a part of the enemy, and there’s no damage, that feels weird. You feel cheated for not getting the damage in. With aim assist, to the player it still looks like the hit registers, even though we don’t treat the cape as something that’s connected to the enemy’s health.
Is it all that “simple”?
Well, yes, but actually no.
We’re seeing circles, but that’s just because we’re looking at it all from the player’s perspective. If you would be looking at it all from a side, you’d see multiple cones. Except they’re not perfect cones, because aim assist grows with strength until it reaches a weapon’s maximum effective range, then quickly deteriorates to make the out-of-range shots harder and less effective.
There’s more to the aim assist in Witchfire than what I described above, but I hope the post gives a pretty good idea of the way things work in the game. I think with this system – each weapon will have its own set of “circles” – we’re able to have the aiming system that feels fair, but without the weapon doing all the work for you.