Creating Recoil in Unreal Engine

< Back to Blog

In a shooting game, one of the most important pieces of a project’s identity is arguably the weapon recoil experience. In game design, the advantage of automatic fire is typically balanced by some sort of inaccuracy mechanic. The methods used across titles vary quite a bit, but the results often expose some of the game’s fundamental design principles and goals.

Counter Strike, for instance, uses fixed spray patterns for each of its weapons. This incentivises players to gain an advantage by becoming more familiar than their opponent with the arrangements–one of many elements that support its position in competitive eSports. But, in a completely different approach, Metal Gear Solid facilitates a friendlier controller experience by progressively widening the crosshair spread, but leaving its position mostly unaffected. Lastly, titles like Insurgency Sandstorm and Ready or Not lean into simulation territory by adding  upward and side to side movement to the camera for each round the player fires.

I like a few of these ideas, so here is how I started on my own system. I like the benefits of fixed spray patterns and the presentation of adding force to the camera per round. One of my early items of inspiration for this actually comes from Quake 2’s machine gun. It may seem a little primitive these days, and it’s certainly not universally appreciated, but I still always really enjoy shooting this weapon. I think the upward movement contributes more than just sensation, however, and combined with other natural stealth considerations for firearms (like sound), makes the decision to attack feel consequential and exciting.

I’m not making a multiplayer game though, so if using fixed spray patterns is eSports posturing, why would I want this feature? Mostly because of another competitive play style that I want to support: speedrunning. I’m not gifted at all in this area, but I am very interested in mechanics that increase the skill ceiling and encourage players to master a title. I think this is really important to a game’s lasting relevance and overall cultural impact.

One last detail here before moving on: recoil intensity increases as the player continues to fire automatically. While this approach isn’t very “realistic”, this will balance against a quick enemy time to kill, and further raise the skill ceiling for ballistic weapons. In my mind, only the highest skilled percentile should be able to effectively control a weapon’s spray after more than a few rounds.

Apart from the functional ideologies of recoil, there are also the decorative components that aim to make the experience feel fun. A lot of folks call this “game feel”, and a good amount of previously mentioned details already support this, but mostly as a secondary outcome. One addition, though, that was implemented purely in this spirit, is the slight recoil reset that occurs after each round. This was suggested to me awhile back, and I think it really sells the whole experience. The amount and speed can also be customized per weapon, so it ends up playing into the weapon’s overall personality as well, which I quite like the result of.