Game Development Community

Animated particle bitmaps!

by Karsten "Clocks" Viese · in Torque Game Engine · 10/21/2001 (10:32 am) · 15 replies

Is ther someway to use a serie of btimaps for particles.

I have tried to make a flames.ifl and a flames.dml both contaning this:

fire0.png
fire1.png
fire2.png
fire3.png
fire4.png
fire5.png

and the saved it as flames.ifl and flames.dml in the same dir as the png's.

Then in the flamethrower.cs I tried these:

textureName = "fps/data/textures/particles/flames";

and:

textureName = "fps/data/textures/particles/flames.ifl";

and:

textureName = "fps/data/textures/particles/flames.dml";

both nothing worked.
The 2 last ones made the game crach on laoding datablocks.
The fisrt one just display colored squares with no texture.

So is there some kind of a animated sequence of bitmaps that are supported by the TGE?


I just found this in T2/shochlance.cs

animateTexture = true;
framesPerSec = 26;

animTexName[00] = "special/Explosion/exp_0002";
animTexName[01] = "special/Explosion/exp_0004";
animTexName[02] = "special/Explosion/exp_0006";
animTexName[03] = "special/Explosion/exp_0008";
animTexName[04] = "special/Explosion/exp_0010";
animTexName[05] = "special/Explosion/exp_0012";

and i will try to see if that works.

But untill then my question still stands.
I will return with an update later.

// Clocks out

#1
10/21/2001 (11:27 am)
Nope.
The animTexName[00] etc....
didn't work.

So any other suggestions?

// Clocks out
#2
10/22/2001 (12:39 pm)
Ive been working on a similar idea. I wanted a GUI component to use the particle engine for effects. Unfortunatly, at the moment I have been unable to get it to work. In fact at the moment it wont even compile :( Has anyone else done something similar?
#3
10/23/2001 (12:03 pm)
I've had the same probs with IFL, if you look in tsmaterial.cc and change this define (or put your ifls in this subdir) it should work:

// prepend this to ifl materials
const char* TSMaterialList::csmIFLTexturePrefix = "skins/";
#4
10/23/2001 (2:30 pm)
I'm working on adding particals / animations to the Gui. It's for my MMORPG game Age of Darkness so I can have a nice magic system on the interface and also show any spell effects on the character gui.

I'll post what I get here as soon as I get it.
#5
10/23/2001 (4:00 pm)
OOPS!!
(Sorry this is an unrelated subject) You should really consider changing the name of your project. Age of Darkness was an MMORPG project from a texan company I used to work with and I pretty much believe they still own the rights for it. :P

Those guys were serious, so I dont think they will think about it twice before suing you if you try to use it without their permission. (and I dont think they will give you the rights for free neither).

Sorry for bringing bad news.
#6
11/12/2001 (2:20 am)
First off the ifl files are used in max for animation of textures.
to create the flames like you want all you would need is in 3dsmax 2 or 3 planes put at right angles to each toher. then the texture would be your flame texture.
Now you have to use the correct png filter if your using photoshop. Otherwise you should be ok. Just open an existing tribes image and if it looks very greayed out then you know that the png filter for the program your using isn't the right one. If you have a modeler in your group ask him to make a projectile that has your images and to alter its shape so you can alter the flame size a bit and time it with the animations. The IFL files are then placed in the material slot. then you asign an animation to it via the track editor. I hope this helps somewhat. I can't write an entire tut here. If I did I would have to be payed for it. :/
#7
11/12/2001 (4:13 am)
Stephen

I know all that, but what I wanted was to use animated textures on the particle system.
Not to make an animated projectile.

Thx for your help anyway.

// Clocks out
#8
11/12/2001 (7:48 am)
This idea comes from an artist and not a programmer, so forgive my ignorance if you have already considered this...

Take a single texture map and apply it as the texture to your particles. Then based on the life of each emitted particle, change the hue of the texture (thus allowing you to start at a white, go to a red, an orange, and then yellow) to give you the effect that you want?

You could also swap or blend between bitmaps as you originall have planned, but again the key is to doing it based on the life of each particle.
#9
11/12/2001 (8:08 am)
I already have all that.
What I want is to use 6 different stages of a fireball animation I have made.
The only way to get this right is to get the particles to use the 6 bitmaps in an animation.

// Clocks out
#10
03/01/2006 (8:31 am)
I got it work like this:

datablock ParticleData(fire)
{
dragCoefficient = 0.0;
gravityCoefficient = -0.5; // rises slowly
inheritedVelFactor = 0.00;
lifetimeMS = 500;
lifetimeVarianceMS = 150;
animateTexture = true;
framesPerSec = 24;
animTexName[0]="~/data/shapes/particles/fire_1";
animTexName[1]="~/data/shapes/particles/fire_2";
animTexName[2]="~/data/shapes/particles/fire_3";
animTexName[3]="~/data/shapes/particles/fire_4";
animTexName[4]="~/data/shapes/particles/fire_5";
useInvAlpha = false;
spinRandomMin = -30.0;
spinRandomMax = 30.0;

colors[0] = "0.6 0.6 0.0 0.2";
colors[1] = "0.6 0.6 0.0 0.15";
colors[2] = "0.0 0.0 0.0 0.0";

sizes[0] = 1.0;
sizes[1] = 1.1;
sizes[2] = 1.0;

times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
#11
05/07/2008 (12:35 pm)
Hey I know that this thread is pretty old but because it's the first thing that comes up when you search for animated particles I thought I'd just post my findings for TGEA:

I wasn't able to get the animTexName[x] array to work in TGEA 1.7.0 as those previously managed to get working in older builds of the engine. The only way I was able to successfully get animating textures was to use animating texture coordinates. How to do this can be found here.

tdn.garagegames.com/wiki/TSE/Particles
#12
10/20/2009 (11:02 am)
In fact the effect that the above link supplies is not the one I want to achieve. The effect that the link provides is randomly choose between particle datablocks and spawn one of them via an emitter. This is done using this:
datablock ParticleEmitterData(MyParticleEmitter)
{
   ejectionPeriodMS = "50";
   ejectionVelocity = "1";
   velocityVariance = "0";
   ejectionOffset = "0.2";
   thetaMax = "40";
   particles = "MyParticle1 MyParticle2 Myparticle3";
   blendStyle = "ADDITIVE";
   softParticles = "0";
   softnessDistance = "1000";
};

The effect that could be achieved in TGE via this code :
animTexName[0]="~/data/shapes/particles/fire_1";
animTexName[1]="~/data/shapes/particles/fire_2";
animTexName[2]="~/data/shapes/particles/fire_3";
animTexName[3]="~/data/shapes/particles/fire_4";
animTexName[4]="~/data/shapes/particles/fire_5";
in the ParticleData datablock is no longer supported in T3D or TGEA. Is that true?
I am trying to change the texture of the spawned particle , not to spawn different kind of particles that use separate texture each. How to do this?
It seems that Animated particles have different meaning in TGE and T3D.
How to achieve the effect of changing the texture of the emitted particle?
#13
10/21/2009 (1:05 am)
I think there's a section on just that in the link that was posted, a little further down. Or am I misunderstanding what you're looking for?
Quote:Animated Particles
#14
10/21/2009 (9:53 am)
There is nothing special here.
The link above describes how to make the ParticleData to use a piece of a huge picture via texture coordinates. Using this you can setup several ParticleDatas use different parts of just one texture. And then via the "particle" field of the ParticleEmitter datablock you could setup that particle emitter to use all the different particleDatas. In fact this is not an "animated particle". What all that does is make the particle emitter choose between all the particleDatablocks and spawn one of them. This is nothing but a particle emitter that chooses the spawn particle from a couple of ParticleDatablocks.
What I am looking for is to change the texture of the spawned particle. This is something very different and this should be called "animated particle". This had been available in the prior to T3D engines. I don't understand why this interactive functionality is missing in T3D.
#15
02/22/2011 (3:03 am)
Sorry to revive an old thread but I think it could be seen again and give a wrong impression...


Quote: "Using this you can setup several ParticleDatas use different parts of just one texture"

In T3D (can't remember in TGEA) you can animate the texture in that way...
(see THIS and THAT)

In practice displaying always just a part of the same texture but choosing for each frame which part of it...

It's not a completely replacement for what IFL did but for this kind of use I think it could be.

The only downsides I see are:

- you can't have 64 different frames (this really depends on how small the texture is)
- you can't choose frame display order (i.e. 1.jpg, 2.jpg, 3.jpg, 4.jpg, 3.jgp, 2.jpg ...)
#16
02/22/2011 (3:03 am)
Sorry to revive an old thread but I think it could be seen again and give a wrong impression...


Quote: "Using this you can setup several ParticleDatas use different parts of just one texture"

In T3D (can't remember in TGEA) you can animate the texture in that way...
(see THIS and THAT)

In practice displaying always just a part of the same texture but choosing for each frame which part of it...

It's not a completely replacement for what IFL did but for this kind of use I think it could be.

The only downsides I see are:

- you can't have 64 different frames (this really depends on how small the texture is)
- you can't choose frame display order (i.e. 1.jpg, 2.jpg, 3.jpg, 4.jpg, 3.jgp, 2.jpg ...)
#17
02/22/2011 (3:03 am)
Sorry to revive an old thread but I think it could be seen again and give a wrong impression...


Quote: "Using this you can setup several ParticleDatas use different parts of just one texture"

In T3D (can't remember in TGEA) you can animate the texture in that way...
(see THIS and THAT)

In practice displaying always just a part of the same texture but choosing for each frame which part of it...

It's not a completely replacement for what IFL did but for this kind of use I think it could be.

The only downsides I see are:

- you can't have 64 different frames (this really depends on how small the texture is)
- you can't choose frame display order (i.e. 1.jpg, 2.jpg, 3.jpg, 4.jpg, 3.jgp, 2.jpg ...)