ONSLAUGHT
Engine / Language
UE4 / Blueprint
Project Size
2 people (Programmer & 2D Artist)
Duration
4 Weeks
ABOUT ONSLAUGHT
ONSLAUGHT is a 2D rogue-lite survival game. I was heavily inspired by Vampire Survivors and used it as an opportunity to learn about the Paper 2D system in UE4.
The player starts with a single weapon type on their spaceship and have to navigate around the map, dodging and destroying the enemy ships to collect XP points and upgrades. Earning currency allows the player to unlock new ships and permanent upgrades.
DEVELOPED FEATURES
Ship movement
In-game upgrades
Rogue-lite upgrades
Ramping enemy waves
11 types of turrets and their AI
Niagara FX
I was helped by a friend of mine : www.artstation.com/pequignotvirgile
He provided me with various sprites and UI designs while I made everything else. It is not very well balanced but we mostly were having fun with various outlandish ship designs.
Ship Movement
I used a physics-enabled flipbook as a root component in order to move the ship using force and torque. I wanted to use the ship's movement as a source of difficulty in and of itself. This sets Onslaught apart from more classic VS clones.
CODE SNIPPET
In-game Upgrades
As the player levels up, they receive random upgrades, spread between turrets for their ship and systems, which are passive stat boosts. Some upgrades will add new stuff to the ship, while the others will upgrade existing components.
The biggest hurdle was in figuring out how to generate the right upgrades and avoiding duplicates and infinite loops. It was trickier than I initially thought, especially since I had to go back to the project after a nine-months hiatus.
More explanations in the code snippets.
CODE SNIPPETS
First, the function checks if both the player's turret and system slots are full, and if they are fully upgraded. If they are, we spawn money and health upgrades.
If they are not, another function sorts all the turret and system classes into two arrays for both types of upgrades : Potential new upgrades, and currently equipped upgrades.
We then use the player luck to determine if they get 4 upgrades instead of three, and then we enter a Breakable Loop in which we run the last function. If the game determines that the player can receive less than the total number of upgrades, we break the loop and finish by setting up the widget's background brush.
Using different weights and conditions, we then add upgrade widgets to the list.
Roguelite Upgrade Menu
This code handles the Upgrade Menu Widget. It gets every roguelite upgrade from the Game Instance Singleton and adds all of them to a widget list. It selects the first one as the default picked upgrade.
The "Upgrades Data" list is updated every time the player buys an upgrade and is saved on a SaveGame object when the game is closed.
CODE SNIPPET
Enemy Spawning
I used a simple yet effective method to spawn enemies all around the player, adding a random normalized vector multiplied by a spawn distance to the player's location.
CODE SNIPPET