Home

Awesome

GASShooter

Introduction

GASShooter is an advanced FPS/TPS Sample Project for Unreal Engine 4's GameplayAbilitySystem (GAS) plugin. This is a sister project to the GASDocumentation and information about the techniques demonstrated here will be discussed in detail in the README there.

This is not production-ready code but a starting point for evaluating different techniques in GAS relating to using weapons. TargetActors with persistent hit results and ReticleActors particularly do a lot of code on Tick().

Assets included come from Epic Games' ShooterGame learning project, Epic Games' Infinity Blade assets, or made by myself.

GASShooter is current with Unreal Engine 4.27. There are branches of this Sample Project for older versions of Unreal Engine, but they are no longer supported and are liable to have bugs or out of date information.

KeybindAction
TToggles between first and third person.
Left Mouse ButtonActivates the weapon's primary ability. Confirms targeting.
Middle Mouse ButtonActivates the weapon's alternate ability.
Right Mouse ButtonActivates the weapon's secondary ability.
Mouse Wheel UpSwaps to next weapon in inventory.
Mouse Wheel DownSwaps to previous weapon in inventory.
RReloads the weapon.
Left CtrlCancels targeting.
Left ShiftSprint.
EInteract with interactable objects.
Console CommandAction
killKills the local player.

The Hero character does have mana but no abilities currently use it. This project's inception started when the new BioShock was announced and the idea was to include BioShock-like upgradeable abilities. That made the scope too large, but it is something that may be revisited in the future.

Secondary ammo is not used. It would be used for things like rifle grenades.

Concepts covered

This project does not show predicting projectiles. I refer you to the Unreal Tournament source code for how to do that using a fake projectile on the owning client.

WeaponPrimary Ability (Left Mouse Button)Secondary Ability (Right Mouse Button)Alternate Ability (Middle Mouse Button)
RifleFire hitscan bullets based on the current fire mode.Aim down sights, reduces firing spread.Changes fire modes between full auto, semi auto, and burst.
Rocket LauncherFire a rocket.Aim down sights. Starts lock-on targeting for homing rockets. Press LMB to fire homing rockets at targets.None
ShotgunFire hitscan pellets based on the current fire mode.Aim down sights, reduces firing spread for pellets.Changes fire modes between semi auto and full auto.

Acknowledgements

KaosSpectrum provided significant contributions to figuring out how the ability batching system works and general feedback. Check out his game development blog.