I’ve been working on particle emitters to provide some spell effects, damage reactions, and condition indicators for Restless Ground. My first impression: Unity’s particle system component gives a lot of flexibility, but it offers an overwhelming palette of choices.
Unforunately, there isn’t a lot of good information on creating pixel particles. Unity’s docs are okay, but are mostly focused on creating more realistic effects. This devlog is a good place to start with sprite-based effects, but it doesn’t get too deep. Once I’m more confident with how particle systems work with pixels — and figure out how to get them to be pixel perfect — I may cobble together a tutorial for interested devs.
Anyways, here’s how it works: I created these particle emitters and saved them as prefabs. When the game calls them, they are pulled from an appropriate “PoolParent” (a generic class I whipped up to efficiently manage prefabs) and childed to a unit’s transform. These particle system-based animations are rudimentary, but I am pleased with how they look. Unfortunately, I haven’t figured out how to keep these animations pixel perfect yet.
A Damage Particle System
I’ve replaced the sea of floating damage numbers with a system that spawns blood (or other appropriate unit chunks) on hit. After a recent playthrough of Diablo 3, I am designing away from “numbery” games. Also, I think that this is just a funner way of showing damage.
Bigger hits spawn more chunks. At the moment, chunk density (eww) is a function of the amount of damage done AND the percent of the unit’s health the damage represents. I may tinker with this later, since later bosses might be doing huge amounts of damage.
Then again, I might not. A puny skeleton bursting into a shower of bone meal sounds like a fun visual.
Since these particles don’t have any particular shape, I am just using a simple white material to represent them. I can then recolour the particles appropriately in script. When the particle is summoned from its pool, my damage script activates it with the correct colour and spawns an appropriate blast of gooey bits. These have an upward force at a variable angle, and fall according to gravity.
One important thing: I set “Simulation Space” to “World,” or else falling damage particles will follow their parent’s transform around.
A Burning Particle System
At first, I wasn’t sure how to implement fire, since I was avoiding transparencies and gradients. But I’m already breaking a lot of my original rules (pixel perfect, PICO8 palette only) for the sake of coolness and expediency, so here goes!
For fire, I created a particle system negatively affected by gravity. I’m also using two different colour ramps between PICO8 orange, PICO8 magenta and PICO8 gray at different frequencies. This provides a bit of variance as the particles float up and grow into smoke.
It’s not perfect fire, and it could definitely use some tweaking, but I think it’s at least close to working with my simplistic aesthetic.
A Poisonous Particle System
For a poison effect, I took inspiration from Final Fantasy’s green soap bubble effect for Bio spells.
Since Unity’s particle systems can take a multi-row sprite sheet and randomly render out different rows, I created a green bubble sprite with 5 variations. Then I added it with the Texture Sheet Animation’s “Random Row” option. Whenever the particle system generates a particle, it will appear as one of my random variants.
Like the burning effect above, gravity negatively effects these. They appear, animate, and float away until they pop.
A Freezing Particle System
I created a single-row sprite animation for my frozen effect. These particles would appear over the unit like shining ice. This looked very bad until I tried draining all of the red colour from frozen enemies. Brrrrr. So much for sticking to PICO8 colours!
This has been my first real dive into Unity particle systems, and it was a lot of fun. They are very powerful and quick to iterate over, though you definitely lose a lot of per-pixel control. Mostly, I’m happy that I’m able to easily influence particle systems through code and promote some minor randomization.
I think I’ll be creating some more condition indicators soon, and I will likely be using particle systems more to quickly create spell effects without having to create hundreds of sprite animations. Stay tuned!