Sugar War

Technical details

Engine: Unreal Engine
Version: 5.3
Genre: Rouglike
Team of 6 people:

  • me as the only programmer,
  • 2 designers,
  • 2 graphic designers,
  • narrative designer.

Assets: Created by graphic designers
Itch.io: Link

Description

Game was created during TK Jam 2023 during less than 2 days in Unreal Engine 5 blueprints. That was the first almost full game for the all of us as a team. Now I will dive into details. Technical description will be divided into two important parts: player related solutions and the second one, enemy related.

Player

Player has the functionality of attacking, moving and losing hp which is reflected on his health bar. As most of the movement code is from third person character template, I will show only the attack functionality as it was impelemented by me.

Here is the blueprint for the player attack lock. It locks the player from moving and attacking for 0.2 seconds after the attack, also starting the animation.

Then two things happens. Below you can see the arrow for the player attack.

When it hits the enemy, it calls the Apply Damage function on it. The second action releases the lock on player actions. Overall the attack takes 0.6 seconds to happend.

Now let's take a look at the enemy.

Enemy

In this game all of the enemies (2) use the same blueprints for actioms, Behavior Tree and Animations. I will show the most interesting parts below. Starting with the most important part, the Behavior Tree. It was implemented using Behavior Tree, Blackboard and Tasks

It is divided into 3 main parts: Attack, Chase and Patrol. One that is not that important is called Jump - this allows the AI to use NavLinks.

Each of them is equally important, so let's start with Attack.

Attack is called whenever the cooldown for it refreshes and the player is in the hit range. Then the AI performes an animation. This animation has Draw Sphere and Apply Damage embeded on specific frame of animation, which allows the player to dodge the attack.

Chase is called whenever the player is in the chase range. Then the AI is chasing the player with the speed of 300. Then if it is in the hit range, it calls Attack.

Patrol is called whenever the player is not in the chase range. Then the AI is patrolling between random points (with the same speed as above) that are chosen withing 300 to 600 from it's current position. When it reaches the point, it waits for a moment and then chooses another one and goes there.

Key takeouts

It was my first time using Unreal Engine 5. Thanks to this opportunity I saw how powerful blueprints are. In less than 2 days we were able to make almost full game. In my opinion blueprints are excellent choice for prototyping and for some simpler tasks. I felt that Behavior Tree is really intuitive and impressive with functionality. Also, there are few things that weren't shown here, that I think are interesting like tricks to use widgets as a movie player or using NavLinks to make AI jump over the gaps. Those things are not that hard to implement, but they are really useful and I am glad that I had the opportunity to learn them. I am planning to deepend my knowledge of animations, that can be complicated and there are few ways to take advantage of them.