I’ve been poking an idea of a flamethrower for the use in games. I’ve created this flamethrower VFX with Niagara CPU simulation:Unreal Engine 4 Niagara particles flamethrower - YouTube
Now I’m struggling with overlaps and collisions tests that would allow to apply damage to other actors. My first thought was to use the particle data and by using particles position and size perform sphere trace or maintain array of collision spheres and move them along with particles. At first it seemed to be a good idea but as described many times on different occasions particles are meant for esthetic purposes only and should not be used for any kind of mechanics since particle data might get delayed based on many factors.
This raises a question: if Niagara runs it’s own simulation that includes velocities, gravity, masses, etc. but can’t be trusted to use that data for gameplay mechanics, how one should deal with - for example - flamethrower damage, that requires at least overlap feedback.
My thoughts and ideas so far:
1.
Particles movement and behavior should be based on collision shape/s model that drives VFX, not the other way around. This is already an issue for me since my flamethrower in Niagara behaves based on Niagara settings. Not being able to use Niagara data as it’s not reliable I found my self trying to reproduce Niagara simulation / movement by separate mechanics.
2.
I’ve thought about making procedural mesh and change it’s shape based on mouse movements. This requires to programmatically to manipulate meshe’s points, which again is doing things the other way around. Not to mention that UE4 procedural meshes are known to have issues with overlap events. On top of that they are computationally expensive.
3.
Doing any other simulation - e.g. I’ve made collision spheres cannon that where doing pretty good job at covering flame area with collisions spheres that where behaving similarly to Niagara particles - will mean creation of a second simulation next to already existing Niagara simulation.
What are your thoughts on this? Have you poked collisions with dynamic flames in your projects? How did you mange to solve it?
This is also question to Epic guys, since I can’t stop asking my self question if there is a way for Niagara CPU simulation to run in a way that would allow us to use it’s data for this purpose. Ideally there would be only one simulation that either can share it’s data reliably or has other means of performing overlap tests on all spawned particles.
I’m opened to discussion