New Weapon Features for Switch

It’s been a while since we last published a development update for Switch – I’ve been quite busy with the Survival sample game for Epic Games of late. Meanwhile development has continued on Switch and we even some a few more people on board to help out with the project! We will show some of their contributions in the coming weeks. For now I’d like to talk about the weapons in Switch and the numerous improvements we’ve introduced as of late.

fbupdate_characterweapons

As for the weapon design of Switch we’ve been keeping it quite open and have been falling back on a simple assault rifle-only pattern up to now for playtesting. I recently got inspired to work on the weapons after seeing some new Halo 5 Guardians gameplay videos. They didn’t introduce many new features for their weapon system in Halo 5, but it reminded me of how simple and elegant it has been for years.

Halo includes a single weapon variant for each archetype (Pistol, Shotgun, Assault Rifle (Technically 2 variations here…), Sniper and Rocket Launcher) and weapon and ammo spread out throughout the level at strategic locations. Their approach with Power Weapons also interests me, the Rocket Launcher and Sniper rifle are particularly powerful and extremely deadly when wielded by good players. You do not spawn with power weapons by default, they must be picked up from somewhere in the map, usually a dangerous area which is naturally more heavily populated because of these Power Weapons.

In newer iterations of Halo you will hear a voice radio his teammates on events regarding these Power Weapons which makes this type even more central to the gameplay.

switch_assaultrifle01

Weapons (including Power Weapons) are dropped on death, and can be picked up by other players. This increases the focus on killing players who wield such a weapon, with their increased threat and increased reward when killed. Together with Battlefield, these games were a big inspiration when working on the weapon system for Switch. It’s still very experimental and subject to major changes, but this will form a great gameplay framework to iterate on both weapons and the gamemodes in the near future.

Accuracy, Recoil & Camera Shakes

For the recoil (applied to our camera) I used Battlefield as a primary reference. Breaking down their M416 recoil using frame-by-frame playback of VLC and trying to replicate a suitable framework for our own weapons.

weaponrecoil01

What I could gather from breaking down the video and how I interpreted and applied it to Switch is that a small camera delta is applied to the Pitch and Yaw of the first person camera, these values are retained as total delta (which is required to lerp back to the origin when firing ends) and in the case of the M416 the recoil is oriented to the right (see accuracy plot below).

After firing ends the camera delta reverts slowly back to the original position when we started firing the weapon. While firing however, you can fight the recoil by moving your mouse downwards, this helps you to keep your weapon on-target in long bursts. The system tracks this downwards (and sideways) motion and subtracts it from the camera delta, so that when you stop firing the weapon, you don’t move down beyond the original position you started shooting at.

Symthic is a great website for weapon statistics on games like Battlefield and Call of Duty. The accuracy plot below is from Battlefield 4’s M416 without any attachments.

m416_accuracyplot

And here is the M416 in-game, you can see the recoil pushes the weapon a bit to the right.

BF4_WeaponReference

Another neat trick is to add a camera shake while firing. Unreal Engine 4 supports camera oscillations, which is exactly what we’re looking for. By applying an oscillation to the Roll-axis of our camera we don’t mess up the weapon accuracy or recoil to much so it only adds a nice visual layer. This appears to be similar to what Battlefield 4 does during weapon bursts.

In case you are wondering how to playback a camera shake in C++ with UE4, I’ve included a snippet from our Weapon.cs class. This code is called on the simulate weapon fire where you would play back things like sounds and muzzle FX.

ASPlayerController* PC = (MyPawn != NULL) ? Cast<ASPlayerController>(MyPawn->Controller) : NULL;
if (PC && PC->IsLocalController())
{
	// Play camera (roll) oscillation
	PC->ClientPlayCameraShake(WeaponFireShake, 1.0f);
}
	UPROPERTY(EditDefaultsOnly, Category = "Camera")
	TSubclassOf<UCameraShake> WeaponFireShake;

Results of our implementation so far:

switch_recoil01

Aimed firing increases accuracy, but has no effect on recoil intensity. In this example the player does not try to fight the recoil to show you how it affects camera rotation.

switch_recoil02

In the third example we try to offset the recoil by moving the mouse downwards while shooting to keep it as close to the target as possible while firing bursts.

switch_recoil03

This system is still to be tested during our upcoming playtests, and may change dramatically – so far I am pretty pleased with the results and how it feels to maintain your aim and firing on-target.

Weapon & Ammo Drops

As an experiment we’re adding weapon pickups to the level. With a inventory limit of two weapons you will extract the ammo from any pickup weapons in the map if you already carry the weapon type. Weapons (including Power weapons) will be dropped on death and can be picked up by other players to re-fill ammo or retrieve the Power weapon.

switch_weaponpickups01

Power Weapons

Power weapons is one of the last weapon features I’d like to experiment with in Switch. They are limited in availability, usually only carried by one player in the map and they don’t carry a lot of ammo. They can change the battle significantly in the right hands. A player with a Power weapon is an immediate threat and priority to take down in a fight. You can grab a dropped Power weapon from a killed player and use the remaining ammunition to your own benefit.

switch_powerweapons01

Coming up Next

This new weapon system will be tested along with our SwitchTDM experimental gametype in our upcoming playtests. This includes Steamworks integration as well which should make it easier for us to host playtests in the future.

Meanwhile you can follow our updates on Twitter, Facebook or follow this blog to receive new posts right into your inbox!

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

3 Comments

  1. Hello there, this is interesting and I’ve been trying to get something similar to work in my little project, that is to have recoil able to be counteracted and I was wondering if you could point me in the right direction.

    Now I’m not trying to have the weapon rest back after firing as I would like the Player to be in full control of recoil management before and after shooting. So far I have this: http://i.imgur.com/CXLkcdo.png

    Which as you can see I am feeding the mouse y value into the random recoil amount and then setting that as well as the yaw and roll as the B input for a rotator lerp. Now it sorta works as intended however It seems to jitter about quite violently when the mouse Y value is anything other than zero.

    I’ve tried a couple of things like setting the use of controller rotation pitch to false before the timeline and setting it back to true as the timeline finishes but that seems to make the shakes worse. I’ve also tried changing the location of where the mouse Y actually gets fed into the rotation, but that also had very little effect.

    Any help would be very much appreciated.

    • Hi Nathan,

      I’m not doing anything for camera/recoil through BP so I’ll be making guesses here, but it would perhaps make more sense to use mouse delta’s instead of absolute mouse position Y? (I’m not quite clear on the output value of Get Mouse Y in what ‘space’ that is) That is probably the first thing to check in your BP layout.

      – Tom

  2. Alright, sorry for bugging you, I seem to have fixed it mostly now though http://i.imgur.com/U1NiePO.png

    As you can see I got rid of that temp var and just fed the random offset stuff straight into the B input of that rotator lerp and that seems to fix it, now it doesn’t jutter and I can counteract the recoil as well, I have a feeling though that it is constantly adding the numbers over the timelines length so lets say I want it to move up by 1, but I think it adds that 1 a few times because of how I’ve got it wired into the update.

    Either way, thanks for answering regardless, your work is very helpful and inspiring.

Leave a Reply