Summary of Star Wars Arena
In this game, the player has to try and survive for as long as they can while simultaneously trying to eliminate all the enemy droids that are located on the map. After all the droids on the map have been eliminated, the player will proceed to the next round where more droids get added to the map the player will have to try and eliminate.
To be able to eliminate the droids, they are able to attack them with their lightsaber when within a close enough distance to an enemy. To help aid the player in trying to survive, the player will be able to block any incoming blaster fire with their lightsaber as long as the player is looking in the same direction as the blast. If the player is not facing the correct direction when a blaster shot hits them, the player's health is reduced.
Along with being able to block blaster shots, the player has the ability to dodge incoming fire by dashing to the left, right, forward and back.
Purpose of the project
I chose to do create this project to help improve my skills within game development by creating a style of game that I have not yet created which is melee combat.
Contribution to the Project
All of the programming for the game was carried out on my own while the assets for the player model, enemy model and environment models such as the trees were imported through different websites and stores. All the assets that were used for the game can be found within the project folder.
Implemented Mechanics
Combo Attacks
The animations for the attacks were acquired from the Epic Marketplace and were designed to be used one after each other. To be able to have the player perform these attacks in order, a counter was used along with an array that stores the attack animations. Every time the player presses the left mouse button, the counter is increased starting from 0 and going up to 3. The counter variable is used for the array index to obtain the correct animation to be played.
"Anim Notify" was also used for the combo attacks to be able to have the following animation in the combo attack sequence to be played at the right time and not cutting of the current animation prematurely.
Dashing
To be able to dash, the player direction is used as the index of the array that is storing the dashing animations. To achieve this, the player direction is firstly divided by 45, this is then rounded to the nearest whole number and then increased by 4. This changes the angle the player was facing from numbers between -180 and 180 to 0 - 8. The animations for dashing can then be placed in the correct order within the array and have the new number signifying which way the player was facing match the array index for the appropriate animation. The appropriate animation is then played with root motion to allow the player to dash.
Lightsaber blocking
Firstly, to have the player's model appearing to be blocking, an "anim montage" is looped for the top half of the body where the lightsaber is held up in a blocking position while the lower half of the body uses a "blendspace" with walking animations to be able to have the player appear to be walking forwards, back, left and right.
After getting the animations sorted out, to determine whether to block a blaster shot or not, the dot product is used between the player's forward vector and the forward vector from the enemy that took the shoot. If the result of the dot product is within a specified range, then the shot is considered to have be blocked which deletes the projectile. If the shot is outside of the chosen parameters, the player has their health reduced along with the bullet projectile being deleted.
Initially, this calculation was done using the players' forward vector and the projectile's forward vector, however, when the player is up close to the enemy, the blast would be angled and therefore be registered as a hit when it should be blocked. Instead, the forward vector that is used is from the enemy that took the shot. This results in more accurate blocking.
Enemy AI
To create the enemy AI, the behaviour tree and blackboard were used together. This is a relatively simple AI system with the enemy firstly having to check if it is alive, followed by a check to see whether it is within a certain distance away from the player. If the enemy is too far away from the player, it moves towards them with the exact coordinates for where it needs to move to being updated regularly as the player is able to move around.
Once the enemy is within a certain distance of the player, the AI checks to see whether it is within a closer distance to determine whether it is close enough to melee. If the AI is not close enough to melee the player but too close to move towards the player, the enemy holds their ground and keeps firing at the player until either the player moves too far away from, or the player moves into the range that the enemy can melee.
Where to go from here
One of the first things that I would work on to take this game further would be to add a new enemy type which would add more variety to the game as the player would have to deal with different enemy types. However, while making this game, trying to find models with rigging that matched the game world was hard and therefore, to be able to add new enemies, I would have to learn new skills such as modelling to be able to adjust models and rig them to be able to make them usable for my game.
The second area I would like to improve would be the combo attacks. Even though I am proud to be able to make them work as this was my first time trying this, this can be improved to create a smoother transition from one attack to another and possibly add other attack combos to add more variety to the attacks.
Learning Points
Going into this project, I had set my self high standards as I have just come out of University with a degree and expected to be able to make something impressive. Even though I am happy with the final outcome of the project, a lot of my original ideas for this game had to thrown out as working on this project has made me realise that there is still a lot for me to learn to be able make a game that I can truly say that I am proud off, knowing that there isn't much more I could add.
Until then, I think the best thing that I can do is to keep trying to make small games with the focus being on one thing to try and get better at instead of trying to get better at everything all at once and not to expect to see a sudden change overnight.
This will take time, but I will get there.