X-Emitter V1.10.2 - 11/1/11 - BGE Particle System - Bugfix


Hey. So I made a 3D volume emitter before that I packaged in with volumetric smoke - it was alright. However, from that original emitter, I made a more robust particle emitter. It is fairly useful, and has settings for speed, friction, growth, size, and the particles even scale their variables around so that lowering the frequency of their execution keeps them running at the same speed, which is useful for keeping Logic down for particle emission. Oh, and forgive me if I throw ‘Emittor’ and ‘Emitter’ around a lot; either way should be correct, English-wise, LOL.

So, I was thinking that others could use this and create some particle effects and post the blend files for everyone to benefit from - all of the assets posted here by me are free to use, even in commercial products, without crediting (though it would be nice; try to remember, please. It would be much appreciated). Anyway, here’s my first one:

2/18/11 Update - X-Emitter V1.1 Release

Thanks to Monster for the idea, X-Emitter has now been updated to version 1.1! This version allows users to set emitter behavior parameters directly in the emitter objects rather than using scripts.

2/25/11 Update - X-Emitter V1.2 Release
Version 1.2 has updates to the emitter and particle scripts. New features include camera culling for offscreen particles, the ability to randomly choose the color of particles from a list (rather than an even distribution of random values), a maximum number of particles allowed per emitters, and the capability to parent the particles to the emitter (a bit buggy; doesn’t follow rotation).

New particles --Snow–, --Bubbly Mist–, and --Sparks-- have been included.

3/11/11 Update - X-Emitter V1.3 Released

New gravity feature for particle effects. Also, new particles --Fire (Planar)–, --Smoke (Planar)–, --Sparkle–, --Gas–, --Stream-- have been added.

3/24/11 Update - X-Emitter V1.5 Released.

New particles (Fire (blob), enegy ball) along with new looping logic as opposed to per object logic makes this the fastest X-Emitter release to date.

4/5/11 Update - X-Emitter V1.6

A video of the new features!

New particle emission modes - Vertex and vertex-ordering modes. Slight performance upgrade.

EDIT: Sorry if I don’t say it - most of the emitters are off by default so that they don’t bog down the scene. To enable them, check the ‘emitteron’ property in each of the off emitters.

4/26/11 Update - X-Emitter V1.7

So in this version of X-Emitter, there have been some changes. Namely, that there is now capability for collisions for particles! It’s pretty basic, but already works well for a purpose. Note that it only works for speed, not force right now.

Since this version is pretty special, I’ve made some art to use with it - if you wish to attribute me for X-Emitter in your game, you can do so by simply putting one of the pictures included (or the picture below) in it, preferably at the beginning (like professional game companies do).

Note that was wholly rendered in the BGE. The only thing that I used a photo-editing program for was my name at the top.

4/28/11 Update - X-Emitter V1.7.1

Hey. I found a bug - if you delete an emitter, then the particles are left orphaned, and so aren’t updated or deleted. To fix this, I added a variable to handle particle and emitter deletion.

5/23/11 Update - X-Emitter V1.7.2

A very slight update, as this fixes a bug with the previous emitter destruction variable.

6/18/11 Update - X-Emitter V1.8

A major update that changes how the X-Emitter works. Basically, I moved the particle calculation from the emitter to a global object that calculates particles for each function in the scene. So, XParticle.Generic is a list of all particles in that system, MyParticle.Fire is a list of all particles in that system, and so forth. This all gives a pretty nice little speed increase, I believe.

This should work fine, but if it doesn’t tell me here, or e-mail me at [email protected] if there’s a problem.

7/17/11 Update - X-Emitter V1.9

Another update, this one featuring seed values for emitters. Using these, you can make a particle system, then find a particular random spawn pattern you like, and go with that one. All you have to do is select a non-negative value for the emitterseed property. If you select a negative value, the seed will be removed from the randomizations.

8/26/11 Update - X-Emitter V1.10.1

For some reason, I didn’t put anything about version 1.10, but anyway, here’s another update.

This is a bugfix version on top of X-Emitter V1.10, which added particle prototyping (only in the Generic XParticle script) as a potential speed-up. Particle prototyping is where the first particle is used as a ‘base’ for what the other particles do. Once that particle has finished its course, other particles copy its properties and live ‘its life’ as well. While the other particles can’t be randomly colored or be as unique, there can be a speed-up, depending on different factors. Another emitter has been added to the demo blend to showcase this.

This newest version (1.10.1) fixes moving between scenes with the X-Emitter - before, particles stayed in the global particle list, causing game-stopping bugs when scenes were switched because the particles didn’t exist anymore, but the calculator object was still attempting to calculate them. This release should fix that issue.

However, make sure that the calculator script executes first before any other particles are spawned, as well (click the ‘Mark Controller for Execution’ flag button on the Python controller), as the demo blend demonstrates.

11/1/11 Update - X-Emitter V1.10.2

Hey. Soo, I updated it to work a little bit better in this version. Basically, I changed how it handled invalid (dead) particles. Rather than wiping the global particle list when the calculator’s created (old method), it handles errors as they arise, and does so efficiently (only if there’s an error will the script intercept).

Download the latest X-Emitter here.

HEy this is very cool, thanks man!!!

Heh. It’s been awhile since this was first posted; I’m glad someone likes it. Thanks.

I ll really need this on my game but I dont know if I ll have the time to put all the things toghether since the time is almost on the end for the 2010 summer game competittion, but this is very cool!

Hey many thanks for that example. It looks awesome. I really need something like that for my mosquito spray. Thanks a lot

i don’t see the Z sort alpha map problem here!

how did you solve it, or it is solved in 2.56 GLSL ?

Hey Joeman

This looks quite nice. Unforunatly I do not have GLSL support, so the demo looks not that nice as in your screenshoot. But I do not think that is a big deal as I can replace the emitted object with own versions ;).

Added to

Just a short remark:
I would like to set up the canfiguration values directly at the objects properties rather than to set up an own file for each separate emitter type.
While this is fine for single value properties e.g. “partgrow” it is not that easy to get a list into a property. Maybe if I enter a string representation of a list into a string property, you could convert it?

I mean that I can enter a string property
‘partfriction’ with “[0.0, 0.0, 0.01]” the script automatically converts it into [0.0, 0.0, 0.01] and uses that. So I wouldn’t need a separate script, just the properties at the emitter.

That’s a really good idea. If I make a property for, say, ‘partfriction’ and set it to be a string, it can use the eval() function to convert the string to a list. I’ll probably make a new example file today. Thanks, Monster!

EDIT: The new version has just been uploaded. Thanks for uploading to the Wiki, Monster. I’m glad this can help out everyone else. Have fun with it!

yeah, anyone has a comment on this? :o

Well, if I check my example, I think that because the particles aren’t two-sided as well as the particles not being too close to each other (each particle is separated by a good distance), the alpha fighting doesn’t show up (in GLSL mode). I’m not exactly sure if this is the reason why it appears normally, though.

V1.2 Update - new particles and better emitter and particle script makes a better X-Emitter all around for everyone.

V1.3 Update - New gravity feature for particle effects. Also, new particles --Fire (Planar)–, --Smoke (Planar)–, --Sparkle–, --Gas–, --Stream-- have been added.

V1.5 Update - New particles (Fire (blob), enegy ball) along with new looping logic as opposed to each logic, making this the fastest X-Emitter release to date.

Wow. This is the first version that works properly on my system, and it looks awesome! May I use this for the dust from skidding tires in my game?

@skykooler - Yeah, sure - the script and particles are all freely publicly licensed by me. You can use it in any release, commercial or otherwise, as long as you attribute the X-Emitter to me somewhere released in the game (the credits, for example).
EDIT: Oh, and I wanted to ask - what do you mean that this is the first version that worked? What was the problem in the previous versions?

To me, it works very well, with the new 2.57 RC!
Your work is great, even “awesome”, but don’t expect much/fast reactions, many people ( including me) don’t use 2.5xx versions!
Bye and thank you for sharing!

Thanks, OTO. I’ll keep working on the emitter, though I’m not sure how much faster I can get it. Also, I wanted to mention that it might be a good idea for people to share their finished particle effects around and compile a nice little library of effects for everyone to enjoy.

A video of the new features on first post!

New particle emission modes - Vertex and vertex-ordering modes along with a slight performance upgrade.

For some reason the presets like smoke, fire etc. aren’t showing up for me even though I have GLSL on… I tried it with 2.57, 2.56 and 2.55…

Sorry if I don’t say it - most of the emitters are off by default so that they don’t bog down the scene. To enable them, check the ‘emitteron’ property in each of the off emitters.

EDIT: Also, that download link was wrong. I corrected it.