[Request] Reverse particle emitter

Discussion and feedback on Construct 2

Post » Tue Aug 19, 2014 3:27 pm

This seems like it could be very useful - I'd modify it myself but since this is frowned upon, I'm making a feature request instead:

The particle object emits particles in a cone, with many settings such as growth over time, fade-out and so on. These are all deterministic, so why not allow it to emit particles in reverse?

That is, it would create particles in front of it and "suck" them in. There are many cool effects that could be achieved with it, as well as some interesting optimizations. I don't see any technical problems with it either.

Now, as I said in the beginning, I'm fully capable of implementing this. Question is, should I do it or wait for @Ashley?
B
36
S
8
G
8
Posts: 532
Reputation: 6,903

Post » Tue Aug 19, 2014 3:58 pm

Since the particle path is random and non-deterministic (in the sense that you don't know what random alterations will be made until you call random() at the time you want to make them), the only way I can think to do this is to simulate a complete forwards path, then start at the end and play it backwards. That's not exactly a trivial change. I think perhaps it could be made in to a separate plugin.
Scirra Founder
B
403
S
238
G
89
Posts: 24,653
Reputation: 196,143

Post » Tue Aug 19, 2014 4:01 pm

Ashley wrote:Since the particle path is random and non-deterministic, the only way I can think to do this is to simulate a complete forwards path, then start at the end and play it backwards. That's not exactly a trivial change. I think perhaps it could be made in to a separate plugin.

Yup, that's exactly what I wanted to do, though I don't intend to simulate the complete path.
Also I know it's not a trivial change, it's not like you can just set particle speed to negative ;)
Can I go ahead and modify the plugin to make my own "reverse edition" then?
B
36
S
8
G
8
Posts: 532
Reputation: 6,903

Post » Tue Aug 19, 2014 4:18 pm

Call it Lubmif's Redolmi
I did that with bullets set to rotate to a certain point, then added a timer to destroy them.
Image ImageImage
B
172
S
50
G
183
Posts: 8,442
Reputation: 115,603

Post » Tue Aug 19, 2014 4:23 pm

Yes, so long as you change the plugin ID so it's published as a separate plugin. How do you intend to achieve that if you don't simulate the complete path? You need to know its entire path before you can play it back in reverse, right?
Scirra Founder
B
403
S
238
G
89
Posts: 24,653
Reputation: 196,143

Post » Tue Aug 19, 2014 4:41 pm

Well I guess what I'm calling "not the complete path" and what you're calling "complete path" are the same thing.

I'm going to generate the particle normally (to get starting conditions), then project the path forward (to get end coordinates) based on:
  • Starting x/y
  • Angle
  • Speed
  • Lifetime

Then I'll either lerp it from end to start or shoot it backwards. I'll also lerp size, rotation and opacity based on what the user specified (taking into account that those values might hit their ceilings/floors before the trajectory ends).
B
36
S
8
G
8
Posts: 532
Reputation: 6,903


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 21 guests