Superpower

GitHub

Overview

This is an unfinished project which I began work on in January 2023.

In this project, I wanted to take some of what I had done in my university magic fps game and combine it with several previous projects I had created where the player is a superhuman with themed magical abilities which they can use. I didn't have much vision for the gameplay loop, only how the player would move and interact with the world.   

So far the game allows the player to move around the scene by walking, running and jumping; the player can take damage from falling from too great a height as well as use two magical abilities: one which fires a projectile and one which reverses the player's personal time. 

Animation

This game is my first attempt at using animations in Unity. I have a blend tree for the standard locomotion which blends between an idle animation when the player is not moving; a walking animation when the player is walking; a running animation when the player is running; and a sprinting animation when the player is running and having their movement speed augmented by an ability. Some of the animation transitions - particularly falling and using the projectile ability at the same time as moving - are not as fluid as they would need to be in a production project. However, since doing this project I have worked on another project where I have looked at player movement and action animations and I have now learnt how to eliminate some of these problems. A video clip from the new project is below.

UI

There is a relatively simple UI present in the game so far. There are three bars in the bottom left representing health, stamina and energy. At the moment the player can only lose health from fall damage though this will be expanded once enemies are more fleshed out in the game. Stamina is currently expended when the player runs and jumps, this will make the player have to more carefully consider movement. Standard walking does not cost stamina. Finally, using abilities costs energy. This prevents the player from spamming abilities which helps not only to appropriately balance the game but also limit the number of particle systems and objects in the scene at a given time.

In the bottom left is also a large square, this is where the element icon will go for the player's class. This square also acts as a marker that the player currently has their default ability selected. When an ability is selected the ability square gets a rotating, two-tone highlight around its border to show it is active. The five abilities that the player has access to aside from the default ability are on the bottom right. Currently, just like the default ability, they are also missing icons. 

Gameplay

The first of the two abilities currently present in the game is a simple orb-shaped projectile. This has a spherical collider on it and when it collides with something it plays its destruction effect before being destroyed. If it travels for too far a distance without colliding it is simply destroyed. 

The rewind time ability works by having all objects that can be affected by a rewind record their position and some other key values (such as ability cooldown times etc.) periodically in a co-routine and then storing a queue of these states where the length of the queue is the max rewind time divided by the time between recorded snapshots. If more snapshots are created past the max length of the queue, the first snapshot is dequeued to make space for the new snapshot. When an object which can be affected by rewind is then hit by a rewind ability, a copy of the queue is taken, the copy is reversed and the object's attributes are set to the values of the snapshots as each snapshot is dequeued until the queue is empty.