Jump to content

Help With Particle Systems


MackeyK24
 Share

Recommended Posts

Yo @Deltakosh and @Sebavan ... and you too @Wingnut ... And Any Other Particle System Guys Out There :)

 

Hey guys... Check out the Babylon Toolkit Game Projects section and try the Space Shooter Demo. As you can see the Particles suck. I need to know how to create effect like

a exhaust jet fire for both the Player and Enemy Ships. I need explosions for the asteroids and an even bigger explosion for the ships when they get destroyed.

I need to work with someone to create these kind of particle system so I can also make them available as CONTENT for the toolkit so you can have a library of particle system effects

that you can just attach as components... They same way Unity does Shuriken Particle Systems.

 

As Always Any Help Would Kool For Everyone In The Community :)

 

Link to comment
Share on other sites

Hi M.  Particles have textures... often quite specialized to the effect.  If you could "acquire" a library of particle textures, and determine how to store it, then... you know... the pre-made particle effects will all use those textures ONLY... so you get consistency. *shrug*  Thoughts?

And... keep in mind... standardParticles... lots of power to modify startPosition, startDirection, and update funcs.  GPU particles... can't do that.

Do you need both types?

Link to comment
Share on other sites

Its for the toolkit particle system component... check it out with toolkit scene... just creae a cube or sphere in the scene and add a Babylon Particle System component to it... you can set all the partle system properties including using CPU or GPU particles. 

 

I am trying to figure out how the heck u would know what values and textures and combinations of effects i need to do in babylon to make effects.

To start with so i can finish the space shooter games is explosions and the jet exhaus for the ships...

Ultimately i would like to accumulate a library of particle effect prefabs thats users can just slap on to game objects 

Link to comment
Share on other sites

Ok, so you need particle effects than look approximately the same, whether GPU or CPU, using the same textures for both.  Stated correctly?

And you have a place to store a particle texture-file library, which would be the first step in creating a particle effects library?

There's SO MANY variables.  SOME great explosions... use more than one particle system at the same time.  One for fire, one for smoke, one for debris chunks.  You can see "debris chunks" for enemy ship explosions... in Jerome's "Office Games" space fighter demo... http://officegames.eu/StarFighter/StarFighter.html  (likely done with SPS particles).  I don't think he uses a fire/smoke particle system... but maybe a highlightLayer or glowLayer with expanding glow diameter during explosion.

Often, particle explosions use .manualEmitCount instead of emitRate.  Let's say you DID use 3 particle systems (fire/smoke/flying chunks) for your explosions.  With .manualEmitCount, the 3 particle systems STAY running the whole time/game.  Whenever you need an explosion, you set their emitter positions, and then set all 3 .manualEmitCounts to some values.  As soon as you set those, the explosion will happen... all 3 p-systems spewing their entire .manualEmitCount in one big "puff".  Then all 3, go back to idling.  ManualEmitCount = brush chipper/hopper.  Just shove-in some branches and crap... prrrrrrrrrrrt... flying woodchips.  :)

Did you know that already?  Possibly a factor in great particle explosions.

The jet thrust... not .manualEmitCount, likely... but IF you want the thrust plume "evolving across time/distance"...  color1, color2, colorDead will give you color-change across time and distance, but maybe not good "con-trails" of soot/smoke.  The fire part of the thrust plume... needs short particle lifetime... plus... needs to consider the possibly-unwanted brightness that happens when many particles with larger .maxSize... are concentrated in a small area (near the thrust port).  For the smoke/soot con-trail... bigger particles, different texture, longer .maxLife... different emitRates/power.  The BEST-looking particle effects... CAN use more than one particle system at the same time.

Is THAT an option that is open to your strife?  (I have never used the toolkit.  I don't know what it likes and doesn't like.  I don't know its limits.)

Want me to be quiet?  I don't mean to be a stick-in-the-mud for ya. 

It seems that you might seek to "package" some particle effects.  Can this package actually contain the textures (maybe up to 4 of them)... needed for the 3-4 particle systems inside the package... needed to create the effect properly?

I hope I've been helpful, even though it feels like I'm being a pain-in-the-butt.  :)  Here's an almost-tolerable single-PS manual emit explosion.  It uses our common "flare.png" texture.  Others might be able to improve it. 

Here's a jet thrust demo... single ps, same flare.png, using .emitRate, with a mesh gizmo for an emitter.  When using a gizmo, it's easier to aim the thrust (no need to adjust ps.direction1/2).  I'll leave it to you... to test same effects with GPU particles.

If you have questions about the settings... just holler... I'll try to answer.  Maybe the most confusing setting... is emitBox.  Notice lines 35/36 in #19 PG.  The min and max are set to the same value... a "point" that is -.5 units of Y-DISTANCE... from the size 1 fountain's center.  Thus, the entire emitting area... is a single point on the bottom (y = -.5) of the fountain mesh.  If you want your thrust plume to begin... a slight distance away from the thrust port (like some real jet afterburner thrust plumes)... change the -.5 to -.7... moving emit point further down the Y axis of fountain mesh.

Cone shape/spray angles are set in lines 62/63.  LENGTH of plume (before particles disappear)... is a combination of maxLifeTime, emitRate?(maybe), and maxEmitPower.

Link to comment
Share on other sites

hmm, I must have bad breath or stinky armpits.  :) I hope that simple explosion and simple thrust plume worked for ya.

If you get a chance to brief me/us, can you tell more about your library of particle effects?  Maybe later, after you decide on a structure?

Have you thought about using  "categories" (effect type) in the lib?  Examples:

- Single-particleSystem effects that can be done with both CPU and GPU.
- Multiple-particleSystem effects that can be done with both CPU and GPU.
- Single-particleSystem effects designed for CPU-only.
- Multiple-particleSystem effects designed for CPU-only.
- CPU-only effects requiring custom startPosition, startDirection, or update functions (custom funcs included-with effect module/package/plugin?) (func-tweaking docs, too?)
- CPU-only effects with multiple particleSystems AND custom start, direction, and update functions.
- High-particle performance-sensitive GPU-only particle effects - single or multiple GPU particleSystems.

...etc.  (your categories may vary)  

Evolvers:  Although BJS particleSystems already have time-based/particle-age-based "evolving" such as color1, color2, colorDead, SOME fancy effects could have advanced time-based requirements. 

Example:  A classic stick of dynamite or round cannonball-with-fuse bomb.  One "fuse sparkle" particleSystem emitter travels along the fuse... for X seconds.  Then the TNT blows, which turns OFF fuse sparkles and turns-on KY-BOOM system(s).   This might be a bad example, as it requires not only particle textures to be reffed/carried-along, but also some simple mesh and emitter-position animation. 

Yet another category... effects that require/generate mesh.

Hell, "effects that require an animated emitter" is yet another "requirement".  Animating/continuously-positioning an emitter... is really an off-particleSystem requirement just like a "mesh requirement" or texture requirement would be.  These are things that cannot be accomplished by a particleSystem itself.  It needs off-object assistance.

Fireworks is one such example.  Quite likely AT LEAST two particleSystems are needed (or a fast particleSystem guts re-config during change from launch particles to "report" particles).

Needed... one rocket plume to get the shell airborne, and then the report/boom.  A particleSystem, in itself, cannot animate that vec3 emitter into the sky FOR US.  Therefore, a fireworks shell/projectile COULD be categorized as "effects that need off-object JS support"  (some code must travel WITH the particle effect module/plugin, or else the effect will look like crap.)

Just wonderin' what you're thinkin', so far.  :)  Thx.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...