Jump to content
Sign in to follow this  
Evil_Echo

How about documenting new particle FX?

Recommended Posts

I've been trying to prototype a new weapon. Part of which requires special particle effects.

The info on the BI wiki for ArmA on particle effects could be politely described as "limited". Not even the full list of available effects was listed, and those that were not all described in detail. Outside tutorials filled in some of the gaps - albeit in a cut-n-paste fashion for the most part. Not the best when trying something very different.

The situation for ArmA 2 is far worse. I have learned after a day's worth of digging that the particle effects are merged into a new .p3d file and there is absolutely no documentation on this at all anywhere I'd searched.

Could those in the know actually write some decent documents on particles and cloudlets for coders who are not rated as P-12 telepaths?

Share this post


Link to post
Share on other sites

Ask what you want to know and I'll try to explain it. I have a good idea of how the particle effects work, I coded many of the effects in ArmA 2.

You probably figured this out already: All the effects are located at "\CA\Data\ParticleEffects", except for some artillery effects which I think are with the artillery stuff in modules.pbo.

Also: http://community.bistudio.com/wiki/ParticleArray

That's not just relevant to scripted particles but config ones too.

Share this post


Link to post
Share on other sites

Well i too would like to see some more detailed informations, specially about the universal.p3d.

Which parameters create which effect. It's a bit tricky to understand and very frustating to find out with TBE.

So only thing i like to know, which number do create which effect:

["\Ca\Data\ParticleEffects\Universal\Universal.p3d", ?, ?, ?, ?]

I already looked up many of them in some A2 particle scripts, but a good overview would be much nicer. ;)

Share this post


Link to post
Share on other sites

Thanks for the offer Matt, I know you are among the best for effects out there. Any help is welcome.

I have dug through all function calls listed under the scripting section of the BI wiki before starting this thread. In fact I just double-checked the particle array link you mentioned in case it had been updated. The page still only contains info relating to the ArmA 1, no mention of the new .p3d layout. I even did a power search of the wiki for references to the new file.

This is really bad for A2 coders, because I have good reason to believe that A2 supports 16 frames of animation for particles vs 8 for A1. Add the fact that the routine calls for particles are using an array index rather than descriptive names for parameters and a coder is reduced to a heck of a lot of guessing to figure out what and where the correct effect is located.

So while the request is very broad, here are a couple of specifics.

1. List of what the elements on the new universal.p3d really are. For A1 there was the jpg image in http://community.bistudio.com/wiki/Image:Particles.jpg to refer to, but even that was a bit limited because without some extra verbage it is difficult to visualize what changing particle parameters like size, rotation, color/alpha would do to the effect. And not much of a clue which effects are luminous.

2. Better documentation of the setParticle* routines. Just listing the parameters of complex routines like this is not enough - BI needs to explain what the arguments actually do in a non-opague manner. For example, what is setParticleRandom really randomizing - are the arguments ranges, masks, or what? Is setParticleCircle creating a disk or a ring? Particle velocities, rotation, etc - what do they really do to the effect? I could spend hours just changing one parameter at a time to guess what BI already knows and really should share with us.

3. I've heard about cloudlets being mentioned in some config files. How do they relate to particle sources and how to use them?

4. I see some configs have entries that have a keyname indicating a effect and a value of a quoted string. Logically this is a reference to script to drive the special effect. If so, a list of available effects would be very nice to have along with descriptions of what those scripts do and maybe a demonstration animation.

I really don't want to sound like I'm bashing BI. Documenting a project like this is hard work and not very interesting to many programmers. But it makes the job a lot easier for third-party coders and that in turn brings more gamers into the community, which is income for BI. Hopefully they'll understand what I'm getting at and update the documents. :)

Share this post


Link to post
Share on other sites
Is there a Air Friction setting?
Yes. It's called "rubbing" here: http://community.bistudio.com/wiki/ParticleArray
Well i too would like to see some more detailed informations, specially about the universal.p3d.

Which parameters create which effect. It's a bit tricky to understand and very frustating to find out with TBE.

So only thing i like to know, which number do create which effect:

You open up the texture "\CA\Data\ParticleEffects\Universal\Data\Universal_ca.paa".

Use Textview from the new BIS tools.

Those numbers where you put "?" are explained in the page I lined above. Except the fourth one.

The fourth one is set to 1 to make the animation loop or 0 to make it play once and stop at the end. Defaults to 1 if you leave it out.

First value would be 16 for the universal partical, because the texture is a 16x16 grid of frames.

Now onto Evil_Echo's post...

I have dug through all function calls listed under the scripting section of the BI wiki before starting this thread. In fact I just double-checked the particle array link you mentioned in case it had been updated. The page still only contains info relating to the ArmA 1, no mention of the new .p3d layout. I even did a power search of the wiki for references to the new file.
As I said above, best to open the texture itself with Textview so you can see it for yourself.
This is really bad for A2 coders, because I have good reason to believe that A2 supports 16 frames of animation for particles vs 8 for A1. Add the fact that the routine calls for particles are using an array index rather than descriptive names for parameters and a coder is reduced to a heck of a lot of guessing to figure out what and where the correct effect is located.

Even A1 supported 16 frames of animation. If you make your own texture you could do as many frames as you want.

No guessing once you have the texture in front of you.

1. List of what the elements on the new universal.p3d really are. For A1 there was the jpg image in http://community.bistudio.com/wiki/Image:Particles.jpg to refer to, but even that was a bit limited because without some extra verbage it is difficult to visualize what changing particle parameters like size, rotation, color/alpha would do to the effect. And not much of a clue which effects are luminous.

Well, someone can take the texture, convert it to jpg, and upload it there if they want.

As for luminous, I'll explain that at the end...

2. Better documentation of the setParticle* routines. Just listing the parameters of complex routines like this is not enough - BI needs to explain what the arguments actually do in a non-opague manner. For example, what is setParticleRandom really randomizing - are the arguments ranges, masks, or what? Is setParticleCircle creating a disk or a ring? Particle velocities, rotation, etc - what do they really do to the effect? I could spend hours just changing one parameter at a time to guess what BI already knows and really should share with us.

Best thing is to play with it yourself.

http://www.armaholic.com/page.php?id=4859

That will need to be modified to work in ArmA 2. I can upload a modified version but I don't want to share it unless I can be sure the authors are ok with that.

Still, some people will be able to convert it easily.

SetParticleCircle creates a ring. Though you could make it look like a disc by randomising the position with SetParticleRandom.

Don't know if I can really explain the rest. I just alter the values until I get what I want - which is when it looks like the videos I've been watching.

3. I've heard about cloudlets being mentioned in some config files. How do they relate to particle sources and how to use them?
I guess deep down they work in the same way. The config values are generally the same as their particleArray counterparts. You could probably even write a script that reads them from the config and applies them to a particleEmmiter.

Careful though, some effects you'll find in the config are not used. Either because they were not implemented or they are OFP/A1 leftovers.

If you want to know how to make a weapon with it's own impact FX, missile trails, smoke or whatever I can explain that later.

4. I see some configs have entries that have a keyname indicating a effect and a value of a quoted string. Logically this is a reference to script to drive the special effect. If so, a list of available effects would be very nice to have along with descriptions of what those scripts do and maybe a demonstration animation.

I will write that up later. At the moment they only apply to vehicles. I don't know what BIS plans there but things might change at some point with the scripted/muzzle effects.

Now, luminous or glowing particles work differently to A1.

In ArmA 1 they worked by having an rvmat applied to the texture. It was crap, since you couldn't really control how bright it was and most rvmat features didn't work on particles anyway.

In ArmA 2 you make a particle glow by giving it a negative alpha value. It's weird but gives you good control.

The further below zero, the brighter it is.

[1,1,1,-1] = bright

[1,1,1,-2] = even brighter.

[1,1,1,-0.5] = not so bright. And also half transparent.

If I remember correctly, tank muzzle flashes are [1,1,1,-2].

Maybe someone with some documentation skills can get this info in the biki in a more readable form :o

Share this post


Link to post
Share on other sites
4. I see some configs have entries that have a keyname indicating a effect and a value of a quoted string. Logically this is a reference to script to drive the special effect. If so, a list of available effects would be very nice to have along with descriptions of what those scripts do and maybe a demonstration animation.
Here is the list of muzzle effects, with a description:

BIS_Effects_Rifle

Small smoke effect to simulate gun being fired. Used on just about anything firing a bullet weaker than a .50 cal.

BIS_Effects_Cannon

Used for the tank cannon, 'nuff said ;)

BIS_Effects_HeavyCaliber

Heavy weapons like 25and 30mm. Such as Shilka, Cobra cannon and the like.

BIS_Effects_HeavySniper

Intended for .50 cal sniper rifles. But since the scripted muzzle effects are not used on infantry you wont see it in-game without modding.

BIS_Effects_Rocket

Backblast effect for misile/rocket launchers.

BIS_Effects_SmokeShell

Was used for smoke shells at one point, but not any more as the effect now is set in the config.

BIS_Effects_SmokeLauncher

Smoke launchers on some vehicles.

BIS_Effects_Flares

Countermeasure flares. Not used. But you can test if you add the flarelauncher and ammo to an aircraft. Can't recall the classnames but you can look them up.

I think some addons like the F16 use it, or at least a modified version.

Notes:

These effects are only applied to vehicles. Although if you add the necessary eventhandler, you can get the infantry effects working. Although you'll need to disable that standard rifle smoke effect for it to look good. I might do this some time in a mod.

Share this post


Link to post
Share on other sites

...you'll need to disable that standard rifle smoke effect for it to look good.

I must ask, how does one go about to disable the standard rifle smoke effect?

It would be nice to use smokeless powder :)

Share this post


Link to post
Share on other sites

Thank you for the info Matt. I did use the BI tools and found the images. Tried the negative alpha effect - very cool.

I understand the "just fiddle around" part of your explaination too. That works for me because I also do a little bit of development work and have the BI toolset. But if I was just a regular schmuck doing mission editing, that's a pretty high bar to cross. It really would be better to have more information on the BI wiki - and at least update the existing info to reflect both ArmA and ArmA 2. I see on another thread that even Mando is having a hard time with locating the proper water effects for his project.

Another issue right now for me is moving particle sources. I know you can tie a source to an object, but the details are pretty vague. So far, I haven't had a lot of luck with that, so more digging into scripts in the .pbo files - ugh. Again, some better documentation on the wiki would save people a lot of time here.

Share this post


Link to post
Share on other sites
I must ask, how does one go about to disable the standard rifle smoke effect?

Somewhere in the config at "CA\Data\ParticleEffects"

Look for

class WeaponFireGun

There are some similar ones which might apply for vehicles.

Get rid of it by change "cloudletDuration", fadein, fadeout, and so on to 0.

But don't change "interval" to 0. Caused a CTD when I tried that. But raising it to a high value might be a good idea.

@Evil_Echo:

Not a problem. Glad I could help :)

Another issue right now for me is moving particle sources. I know you can tie a source to an object, but the details are pretty vague. So far, I haven't had a lot of luck with that, so more digging into scripts in the .pbo files - ugh. Again, some better documentation on the wiki would save people a lot of time here.

Two ways to attach a particle effect to something.

First by using the last element in the particlearray. Just add the unit reference there. Note the position and velocity vector of the particles will now be relevant to the object.

One bug with this that might be fixed by now (it also might be what's causing you trouble): the particle effect will only be rendered if the emitter is close enough to the player (within the viewdistance). Best to keep the emmiter at or near where the object the particles are coming from is located.

The attachTo command can be another way to do this. Although it can't attach to "ammo".

Share this post


Link to post
Share on other sites

I got a bit of a problem which i cant seem to fix which involves the tracers. Im not quite sure what is causing it tho. Basicly if you look in direction of the tracers being fired for example if an enemy postion is firing directly at you then no tracers are emitted. But if you look at them from the side or behind them they work. Any ideas?

Share this post


Link to post
Share on other sites

A question about the OnTimer/BeforeDestroy scripts. Are those sqf, sqs files, or can they be compiled functions?

Share this post


Link to post
Share on other sites

I've only used SQF files there. Don't think it supports compiled functions, but you could make the script call a function if you need that.

@Opticalsnare: That's not really relevant here. Think that's intentional anyway, apparently tracers are designed that way.

Share this post


Link to post
Share on other sites

Agree - could use a wrapper script - but that would kill any speed advantage of using the compiled function. :(

Share this post


Link to post
Share on other sites

Not necessarily. Depends how big the compiled function is. And calling a function means it's all executed at once with no pauses between commands, which is necessary for some things - especially with the script time limit per frame.

Share this post


Link to post
Share on other sites

I'd be using it to make a single particle drop to replace an exististing particle on it's death. The compile time >> execute time in this case.

Share this post


Link to post
Share on other sites

I noticed, that the universal.p3d do not have a light source.

For example the sparks:

drop [ ["\ca\Data\ParticleEffects\Universal\Universal", 16, 13, 2, 0],

They are not lighted up at night. Thats really stupid and it reduce the effect of it.

Well i already fixed this by using the SparksEffect.p3d from ArmA 1 which do have a light Effect, but i would love to see something to give thouse universal.p3d effects a light effect too.

Share this post


Link to post
Share on other sites

Try using a negative value for your alpha channel numbers in the effect colors.

Share this post


Link to post
Share on other sites

I do use:

[ [1,1,1-10] ]

for the sparks. But they simply have no light source...

Share this post


Link to post
Share on other sites

I've got this result,

like MadMatt, I modifiy CSL particules param to use it in A2, I only use it until today, now i need skills in config.cpp to configure it at a vehicule destructed smoke trail...the hardest !

I'm trying to understand how to disable A2 stock effect,and spawning mine at any vehicule destruction. I need cpp and sqf ?

I saw in Binmake Path ( C:\ArmaEdit\BinMake\binarize\bin ) many .cpp contains tips in comment ...

class Explosion
 {
   access = ReadAndWrite;
  [color="SeaGreen"] // single cloudlet parameters[/color]
   cloudletDuration = 0.2; [color="SeaGreen"]// time to live (not including fades)[/color]
   cloudletAnimPeriod = 0.5; [color="SeaGreen"]// animation speed[/color]
   cloudletSize = 1.0;
   cloudletAlpha = 1.0;
   cloudletGrowUp = 0.05;[color="SeaGreen"] // grow-up time[/color]
   cloudletFadeIn = 0.01; [color="SeaGreen"]// fade-in time[/color]
   cloudletFadeOut = 0.2;[color="SeaGreen"] // fade-out time[/color]
   cloudletAccY = -0.2;[color="SeaGreen"] // vertical acceleration[/color]
   cloudletMinYSpeed = 0; [color="SeaGreen"]// vertical speed range[/color]
   cloudletMaxYSpeed = 6;
   cloudletShape = cloudletExplosion;
   cloudletColor[] = {1, 1, 1, 0}; 
[color="SeaGreen"]// source parameters[/color]
   interval = 0.001;
   size = 4.0; [color="SeaGreen"]// particle size[/color]
   sourceSize = 3.0; [color="SeaGreen"]// size of area from which particles are emitted[/color]
   timeToLive = 0;

Well i already fixed this by using the SparksEffect.p3d from ArmA 1 which do have a light Effect, but i would love to see something to give thouse universal.p3d effects a light effect too.

How a p3d can have a light source ? i think it s coded in config file, they are the same as in A1 with many things more of course, so I suggest you to see the config of sparkseffect and apply it to the universal config.

In Universal, BIS compile in one p3d many others effects that are present in A1 but in several p3ds.

This thread is very good, MaddMatt you are my god ^^ about particles of course, you clarifies for me many bad things about config, so :

- The values in config are usualy useless, they are overwrite by scripts later ?

- Config files are used as a data base ? scripts hardcoded in .exe only use the values contains in it by refering to the variable ? because I see to many variables "interval, timeToLive, size, etc etc", it s all what a #sourceparticle or a "drop" need to work ?

Edited by Bizibiz

Share this post


Link to post
Share on other sites

What is class Table ? purpose ?

	class Table {
	class T0 {
		maxT = 0;
		color[] = {1, 1, 1, 0};
	};
};

Share this post


Link to post
Share on other sites

Has any kind of reference page been made yet? I'm pulling my hair out over this. I only know how to create shiny balls but not smoke.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×