sprite image trails

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
Unin
Regular
Posts: 54
Joined: Wed Sep 01, 2010 8:08 pm
Location: Florida
Contact:

sprite image trails

#1 Post by Unin » Sun Feb 16, 2014 10:56 pm

Does anyone know of a good way of getting sprites to leave a temporary "image trail"?

I'm trying to emulate tracer fire for a shooting gallery mini-game that arcs from one or more positions off-screen towards the mouse before disappearing (kind of a reverse of the "repulsor" sprite demo), following a spline (to make the sprites arc rather than straight line), and in doing so I realized that my long sprites couldn't rotate (much less curve) with the arc. I thought a simple solution to this would be to create some sort of image trail; multiple identical circular segments partially overlapping and following the lead segment. That way they could follow the sort of parabolic arcs I wanted and look like a tracer round. I understand I could do this with composite probably, but I want to be able to have multiple (at least dozens) of individual "bullets" on screen each followed by its own "trail".

Is this possible within the limits of sprites? Is there a better way of doing it? Is this use of sprites likely to slow Ren'Py to a crawl?

User avatar
Steamgirl
Veteran
Posts: 321
Joined: Sat Jul 28, 2012 4:39 am
Completed: My Cup of Coffee, Queen at Arms (co-wrote a battle scene)
Projects: Stranded Hearts, Emma: A Lady's Maid
Deviantart: steamgirlgame
Contact:

Re: sprite image trails

#2 Post by Steamgirl » Mon Feb 17, 2014 7:04 am

I would guess you probably want to use particles for this? I'm no good at particles though... they always take a while to figure out for custom effects.

http://www.renpy.org/wiki/renpy/doc/ref ... /Particles

Particle burst example:
http://www.renpy.org/wiki/renpy/doc/coo ... icle_Burst

Unin
Regular
Posts: 54
Joined: Wed Sep 01, 2010 8:08 pm
Location: Florida
Contact:

Re: sprite image trails

#3 Post by Unin » Mon Feb 17, 2014 10:56 am

I was under the impression particles and sprites where the same thing. what is the distinction?

User avatar
Steamgirl
Veteran
Posts: 321
Joined: Sat Jul 28, 2012 4:39 am
Completed: My Cup of Coffee, Queen at Arms (co-wrote a battle scene)
Projects: Stranded Hearts, Emma: A Lady's Maid
Deviantart: steamgirlgame
Contact:

Re: sprite image trails

#4 Post by Steamgirl » Mon Feb 17, 2014 1:14 pm

Well a particle system is set up for creating effects with (often) a single sprite. Depending on how it's done in the engine, it'll be optimised for multiple instances of the same sprite, resulting in better performance. I'm generalising here though - don't know what ren'py does under the hood and I'm sure there are some cases where an animation is better than a particle system, etc.

With a particle system things like leaving a trail are sort of built in - you could set up an emitter that follows a particular path and emits a single particle every X steps/seconds, give the particle a lifespan of X seconds and a fade out effect. Voila, it's a trail.

It may or may not be appropriate in this case? It's kinda hard to visualise what you're trying to achieve based purely on a description. XD

Unin
Regular
Posts: 54
Joined: Wed Sep 01, 2010 8:08 pm
Location: Florida
Contact:

Re: sprite image trails

#5 Post by Unin » Mon Feb 17, 2014 8:18 pm

I understand that particle systems are an efficient way of showing many of a single displayable on the screen at once... but a lot of the documentation for "particle systems" and "sprite systems" seem to be copy and pasted from the same article. For example, depending on which one you read, "SnowBlossom" is either a particle system or a sprite system. It also doesn't help that most posts dealing with "sprites" are using the general "art asset" sense of the term rather than the actual sprite class. very confusing. I think particle factory might be easier to implement than dealing with sprite manager, but it seems like the two classes have a lot of overlap, and I'm not sure if one is legacy code and the other a future replacement. Thank you for your help and perspective.

Post Reply

Who is online

Users browsing this forum: Bing [Bot]