ID:1915996
 
So, as it's probably been pretty obvious, I've been tinkering around with a particle engine I designed. I'm actually quite surprised how robust I've built it, actually. I've managed to perform drastically different effects by simply tinkering with the emitter parameters themselves. I haven't had to touch the particle code in a good bit, and that was just to fix a couple errors. This lets me know that I'm definitely on the right track.

Unfortunately, particles in BYOND games right now looks a bit on the deep end. I can easily see a well designed engine working wonders with single-player games, which is where I'm planning to adapt my engine. It's just too CPU heavy to manage elsewhere for now.

This post is just going to serve as sort of a log of the cool effects I can come up with by playing around with the engine. Sorry for any flickering or frame glitches, Licecap can only do so much.

Here's the latest effect I managed. It's obviously fire, but I did it layering three different emitters. One for the flames, one for the sparks coming off and one for the smoke.



If it gets a lot of support, I may think about packaging it into an external library for you guys to check out. I'd have to design an actual API to make it viable, but it's really not too tough. :)
Beautiful!!
Just fixed a small pet peeve I had with the smoke in the fire. It billowed too harshly when it spawns, not mixing well with the fire. I tried spawning it slightly above the flames, but that only made it uglier. I actually had to rewrite my fading function to include fading in, which is an awesome feature and makes the new version of the fire really pop!



Also updated my explosion effect to rearrange the layers a bit better. Keeping the smoke behind the burst allows it to flash a lot better.

Looking good :)
What would be really sweet is if you could work out some way to capture these particle effects and render them to a series of icons with specific layers.
In response to Ter13
That sounds like it would be a huge headache... Lol.
That sounds like it would be a huge headache... Lol.

Yep.
I'm just tackling a bit of a memory leak I have in the library right now and I'll probably post it. It's so simple to use but so powerful at the same time. I'll have to write up a damn good tutorial for it, though.

The fire takes up about 30% CPU when used. I'm not sure how to get it any less other than simply spawning less particles. It's kind of a downer, to be honest.
Still working on tracking down the bug, but in the mean time, I made a kind of cool "level up" or "power up" animation.



Using the exact same effect, changed the sprite's color slightly and altered a few parameters, I mixed this version with my previous fire to create something which seems 10x sexier than before. Wow!

How are you handling the particles exactly? Just creating and deleting them or are they being recycled?
In response to Bravo1
They're being recycled, but it hasn't had much of an impact in performance, to be completely honest. Do you think my problem might be somewhere in there?
It's a possibility, usually recycling particles won't make much of a difference until you have 500+ at any given time, but I've been wrong before.

Try subverting the recycle code for simple new and del stuff and see how it acts, if it's slower or has no difference then the recycling should be working fine. Otherwise there might be something in there.

How many particles would you say are being used for the fire? Do you track how many particles are active and how many are in the pool?
In response to Bravo1
Yes. My debugging says that there's on average about 180 particles in the fire at one time. It's pretty bodacious.

EDIT: Sorry, I was thinking of another effect. The correct number is 180, not 420.
Uh oh, I think I just figured out why it's kinda sluggish... oops. I've been manually tweening animations when I should be using animate... EIN MOMENT BITTE! Hopefully fixing that should solve at least one of my issues... ^_^!
The flame reminds me of this thing I made when v500 was just coming out:


Kats:
Uh oh, I think I just figured out why it's kinda sluggish... oops. I've been manually tweening animations when I should be using animate... EIN MOMENT BITTE! Hopefully fixing that should solve at least one of my issues... ^_^!

I was actually going to inquire about this about your system. It does make a huge difference to allow animate() to tween your particles. I believe it's also possible to use different easings for pixel_x and pixel_y such that the "gravity" effect of downward acceleration can be applied using cubic or sine easing.
In response to Kats
Ah, that makes sense.

If it were 420 particles you'd be burning more than just your cpu.
In response to Bravo1
Bravo1 wrote:
Ah, that makes sense.

If it were 420 particles you'd be burning more than just your cpu.

Haha.

I wonder if you make the fire smaller would it require less resources? It would be interesting to see how it looks in Pondera.
This is pretty cool, good job.
So I've narrowed the memory leak down to the emitter, but I still have no idea where it could be coming from. I've double checked all of my references...
In response to Kats
Kats wrote:
So I've narrowed the memory leak down to the emitter, but I still have no idea where it could be coming from. I've double checked all of my references...

Post a snippet in dev help?
Page: 1 2 3