
Project Description
Mancer is a First-Person Shooter game where you play as a "Elemancer" blasting your way through hordes of robots using your magic powers trying to destroy a factory from the inside by exploding cores.
This project was part of the course "Game Mechanics" in my studies at Stockholm University during spring 2024 and was made with 8 other students. During this course I got my first introduction to the game engine "Unreal Engine 5" and it's awesome features such as Blueprints, while also learning to use C++ in a video game environment.
The group consisted of students with different roles where I worked as a gameplay programmer. I focused on working with the shooting mechanics in the game and interactions around it. Here I was working closely with a VFX artist and animator to get smooth, but also good looking weapons.





My implementations
During the project, 5 different programmers worked and collaborated on many aspect during the game. My role during the project was focused on gameplay mechanics, specifically around the weapon mechanics which includes shooting, weapon switching and resource management. The functionality is shown below.
Shooting
The game features 3 different types of weapons that the player can use during combat:
-
Main Weapon: Weak projectile based weapon costing no resources and low cooldown between shots
-
Fireball: Strong projectile based weapon creating an AOE explosion on impact with a long cooldown and mana cost
-
Electricity: Hitscan laser dealing constant damage while firing with no cooldown but constantly costing mana
The goal with these 3 different weapons was to ensure to a have weapon for different scenarios during the game where the player might fight weaker, stronger or multiple enemies and always feel like they have something that the can use efficiently.
Basic Attack


The basic attack shoots a spherical projectile from the hand shooting towards the crosshair from a firing point. The biggest problem during the development of this attack was that firing would shoot straight from the hand which would change how the projectile flies depending on where the hand is (which would change a lot). This was fixed by at the moment of firing, a line trace was created from the player towards the direction of the crosshair. This would then be the location of which the projectile is fired towards which felt more fluid to use.
Fireball


The fireball is a projectile based weapon where the player shoots a projectile and creates an explosion. This deal damage in an AOE. This creates a sphere and checks for every enemy object inside the it dealing damage towards them. What's also unique about this weapon is that it is able to destroy specific type of objects in the AOE by creating a transient field crushing walls with a the unreal mechanic "fracture".
Electricity


The electricity is a hitscan type of weapon creating a laser between the hand and the object that is fired upon. This weapon continues dealing damage every frame that the weapon is fired scaling with delta time. It uses line tracing from the hand towards the crosshair.
Weapon Switching

The weapon switching works by checking an array for different weapons (in this case 3 different) and by using bools turning the active weapon to true and the other ewaapons to false. This allows a usage to add more eventual weapons and also makes it usable in Animation Blueprint for the logic in switching animations for each weapon. The switching of weapons is controlled in 2 different ways by be able to scroll with the mouse wheel and increasing and decreasing the value in the array for the correct weapon. The player can also switch to the weapon by using prefered button (standard 1, 2, 3).
Resource Management

The fireball and electricity use two different resources (Mana) corresponding to each weapon while the basic attack uses no resource. This encourages the player to use all the different weapons and strategies in which scenario they need to use each specific weapon. The fireball uses a specific amount of resource each time it is fired and recharges slowly while the weapon have not been fired in a set time. The electricity drains resources slowly each frame it is used and recharges the same way as the fireball. When the resource bar is fully used it will automatically swap the current weapon to the basic attack to allo the player to focus on shooting and not have to always look at their resource bar.