Meagan's Particles' speed
#1
Hi, I started to mess around with the "Maegan's Particles" and I'd like to ask if anyone can help me with something.

So, I didn't ran into any errors per say. The only problem that I'm facing right now is that I wanna slow down and I don't know how to do it. I mean, there's too many particles appearing too much fast for me, I can't make it generate less "particles per second" or make them move slower.

Anyone that can help me with that?
}
#2
Slow down the way the animation is played? Well, I never thought anyone would want that. I guess a revision may call upon that.... but that's gonna be tough. In the meantime, I have a line of code to add to both 'Spriteset_Map' and 'Spriteset_Battle'. Need to add it to both, right?

Within the update method of both scripts mentioned above, you have a comment that reads [color=green#Perform the original call[/color]. That's kinda how I like to word the aliased 'original' method. Place the line of code shown below above this comment:

Code:
Graphics.update if @particles != []

This will make the system slow down 1 frame every time it updates... but only if particles are shown. The caveat is that all other actions are slowed down that same 1 frame at the same time.

The thing is, it does not rely on using Graphics.update to set a timer, thus the fluid speed of the animation. Unfortunately, that also prevents much in lieu of slowing down the animation except in how you add it in the event code. Like how you see a @wait_count script call to make a delay in an event's animation reaction.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
}
#3
First, thanks for answering :D

Second, after messing around a little more with the script I kinda of managed to to what I wanted, and to be honest I think what I wanted is not what the script is supposed to be used for xD

You see, I kinda wanted to use the script to add more "beauty to the map" by putting some particles around, creating some fog in some parts and stuff like that(an screenshot from my project with the extremely beautiful particles). I admit that I created this topic before trying the particles chain and with that I could make it look like I wanted to, but I still think it would be usefull to be able to slow them down(for the sparkles, for example, would be nice to have them floating around more slowly) or at least being able to spawn "less particles per second" to make it not be a gatling gun of particles xD


But again, I think that what I'm trying to do is not what the script was intended to be used for, since having too much particles chains at once can cause lag, although I can create some chains in the events instead of using the script manager or even use only one chain for the entire map, but I think then is just me trying to get the best I can with something that isn't supposed to do what I want it to do xD
}
#4
Hm. I re-read your initial request, and thought about how the particles spat out from the clown running around the track in my demo. You know, the one where you pressed one of the buttons and left a flurry of red particles in his wake. If you're bogged down by too many particles appearing at a given time, it's based on your event code and how you use the script calls within.

The number of particles appearing from the event is solely based upon how many frames you wait and how many calls are made. And the particle spread behind the clown (defined in event ID 10) is generated thus:
Code:
@script: particle_fx(9,'sparks','screen')
@script: particle_fx(9,'sparks','screen')
@script: particle_fx(9,'sparks','screen')
@script: particle_fx(9,'sparks','screen')

In doing so, I make four trailing particles every frame that the user presses the 'X' button (aka the 'A' keyboard key). To slow down generation, one can add @wait_count = 3 to slow this down to run only after 3 frames of animation speed, and remove one or more particle effect calls to reduce the number generated at any given time.
Code:
@script: @wait_count = 3
@script: particle_fx(9,'sparks','screen')
@script: particle_fx(9,'sparks','screen')

How fast they move from their point of origin, aka its velocity, is solely within the P_Defined array... particularly the 'horizontal' and 'vertical' arrays within. Each one of those arrays holds 3 values which manipulates its speed and gives a little random variance value. Hey, you don't want all the particles to move EXACTLY the same, right?

The first two values in the Horiz & Vert arrays handle direction in pixels. In the case of the sparks in my demo, this is set to -5, 10. This means it can go 5 px in one direction with a randomization of 1-10 pixels in another direction (ie... -4px to 5px) whether this is the horizontal or vertical array. Granted, that is TOO fast with the system's 40FPS frame rate, so the array has a 3rd value to slow the particle speed down... the multiplier. Again, using the sparks particle in my demo, I have this set to 0.5, but you could set that to 0.3 to make them travel slower from their point of generation or even 0.1. You could even make the particles remain stationary and not move at all. But to do so, do not enter a value of 0. The value must be 0.0 for a stationary particle as the value itself MUST be a floating point value.

* The Velocity value and formula I mentioned is covered in the demo's PDF file

The speed in which the particles fade away is based on the 'Opacity' array within P_Defined, and also has a little 'variance' option within. And after that, you have a 'Spin' array which indicates how fast the particles spin and in which direction. Granted, a spin of 0 means it isn't spinning at all.

Sorry for the late summary, but I've been busy working. With that, you shouldn't have need for my previous code insert from a couple days ago. Tongue sticking out
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
}
#5
Thank you very much!

I've read the pdf, but the explanation that you gave here helped me understand much more than the pdf one. I think that with this I can do what I had in mind(even more, I asked for a friend to test the game in a better computer and turns out that the lag issue that I pointed out earlier was just my computer being, you know, old).

Sorry for creating a(almost) useless topic and, again, thank you very much for the help!


(now, one last thing: a had a custom save/load screen script made a while ago, but it has one bug that makes it impossible to use, would it be a problem if I created another tread for this?)
}
#6
Winking Sounds like code support to the rescue to me. Post the script, the coder's name (hopefully IN the script), screenies showing problem if there's anything visual, what you say is the issue, and etc.

So, you marking this Closed and Solved?
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
}
#7
Yes. And one more time, thank you!
}


Possibly Related Threads…
Thread Author Replies Views Last Post
   Possible means to speed up Bitmap TONE code? DerVVulfman 7 3,015 06-11-2023, 08:22 PM
Last Post: kyonides
   Permanently modifying move speed Keeroh 5 9,568 05-24-2017, 05:47 AM
Last Post: DerVVulfman
   Pixelmovement and speed ark 2 5,617 05-31-2010, 05:51 PM
Last Post: ark



Users browsing this thread: 1 Guest(s)