NOTE: The final look of the effect has been updated and can be viewed in the VFX Portfolio page. While I will not be updating this breakdown with the new visuals it still uses a lot of the same ideas and techniques used in this breakdown.
When it comes to magic spells in fantasy games I don’t think many are as iconic as a mage casting a magic bolt of arcane energy right into the face of a level 1 goblin. They exist in almost every fantasy game in some way shape or form. Having never made a magic missile before, I decided to make one of my own!
Below you can see the final result and I’ll be breaking down the steps I used to get there.
When it comes to references I notice a lot of magic missiles carry similar qualities. They often are very wispy in nature, have a long, thinning trail, and carry a lot of blue and purple hues in their color schemes, oh and they love sparkles, a lot! Some of them even carry a very cosmic feel which is is where I plan to push my rendition of it since I’ve always loved that space-like cosmic aesthetic.
Let's make some Magic
With projectiles, be it realistic or fantasy, there are often 3 core components: The head which is the focus and what attracts the eyes of the player, the trail which gives the projectile a sense of motion, and the collision which gives that sense of impact and satisfaction.
However before going through the process of making something super flashy, it’s important that we get the feel of the particle right. Since I’m aiming for this to be a projectile , it’s vital to get the motions of the projectile to feel right to see if the current direction feels satisfying enough. So the first step is to create a quick, simple base for the particle.
Using a simple linear gradient for a trail and diamond gradient texture for the main particle and GPU sparkles, I threw together this quick, simple particle. I attached the particle to an actor and just gave it a simple projectile component to make it move.
With this base there’s already 2 of the 3 core elements. There’s the big diamond that acts as the head of the particle and is the most eye catching part of the visual and there’s the line trail with sparkles that really help support the feeling of motion within the system.
Of course this system is expected to collide with objects and terrain also expect to use this as an attack, so we need a burst for when it collides with other objects. So with a few simple changes I put a collider on the particle that spawns a burst particle upon collision while destroying the original missile particle. The collision particle was a simple starburst like render supported with sparkles and smoke to support the falling action and closure of the system.
Something I noticed though is that with the current setup I actually end up destroying the trail along with the particle before it even finishes. This is obviously no good, so to remedy this the solution I came up with was to merely have the particle be attached to a different actor and destroy that instead upon collision.
Once it collides the projectile actor is destroyed, but the particle attached to it is not, thus allowing the trail to finish. I would then have the particle delete itself a few seconds after collision to save up on memory.
So at this point we have a simple magic missile particle that certainly fits the bill of a fantasy projectile, but nothing about it really feels… well magical about it. It’s a straight shot to a destination until impact and that feels very normal for something meant to be conceptually whimsical. So at this point I figured “Wouldn’t it be awesome if it just homed in on its target?” And so I got right to setting up some BPs to do just that!
Homing in on something cool
So getting the particle to home in on the target was a lot easier than I first anticipated as the projectile component already has a homing feature and all I had to do is assign it a target. Here’s the thing though, in the context of a game you can’t normally assign a specific target to be dragged and dropped on the spot without code. So if we want to properly implement this we would need to assign it a target at run-time. Thankfully that’s easy to do as we simply have the missile look for an actor with a tag then have that be assigned as a target on play.
With a simple rotating sphere the particle quickly follows its target until impact.
Now this is where we can start having fun with it, alongside doing this I was working on a Uniform Circle Spawner to use for my particles. With this I can spawn several missiles in a uniform circle either all at once or with a slight delay for each spawn.
Combining this spawning motion with a delay for the homing portion to kick in gives a sense of anticipation followed by a barrage and flurry of missiles!
Leveling Up Magic Missiles!
Awesome I have the base particles, I have the homing functionality, and it can be something applied directly to a game as is. At this point since it was time to juice it up! The main thing to focus on was making the head of the particle more interesting.
Currently for the head all that’s there is a simple diamond gradient render, nothing too fancy and while it gets the job done, it lacks a sort of depth to it. This is where meshes can really come into play. With meshes we can pan a texture across the surface of the mesh so we can create 3D particles as a result.
Smoothing out a cube I created a sphere to get smoother and cleaner UVs to work with as opposed to the default sphere Maya creates.
Taking the UVs of the custom sphere and drawing over them in a PS texture, I can have a texture on the sphere surface. Throwing this into a translucent material that blends the colors and alpha while also rotating the UVs gets this really nice head for the projectile that gives it more energy compared to before.
I learned a lot about creating projectiles from this project, but some key concepts really stood out to me when piecing it all together, both on a technical level and artistic level.
- There should be a noticeable difference in visuals when the particle is in motion versus when it’s not.
- Increasing the lifetime of the trail effectively increases the length of it.
- Putting the extra time to incorporate the homing aspect surprisingly gave it that whimsical feel it needed to keep it from feeling generic and provides a lot of eye candy as it whirls around its target.
- When destroying actors with particle systems, make sure that either the trail or the particle itself are on a separate actor so any emitters can finish their cycle before being destroyed.
- Since the homing projectile moves forward in the local X direction, make sure to keep anything that’s going to be in front of the particle offset in the X direction.