What to use to make the fastest trail?

For questions about using Classic.

Post » Mon Dec 21, 2009 5:30 pm

I know there were many topics about trails, but this one is quite different. I know how to make trails, but I don't have a clue about their effectiveness. In my application there are dozens of very small (~1x1px) objects with slow-fading trails up to 250 px long and I don't want the app. to lag, even in 1920x1440 resolution. Should I use sprites, plasma, particles or something else?

So far my bet is on particles, but I'm still beginner in Construct.
B
2
G
4
Posts: 12
Reputation: 1,074

Post » Mon Dec 21, 2009 6:16 pm

If the number of objects approaches the number of pixels in the screen, you would be better off with plasma.

Particles: probably not a good idea for trails, specially for objects so small

Sprites: good if there's much less objects than pixels in the screen, you'd have to do some math to get the trail looking right. Do the objects turn? if so, you'll have to segment your sprites and each segment needs more math. When comparing pixels vs objects, double the number of objects for each segment on your trail, if it's still less than pixels go with sprites.

Bonus: Lines!
If your objects are 1x1 px, consider using the Line object instead of sprites for the trail. Less vertex data, less computations, faster and simpler to understand. The segment thing goes for lines too, though.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Mon Dec 21, 2009 7:10 pm

[quote="Madster":e1jjzn4z]If the number of objects approaches the number of pixels in the screen, you would be better off with plasma.[/quote:e1jjzn4z]
That's negative.

[quote="Madster":e1jjzn4z]Particles: probably not a good idea for trails, specially for objects so small[/quote:e1jjzn4z]
Any particular reason?

[quote="Madster":e1jjzn4z]Sprites: good if there's much less objects than pixels in the screen, you'd have to do some math to get the trail looking right. Do the objects turn? if so, you'll have to segment your sprites and each segment needs more math. When comparing pixels vs objects, double the number of objects for each segment on your trail, if it's still less than pixels go with sprites.[/quote:e1jjzn4z]
There are literally dozens of these objects, i.e. max ~2-3 dozens - not thousands. Objects do turn.

[quote="Madster":e1jjzn4z]Bonus: Lines!
If your objects are 1x1 px, consider using the Line object instead of sprites for the trail. Less vertex data, less computations, faster and simpler to understand. The segment thing goes for lines too, though.[/quote:e1jjzn4z]
AFAIK, it's even slower than canvas.
B
2
G
4
Posts: 12
Reputation: 1,074

Post » Mon Dec 21, 2009 8:38 pm

In my experience, plasma can be slow. Canvas can be difficult to work with. Particles are fast, but lack fine control. Sprites would probably be your best bet as far as a balance of speed and control goes.

It would help to see a .cap of your objects moving around though.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Mon Dec 21, 2009 8:52 pm

[quote="deadeye":3qst3ri8]It would help to see a .cap of your objects moving around though.[/quote:3qst3ri8]
Sorry, can't do. Secret project ;) They're moving on parabolic trajectories, like in Scorched Earth. If particles' only weakness is lack of control... well, I can live with what I've already done (I've started with particles).

I'm probably going to stick with them, because I found out I can remove original 1x1px sprite and simply move the particle spray. If I find a problem impossible to solve with particles, I'll swich to Sprites.

I'd still appreciate more advice though.
B
2
G
4
Posts: 12
Reputation: 1,074


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest