Release: Zodiakos Particle System
Displaying 1-20 of 44 total.
12 3 next
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
blues_zodiakos

I've just uploaded it to the V3 demos section. It's really cool. :D

...

More to come - sprite support for the particles. It'll be spiffy!

Posted on 2004-05-08 09:26:18

mcgrue

For future reference, it's always best to link. ;)

Also, it rocks.

Posted on 2004-05-08 09:44:33 (last edited on 2004-05-08 09:44:57)

el_desconocido

Spiffy. Triggered the snow a few times and had quite the blizzard going, good job on letting it stack.

El

Posted on 2004-05-08 16:29:12

Buckermann

Nice.
For your information:
at about 300 particles my lowly Athlon 1500/ Win98SE computer showed the first, serious signs of performance degration.

Posted on 2004-05-10 00:55:24

mcgrue

Quote:Originally posted by Buckermann

Nice.
For your information:
at about 300 particles my lowly Athlon 1500/ Win98SE computer showed the first, serious signs of performance degration.


Mine was aching at 150 particles... but then again I run a lot of background crap.

Posted on 2004-05-10 01:04:04

blues_zodiakos

My next release (which will happen when I figure out why it is being naughty) is coming soon. It'll probably be optimized quite a bit, because instead of drawing the particles every frame (which it doesn't need to because the particles are only processed about every 3 frames, and this is easily changed), it'll draw the particles to a layer and simply show the layer instead. I'm assuming it'll be a fairly big improvement. It also has a fps counter too, so I can actually see the improvements. With the original system (the one in the original demo) I got about 75 fps constant in the mystic_vortex demo, which goes up to about 150-170 particles. Although I have a 2.4 Athlon XP, the processor only runs at about 2000mhz. I think your 1500 should run much better than it is, but maybe I'm wrong. One thing to note is that in the original demo, both of the weather effects are using transluceny (bet you didn't notice!), which might be more of a performance hit depending on your video card. My Radeon 9600 doesn't even think they are worthy of dropping a frame. :D

Also, sprite particles are in. :D Only they aren't working. For some reason, I keep getting an error talking about an uninitialized image handle or something. Oh well, I'll figure it out.

Another big improvement for the next release that's already done - the entire thing is COMPLETELY documented, and there is now a MUCH MUCH MUCH easier way of making your own emitters( no more having to type in 30 arguments in a single line! Yay!), and there are many more DOCUMENTED examples as well.

-edit

Since I have an fps counter, I might add a user configurable switch to limit the maximum particles until the fps is over a certain amount. That would keep both the HAL 9000 and the Commodore 64 crowds happy.

Posted on 2004-05-10 01:13:51 (last edited on 2004-05-10 01:17:05)

sabernet

sweetness and light:)

on my barton 3000+, I was able to get well over 500 particles before I started noticing managable lagging. Frames started to skip(very slightly) at around 250.

Posted on 2004-05-10 04:06:43

blues_zodiakos

Second Release

Everything and more. Completely documented. Sprites are in. What more could you possibly want?

Also in this release, an unexpected bonus. My auto-limiting code apparently doubles as a frame throttler (not a frame skipper, sorry guys). So anybody that's looking for that can kill two birds with one stone.

Old PCs rejoice!

Posted on 2004-05-10 19:51:30

blues_zodiakos

Third Release

Much changed. Vector calculations are actually correct. Streaks are in. Performance improved.

Posted on 2004-05-15 22:54:30

mcgrue

Neat. You should spawn the particles that fall and/or accelerate downwards at a negative value on the y-axis, btw

Posted on 2004-05-15 23:08:30

blues_zodiakos

Pardon? My brain does flip-flops parsing that sentence. Do you mean that I should treat down as up?

Posted on 2004-05-16 10:32:27

mcgrue

No.

When you create a new particle, Do this:

newparticle.y = 0-ImageHeight( newparticle.image_ref );

That's pseudocode, of course.

That way, when particles are born, they're off the screen and move onto the screen.

You dig now, brotha?

Posted on 2004-05-16 12:41:59

Buckermann

Great.
Runs really better than the first release (sorry, didn't had the time to check release two).

But I have a few questions.
Is Max Particles dependent from the computer speed? Mine is 269.

After maybe 5 minutes on the first screen (Wheather-Rain-Streak) Max Particles turned to a large negative number, around -210000, and no particles were displayed. Again, after a while, Max Particles turned back to 269 and the rain was displayed again. As far as I can tell this behavior also happens with the other particle setups. Intentional?

Wheather-Rain-Streak had around FPS ~30 with ~60-70 particles.
Mystic-Vortex-Old had around FPS ~35 with ~260-270 particles.
A rather large difference. I'm curious, may I ask why?

Posted on 2004-05-16 14:33:00

blues_zodiakos

The first three demos are using the new streak particle type, which is, on average, drawing about 10 times the amount the other particle types are(it depends on the speed of the particle). :D There is a minimum number of 300 particles (as defined in ZPS.vc as MINNUMPARTICLES), so these two tests will most likely take you below 60 fps - but only the translucent streak test does on mine.

I'm not sure about the negative number problem. NUMPARTICLES should be reset to at least 300 each time the timer is called because of this line in the HookTimer:

if(NUMPARTICLES|lessthan|MINNUMPARTICLES) NUMPARTICLES=MINNUMPARTICLES;

It didn't have this problem on mine, but it did in release 2. Maybe it's a speed issue.

McGrue: I actually wanted to see the particles generated, but it's easy to do that with the finished Emitter. It doesn't require a change to the engine at all, just your custom emitter. Just change the x and y coordinates of the actual emitter:D

The next thing I'd really like to figure out is how they did the particle blurring effect in Golden Sun. My streak particles are really just a pale imitation of the particles in Golden Sun, which look like they have some sort of motion blur going on. Most motion blur techniques require the rendering of several frames and placing them on top of each other with translucency, which I'm fairly sure the GBA isn't doing every frame (poor thing! V3 screams when I even think about it). Figuring out how GS does this is the next big improvement. Golden Sun's particle system is actually the bar to which I'm striving for with this system.

-edit

It ate my code. I can't figure out this 'pre' crap. I hate html.

Oh, I didn't see that you said the problems started when you left it at the first test for a long time. I'll try that. It would be bad if that happened during the game!

Posted on 2004-05-16 15:56:14 (last edited on 2004-05-16 16:05:45)

Mythril

For motion blur:
If your particles are moving at a constant speed, you could calculate the particle coordinates for a few ticks in the past, and put some (grayed out?) graphics on those coordinates too. But for particles moving with changing speeds, storing the last few values is probably quicker and easier.
I don't remember the Golden Sun effects all that well, so I don't know if this is what you're looking for.

Posted on 2004-05-16 16:35:33

blues_zodiakos

Heheh, that's exactly how my streak particles work, actually. A number of 'shadowed' particles (same shape, 50% color), and then the main particle. It's not convincing. :( I'm beginning to think that golden sun had an extra layer running that was similar to those 'fire' demos that they used to have back in the day - red pixels started at the bottom, were given a random height each, then slowly shifted up, and each time they shifted, they faded from red to white to orange to yellow to black. Gave a pretty convincing fire effect. I think Golden Sun was doing a similar thing, without the moving of the layer. That sort of effect is indeed easier, because you only need one layer. Each time it's processed, you just change the color of every pixel on the layer that has a color. In fact, for more 'glowy' effects, you could probably scale that layer by 4. Hmm, it could be worth trying.

Posted on 2004-05-16 18:26:51

Omni

I'm not sure if you've thought of this, but...

If you render all particles to a layer...

Then quit recalculating and reblitting each particle.

Each time you draw to the layer, save a copy. Then draw those saved layers (perhaps the last five or six) at a set translucency on top of each other. THAT'S good motion blur. That whole "re-render everything" isn't going to cut it.

Save the last five layers. At each new draw, set destination to the draw layer, then draw the previous five buffers at translucency, then the new batch of particles.

For additional blur, keep track of up to ten past buffers, maybe? It will still start slowing down after awhile, but blitting an entire screen in one pic is much faster than reblitting each individual item on that screen.

Remember, there's a difference between Blur and Shadow. A shadow effect requires that copies of the images be blitted (like Alucard's trail in Symphony of the Night), and that's what you're doing right now. Blur is where the eye can't immediately update what it's seeing, and so you see the current picture along with a blurred previous image (like motion blur in Majora's Mask).

Shadow == trails of elements
Blur == previous data + new data of all elements

The difference is pretty obvious (Alucard's trails vs. motion blur). I'm not quite sure if my method is a flawless way of doing it, but hey, it won't hurt to give it a try.

Posted on 2004-05-16 18:59:04 (last edited on 2004-05-16 19:03:41)

Mythril

I was going to write something about that too, but I forgot. *cough* :P

The problem with doing it that way, is that it relies a lot more on computer speed. If the computer is slower, the particles will have moved further between each screen refresh, and if the computer is very quick, maybe the screen refreshes so quickly that the trail is minimal.

Depends a bit on how you implement the approach, of course. I guess it could be possible to implement it in a way that makes the motion blur about equal on computers with different speeds. Maybe rotating the layers only every 5 ticks, or something like that. (Are verge ticks still 1/100 of a second?)

A challenge for Zodiakos! :D

Posted on 2004-05-16 20:15:24

blues_zodiakos

Well, the speeds of the particles are pretty much independent of the speed of the computer. A particle that moves 10 pixels on a faster machine is still going to move 10 pixels on a slower machine, the only difference will be the time it takes. They will both move the same amount. If I save a copy of the last 4 frames (standard for motion blur, I did some research a few days ago), then the amount of blur will be the same on all computers, just the amount of time it will take to show it will be different. Which brings me to my point: the slow performance of translucency.

I don't know why it's so slow in verge, but I'm guessing it's because it's being done in software. If I were to save a copy of the last 4 frames, place them one on top of each other translucently, the speed hit would probably be unbearable on everything but the fastest machines. One of the first things I did to try to improve performance of the particles was to render all the particles to a transparent layer, and then blit the layer, ensuring that the particles would only be redrawn after they were recalulated, which is, by default, 100/30 FPS (or 3 times a second). That's pretty cheap, really, and could improve performance quite a bit. Unfortunately, something went horribly wrong, and I lost a lot of work.

If all you were going to use were pixel particles, you would actually lose speed doing it the layer way, because drawing the pixel particles every single frame is much faster than blitting a 640x480 (or what have you) bitmap every frame. Now, when doing circle and the other particles (which require significant math), it should in theory be faster to just blit the image. But it wasn't. I don't know what I did, maybe I did it horribly wrong, I'll try it again. In theory, if it worked, you'd be able to display about 3 times as many particles at once (but not really). And, I'd be able to do nifty effects on the particle layer as well. Perhaps motion blurred, shadowed, streaking particles (all at once) at an acceptable FPS may be yet a reality. Here's to hoping.

-- edit

The odd thing is, in Golden Sun, I can't really tell WHAT the particles are doing to achieve that glowy, blurry effect. Common sense tells me that, based on the GBA's speed, it can't really be doing anything that complex. But it isn't simply a shadowing effect, and I can't really tell if it's a blurring effect. More studying will be required. Yeesh, I love reverse engineering. Without access to the engine.

Posted on 2004-05-16 22:49:12 (last edited on 2004-05-16 22:52:50)

Mythril

Quote:Originally posted by Blues Zodiakos

Well, the speeds of the particles are pretty much independent of the speed of the computer. A particle that moves 10 pixels on a faster machine is still going to move 10 pixels on a slower machine, the only difference will be the time it takes.


Ahah, so the particles aren't programmed to move the same distance in the same time on differently speeded computers?
Anyway, I'm going to try tweaking your script now. :D It's been too long since I've actually done any coding... (besides website coding, and I'm growing quite tired of that)

Posted on 2004-05-16 23:14:14


Displaying 1-20 of 44 total.
12 3 next
 
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.