Help improving Ribbon Particle Emitter

We have a rather unique gameplay mechanic in our mobile-based game where the player draws a path from the ground upwards and a rocket follows the path, destroying anything it touches.

To achieve this we’re using a single ribbon particle emitter spawned in an actor (which doesn’t move) that we teleport – via SetWorldLocation() – to a new location in 3D space whenever the player moves their finger a certain distance along the screen. Generally, this works extremely well. However, there are two problems that I’m looking for help in addressing (if possible).

Below is a screenshot of a particularly bad case scenario:

The light-blue line is the in-game ribbon effect.

The solid red line is (vaguely) the path that the player drew (I’ve offset it slightly to make it clear).

The dotted-red circles show two locations where the trail jumps off of the requested path (ISSUE #1).

The dotted-dark-blue circles show where the trail is twisted around facing the wrong direction (ISSUE #2).

So, what I’d like to see is something similar to the red line. A thick solid, consistent line that is 99% accurate to what the player is drawing. Instead there’s two issues:

  1. Even though I’m only moving the emitter when the player moves their finger a significant enough distance, the emitter seemingly jumps and creates huge additional loops on the corners. These can be HUGE at times and go from one side of the screen to the other.

  2. After corners, the emitter will frequently twist over in 3D space, causing there to be holes in the trail.

Note: Both of these issues are at their worst when the framerate is low / spiking.

Below is a capture of how I’ve setup the ribbon data:

And the spawn parameters:

78661-spawnperunit.png

I’m absolutely NOT moving the emitter along the Y axis (the camera is fixed and points down Y). I’m also absolutely sure that the emitter does not end up getting teleported to places it shouldn’t go. I’ve also tried all kinds of combinations of the emitter’s settings, with very little luck.

I have managed to slightly improve the situation in the past by greatly increasing the detail of the emitter (more tessellation, basically), but it never completely solves the problem and greatly degrades the game’s performance as a result.

So, any ideas? I’d love to get these two glitches out of the game as they greatly ruin the aesthetic.

Cheers.

Hi Triblade -

Try Telling your Ribbon Module to Recalculate Tangent on Every Frame. That should correct most of the issue and setting your material to two-sided should correct the other problem you are having as well. Assuming this works for you, you should be able to reduce the amount of tessellation on your ribbon to a more performance friendly number.

Eric Ketchum

Cool, thanks for the quick response.

The two-sided material suggestion helped loads. It almost completely removed those large gaps we were seeing.

I’d previously tried the ‘recalculate target on every frame’ option before, but it had destroyed the framerate on lower end devices. I hadn’t considered reducing the tessellation count while this was active though (and these days we have a version of this ribbon effect for low end devices anyway), so was able to use your advice to find a very happy medium between the settings :slight_smile:

Thanks again :slight_smile: