VFX of Combat Attack Trails






VFX of Combat Attack Trails

This week's focus is adding more engagement and visual feedback while in combat. Attack trails are a common technique that resembles the arc of a weapon in motion. The arc helps inform the player of their movements in combat. For example, if their swing is too far or if their angle of attack is too high. I enlisted the help of a tutorial for this effect: https://www.youtube.com/watch?v=6hW9D1omBKQ

Brainstorming
UE4’s cascade system was still pretty new to me, so I looked for the help of a tutorial. After going through a few I understand the foundation of what makes an attack trail. The tutorials were straight forward and allowed for further tweaking, especially the one above.

Next, I went through some different references using Pinterest and gameplay videos. This step helped me envision what I was looking for in a simple attack trail.




Materials



The material can be split into three parts: attack direction, detailed cutout effect, and extra polish.

1.1
    1. The first section determines the fall off relative to the sword's momentum. A simple gradient texture in the x-direction works very well. It gives a clean fall off with no added shader complexity. Using the TexCoord and masking out the Red channel returns the gradient needed. (reference 1.1) 







    1.2

    2. Next, the gradient needs to be flipped in the direction of the sword's momentum. Multiplying the gradient by a evens out the transition from white to black. (*Instead of lerping, it would be faster to use a “1-x” node*) (reference 1.2) 







    1.3
    3. The second section determines the shape of the swipe trail. Taking two panning textures and multiplying them together returns the needed texture. This texture is then multiplied by the gradient shaping the streak. (reference 1.3)









    4. The edges of the texture are masked off removing hard edges at the beginning cap of the trail. Removing the hard edges keeps the trail from being wider than the axe head. This works well when using a short bladed weapon, like an axe.




    Particle Emitters


    The cascade system consists of three individual emitters.


    Air Trail: The purpose of this emitter is to simulate the axe’s attack and stylize it. The lifetime was shortened to .2 seconds and the alpha is changed over life to fade out the effect. Having a shorter lifetime reduces the weight of the axe cutting through the air.
    Distortion Trails: The two other emitters simulate a blur effect when fast objects move past one's eyes. This effect also adds volume to the attack. The material used comes from UE4’s fire particle emitter. Its original use is for heat distortion, but it also works well for air distortion. The lifetime is staggered for these two emitters. One is set for .2 and the other for .3 seconds. Having them staggered smoothes the transition between all three emitters.






    Skeleton


    There are two separate sockets placed within the skeleton. They’re both connected to the hand of the skeleton. These sockets are placed relative to how thick the trail needs to be. Socket 1 is at the butt-end of the blade. Socket 2 is at the top of the blade. Using sockets allow for quick adjustments and iterations.







    Animation


    In the animation, there is a Trail Notify state that spans the duration of the swing. This is dependent on where the trail needs to start and end. Within the Trail Notify both socket names match the newly created sockets.





    DONE!




    Final Thoughts
    Things I would do different….
    • Use more references to create a stronger foundation of the swipe trail.
    • Add more meat to the beginning of the trail. Adding more to the beginning helps the player focus on the axe's blade instead of the arc's full motion.
    • Sit down with my animator and smooth out attack curves. When adding the animtrail it was obvious the animations could be smoothed more.
    • Clean up the fading. The fade between the beginning and end of the trail isn’t prominent enough.

    Comments

    Popular Posts