Game Development Community

Particles tutorial?

by Radoslaw Marcin Kurczewski · in Torque Game Engine · 02/25/2003 (12:57 am) · 5 replies

My post is a bit similar to that of Federic: is there any documentation/description/tutorial on how to create particle effects? I mean: what each parameter is for, how to define particular effect and so on. Studying Torque examples I've found a lot of magic numbers, I don't understand - of course I can dig into C++ code, but it doesn't answer main question: How to create, let's say, nice cloud from scratch...

I hope, I'm note alone...

#1
02/25/2003 (1:30 am)
I don't know of any tuturial, but seeing the parameters in action and changing them on-the-fly should also help I guess... check out the Particle Editor...
#2
02/25/2003 (2:24 am)
Thanks, I'll take a look at this! All I want is to save time of our designers ;-)
#3
03/10/2003 (2:32 pm)
Here is a link to a tut I did on particleEmitterNodes:
holodeck.st.usm.edu/vrcomputing/vrc_t/tutorials/
Look under effects then part five...

The info works for particle emitters also; below I've reposted some of the settings and parameter definitions as best I can determine them:

datablock ParticleData(BigfireParticle)
{
textureName = "~/data/fx/footpuff"; //

//for use with ShapeBase objects ??
//animTexName = "~/data/fx/fire/lightning1a_frame"; //max num of textures = 50 (PDC_MAX_TEX)
//animateTexture = 1; //default = "false"
//if animated textures, use these below??
//numFrames = 3; //default = 1 PDC_MAX_TEX
//framesPerSec = 3; //default = numFrames (max 200)

useInvAlpha = 0; //default = "false" (i.e., explosion or ring effects)

dragCoefficient = 0.9; //default = 0.0 (>= 0.0)
gravityCoefficient = -0.2; //default = 0.0 (negative rises)
inheritedVelFactor = 0.3; //default = 0.0

windCoefficient = 0.1; //default = 1.0
constantAcceleration = 0.0; //default = 0.0

lifetimeMS = 2000.0; //default = 1000 (1ms) (100 min; time in ms, >=1ms
lifetimeVarianceMS = 50.0; //default = 0 (< lifetime)


spinRandomMin = -30.0; //default = 0.0 (range -10000 to 10000; < spinrandommax)
spinRandomMax = 30.0; //default = 0.0 (range -10000 to 10000)
spinSpeed = 30.0; //default = 0.0 (range -10000 to 10000 ; degrees per second)

//Interpolation variables
times[0] = 0.0;
times[1] = 0.33;
times[2] = 0.66;
times[3] = 1.0;
colors[0] = "0.7 0.7 0.0 0.7"; //RGBI
colors[1] = "0.9 0.8 0.0 0.3";
colors[2] = "0.8 0.8 0.0 0.2";
sizes[0] = 5.0;
sizes[1] = 1.5;
sizes[2] = 1.2;
};
//----------------------------------------------------------------------------
//Use the ParticleEmitterData name as the emitter entry in your mission file
//This section must follow the ParticleData it calls

datablock ParticleEmitterData(BigfireEmitter)
{
ejectionPeriodMS = 10000; //1000=1 particle per second (1ms minimum)
periodVarianceMS = 500; //variance has to be less than period

ejectionVelocity = 0.5; //6.80645; // >= 0.0, from 1.0 to 3.0 meters per second
velocityVariance = 0.1; //has to be less than ejectionVelocity
ejectionOffset = 0.5; //ejection from the emitter point >=0

//theta,phi rotation matrix axis angles (degrees) eg phi * (PI / 180)
thetaMax = 10.0; //0-180
thetaMin = 0.0; //0-180 0 = All heights (min has to be less than max)
phiReferenceVel = 180; //0-360, 360=all directions
phiVariance = 10; //0-360.0

overrideAdvances = 0; //0 or 1 function ???
orientParticles= 1; //0 or 1 "true" or "false" (orients the particles out from the emitter source (1) or as billboard (0) )
orientOnVelocity = 0; //0 or 1 billboard if no velocity in mission file

//when tied to an ParticleEmitter object, then these work; if ParticleEmitterNode then don't need
useEmitterSizes = 0;
useEmitterColors = 0; //default = 0, has to be 0 for ParticleEmitterNode; colors come from particleData above

particles = "BigfireParticle"; //call particle data
};
#4
07/08/2003 (10:59 pm)
My particles seem to be pushed to the side as if there was a wind or something, could someone tell me what variable does this?
#5
07/09/2003 (9:09 am)
WindCoefficient = 0.1; //default = 1.0

WindCoefficient determines how much the 'wind' on a level affects the particle. 1.0 means it will do the same speed as the wind, 0.0 means it is not affected by wind. That's from memory - I could be wrong. Try it and see if that does what ya' need :-)