28.6.2019 - Jussi Kemppainen
Visual effects candy time!
Whack! Some actions in water also produce water interactions.
This week we spent some time polishing the game visuals. I will talk about one of them: water interactions.
I touched on the subject briefly in the last rewind, but here is a more in-depth view at our solution.
I always wanted out water to be interactive. But it would have required substantial shader work. As we were talking about it, our level designer who knows nothing about shaders asked why do not we use the same particle effect we use with our echo-skill: a ring distortion ripple I created way-way back.
Well, why not? it would be a simple particle system instead of a crazy water interaction shader.
Something we added at the same time was that fire can no longer burn underwater. this adds a lot of tactical variety to the game as fire skills are useless in the shallows and on bogs.
So, off we went to create a particle system that would fake interactive water. It would require 3 components: water splashes, particles that detect the water surface, and surface ripple particles.
The final solution is simple, we added a collider to the water that this the player when they are in water. This collider tells the water splash particles to start emitting. Each water splash particle (a white-ish noisy smudge jumping upwards from the character feet) emits a “bullet” from about 1.5m up from it’s center that is fired downwards. This is important to figure out the actual water surface level regardless of how deep the character is threading in the water. When this bullet collides with the water surface, a ripple particle (transparent material with only distortion) is born.
The character emits some particles while staying still, but in motion we spawn dozens of particles. making the character interact with the water. This looks rather nice in the game! No shaders required. A simple particle solution!