Elemental Asset Integration
Author: Yashwant Patel
Problem:
For our water elementals (small, medium, large and boss) they all had one model. Wasn't really a model, but particle. This was fine in the prototyping phase, but for the final version of the game it would make the game feel and look bland. For players it wouldn't feel satisfying to look at the same model for different enemies and having an enemy that doesn't have animations doesn't feel great either.
The change that would address all these problems would be to add models for each of the elementals, but where to find them?
Solution:
We scoured different 3d model sites (including UE marketplace) for free models, but this didn't work out. Then I came across a way to rip models from WoW and import them into the engine. This seemed like a great idea and the models worked pretty well with animations and our custom materials, but as the professor pointed out this would violate Blizzard's terms of usage.
So we finally decide to use the UE marketplace and just purchase elemental pack ourselves, since they were on sale for 70%. With assets in our hands now it was time to integrate them into the project. The small, medium, and large elementals were implemented with a walking animation (when slowed by towers), running animation for normal movement speed, a death animation for when dead, a hit animation when getting damaged, and an attack animation if applicable. Walking/running animations weren't that hard to implement, since the transition between the states would happen when the elemental gets slowed and unslowed, so just needed a bool for that. For death a bool was also, used to transition from the walking states to the death state, but the elemental actor needed to be destroyed after the animation was over. In order to accomplish this an anim notify is placed at the end of the death animation where the elemental actor gets destroyed when it finishes. The hit animation wasn't too hard either, since you create a montage of the hit animation and play it when the elemental takes damage, but from a design perspective we felt like they should only play the animation when the player shoots the elemental, since they would constantly be taking damage in the later stages of the game and it would feel weird to look at the elemental constantly playing the hit animation.
The attack animations for the medium and large elementals were the most involved. The medium elemental had an attack that got fired every 3 seconds that would damage towers in a certain range. There was no indication or projectile/effect that would show this happening, so how should the attack animation be linked up to show this happening? In order to fix this problem I decided to implement an idea that I had for projectiles. I made a projectile that would basically travel to towers within range in an arced/parabolic shape. The easiest way I could think of doing this was using timeline curves with float tracks.
Then using the values from the float tracks as the alpha values for the lerp and lerping the projectile from the start point to the target's location. In order to make sure the speed was consistent I adjust the playback rate of the timelines depending on the distance and speed variables, so projectiles don't travel super fast when towers are further away since the timeline is 1 second long. Another variable that was added was a height variable that is used to adjust the height/peak of the projectile depending on the height difference of the projectile start and tower location, so projectiles don't clip through terrain.
After the logic was implemented the projectiles were spawned every 3 seconds targeting towers that were within range of the medium water elemental. The projectiles are fired with a delay between each one, so all of them aren't fire instantly and the elemental plays a channeling animation while it happens. Another thing that was added is that the elemental fires a projectiles randomly from each hand, so it feels more polished.
The large elemental already had a homing projectile, so in order to implement it's projectile an anim notify had to be added where in the attack animation the projectile should be fired. Once the function to attack is called from the anim notify a projectile is fired from whichever hand played the animation. All of these changes make the elementals feel more lively and interactive for the player.
Comments
Post a Comment