project nightfall
Engine: Unreal Engine
Genre: First person horde shooter, tower defence
Platform: PC
Team size: solo project
Aboute the project
This is a first person horde shooter with tower defense elements in it. In this project I am using Unreals Gameplay Ability System(GAS) to make the player abilitys. The majority of systems in this projects is made using C++ and the only part that uses the blueprint system is when I need to change the color of a objects mesh.
Ability System / GAS
Gameplay Ability System
In this project I decided I wanted to learn how to use the gameplay ability system(GAS) in unreal to make agilitys for the player. These area the abilitys I have implemented so far.
Granade
When the ability is activated you equip the granade and when you press the fire button the player will trow the granade in the direction the player is facing and when the granade hits anything it will deal damage to everything around it.
Mine
When the ability is activated you equip the Mine and the ability targeting starts. The mine will target the closest surface to where the player is aiming. When you press the fire button the mine will be placed and when a enemy gets close to it the mine will explode and damage everything around it,
Build System
In the build system I created for this project most of the buildings will use the build grid that is placed in the zone you can build in. Some buildings don't use the grid and instead can only be placed on special snapping points. If the building uses the grid or a snapping point is decided by a enum in the building class
Grid based
Grid based
For the build system I made for this project I wanted to make a grid based build system that could handle buildings bigger then one node. To make that work I hade to implements a system for checking if all the nodes the building want to take is available and when a building is placed takes all the nodes its occupying. The grid that is used by this system is procedural generated at the start of the game so the grid will changed depending on if the world is edited so holes can appear in the grid. I managed to make this systems work after some time but one problem with the system is that it doesn't work if there are holes in the grid.
Snapping point
The buildings that use the snapping point build system are the buildings that can only be placed in certain places like ore deposits. The snapping point class has a collision that the build system uses to detect when you are aiming at a location with a snapping point. If you have a building selected that needs a snapping point it will snap to the snapping points position and will change coler to show the player that it can be built-
Snapping point
Weapon system
When developing the weapon system for this project I decided to have each weapon type be a child class off the main weapon class. The main weapon class handles most of the logic like the projectile selection using a object pool and the reload of the weapon. The only thing each weapontype child class handles is the shooting system for that weapon.
Full auto
The first weapon type I created was full auto weapon where as long as the player hold down the fire button and there is ammo in the gun it will continue to shoot until the player releases the fire button ore run out of ammo.
shotgun
Another weapon time I have implemented is the shotgun. In the current implementation my shotgun fires the pellets in a square shape. The current implementation of the shotgun system uses a variable that says how many pellets each shot is going to use and then gets the square root of that value to get pellets are in the X and the Z axis (Right and Up axis). When the player shoots I use the position the player is aiming at and then use a variable for the space between the pellets and times it by the amount of pellets on that axis and times that value by ether the cameras current right rotation or up rotation and then divide it by 2 to get the starting corner of where the first pellet will go towards. When I have the start location I use a nested for loop that uses the amount of pellets in the X and Z axis to get all the other positions of the pellets, I get the location of each pellet using the equation
( the start aim location - (Camera view right * distance between pellets * X in the for loop) + (Camera view up* distance between pellets * Z in the for loop) ).