Game Development Community

dev|Pro Game Development Curriculum

Particle Ribbon Preview

by Adam Armstrong · 07/30/2013 (1:44 pm) · 30 comments

www.xoltan.org/img/ribbon01.jpg
First a little caveat. This is by no means finished, but I'm posting this to gather some momentum after a few minor life challenges. I've had this working for more than a month just sitting, and getting it out in the wild will provoke me into getting a proper release going.

This is a simple change that connects the quads of a particle emitter's particles end to end. It's handy when you want a long stream of particles without gaps, like a trail behind a projectile. I like it for bullet trails. In a pinch it could also be something like cigarette or muzzle smoke.

The only other thing it does is add an angle limit for deviation from the angle the previous particle was ejected at. I found this mitigated the harsh angles the ribbons can form, and can be handy for normal particles as well. I don't believe its shown in the screenshot, but the gui has been updated for this too.

www.xoltan.org/files/particle_ribbons.zip

That just contains the two changed source files and the updated gui. You'll need to know where things go to use this. You'll also need an image that tiles left to right for your ribbon particle - really, it looks terrible without a tiling particle image. I know that isn't terribly useful out of the box, so goad me into a better release. I do plan on making a proper pull request and including some particles.
Page «Previous 1 2
#1
07/30/2013 (2:13 pm)
Cool, definitely something the engine needs. I implemented ribbons for our game Mechanized Assault Vehicle. We use C++ to build the verts and shaders to create the effect for lasers, smoke trails, etc. I have wanted to submit it to T3D MIT but have not had time. I am glad to see someone else is on it.
#2
07/30/2013 (2:43 pm)
Cool another use for the refactoring of the Particle interface I'm working on right now!
Looking forward to see this getting released! Gj!
#3
07/30/2013 (3:15 pm)
That's really really cool. Great work!
#4
07/30/2013 (4:16 pm)
could this as Tim says be used to create lazer effects?
#5
07/30/2013 (4:27 pm)
The performance of ribbons is much better than the particle system in torque. You can see in this video here we use them for almost all of our weapon effects because we have so many projectiles flying around.

Oh and if anyone wants to try it out you can sign up at www.playmech.com/Beta and it will email you a link to download the alpha.


#6
07/30/2013 (4:56 pm)
@Tim I have been following your progress for a while, also been looking for ribbon particles in T3D for proly as long, Lol

I was asking Adam if his Particle Ribbons could be used like yours, sorry for any confusion I have caused :-)
#7
07/30/2013 (5:00 pm)
I don't know how Tim's ribbons compare to mine. Watching that clip, I think I could do most of what I'm seeing particle-wise. I think something like a laser blast would be easy, but a solid beam from one point to another less so. Star Wars yes, Star Trek maybe not as good.

One point about the performance - it takes a lot fewer particles to have a good solid trail. I put a lot of effort into having smooth transitions in the start and end particles, so you can have a big billowing column with only 10 or so particles in it.
#8
07/30/2013 (6:13 pm)
Tim stop bragging about your ribbons and drop the code! :P
#9
07/30/2013 (7:28 pm)
@Steve: yeah yeah I know :)

@David: yeah I know, I was just showing how we used them as Adam's should work similar I would imagine.

We have both starwars and startrek lasers. We do use a special class for the startrek style lasers so its always on raycast instead of projectile and its very low poly since you only need two ribbon points.

Basically we have a ribbon class (which I'd be happy to share the two files for it if anyone wants to try and hook it up and fill in missing code) Then we use that class in projectiles, beam class, etc. We don't use the particle system at all with ribbons. So to make a starwars style laser, you simply set how many points you want it to be and the projectile class Adds as it travels and then removes if its hit the count limit. For the smoke trails that hang around, you just set a high count and a fadeout. The code isn't perfect plug in and play and it needs a bit of cleanup (since I wrote it quickly for Instant Action Lore: Aftermath deadline) Those are the main reason I have not submitted a pull request yet. We have a RibbonData datablock where you specify things like ribbon size, shader, etc.

Originally we used the particle system and because we have so many projectiles going off it was getting really poor framerate so switching from particle system to ribbon system we saw a huge gain in frames per second. Of course most games wont need that many projectiles on screen so you may not see as big of a performance boost as we did.

You can also see the ribbon code used here in a TGEA space game prototype we did years ago for green ear contest. used for lasers as well as engine trails.

#10
07/31/2013 (8:53 am)
That's a cool effect!
#11
07/31/2013 (3:43 pm)
@Steve,
Didn't you have a solid laser effect in your game? I remember seeing that in your early prototypes. The one that went through walls. Is that a resource somewhere?
#12
07/31/2013 (5:10 pm)
@Tim, I knew I had seen them in a space game as well but couldn't remember where, glad you cleared that up was bugging me :-D

@Demolishun, I think Steve's lazers are objects he stretches from muzzle point to impact point after a quick raycast. A clever, quick, networked way of doing a lazer effect :-)
#13
07/31/2013 (7:25 pm)
Damn that space sim looked cool! I remember it, there has been a heap of really great Torque based games over the years.

A shame when they didn't continue on.
#14
08/01/2013 (12:35 am)
Tim: you call that a prototype? I call that Freespace 2!
#15
08/01/2013 (6:54 am)
@Daniel: We used our Lore aftermath modified code base and wrote that prototype in 2 weeks. The video makes it look a bit better as the physics/controls are a bit rough and I ran out of time for the green ear deadline to get them working properly. We want to flesh it out into a full game but have not had the time yet.
#16
08/05/2013 (1:37 am)
Love your improvements @Adam!
Many thanks!
#17
08/07/2013 (9:06 am)
Cool stuff, guys. Tim, would love to see your code as well. Thanks! =)
#18
08/07/2013 (12:30 pm)
@Adam:

I got this to compile with no proiblems, added a left/right tiling particle, and as soon as I checked the 'Render as Ribbon' button, got this:

t3d\fx\particleemitter.cpp(1443) : Fatal - Out out bounds filter function for particle.

Any ideas?
#19
08/07/2013 (1:36 pm)
@Kevin, what I was offering up is only part of the overall integration. But it is the main class that can generate a ribbon. So it will require some work to get ribbons working in game. If you want to send me an email to timn at maxgaming dot net I will send you the code over.
#20
08/07/2013 (3:21 pm)
@Gibby: Good catch.

F32 t = F32(part->currentAge) / F32(part->totalLifetime);
AssertFatal(t <= 1.0f, "Out out bounds filter function for particle.");

The ribbon particles don't necessarily remove themselves immediately if there is lifetime variance - otherwise there is an ugly popping of geometry at the end of the ribbon.

Was an emitter already running when you clicked 'Render as a Ribbon' ? If there aren't any particles for the emitter then they should be golden if you check it and then fire things up. I'll have to add something that checks for that on the fly.
Page «Previous 1 2