Jump to content

Particle Editor Discussion


  • Please log in to reply
12 replies to this topic

#1 Valdez

Valdez

    (・ ω ・)

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 10,633 posts
  • Gamertag:GFWL Valdez
  • Fav. Game:
  • Gender:Male
  • Location:Singapore

Posted 28 May 2009 - 01:21 PM

Posted Image



This thread will be used for discussions pertaining to the particle editor. I’ve posted some basic guidelines here, but I haven’t really tried most of the finer features within the editor so it’s not a complete guide. Stuff will be updated in as more information is made available.

GETTING STARTED
The particle editor needs to read the texture files in the game. In order to do so, the texture files must be extracted to this destination:
C:\Program Files\Sega\Universe At War Earth Assault\Art\TEXTURES\DDS

Next, you will need to have (in that same destination) .tga versions of the particle textures. Look through the list of DDS texture files, the textures corresponding to particles will have the prefix “P_” in their name (eg.  P_PARTICLE_MASTER). Use a converter program to open all of these and save/convert into a .tga format. This will allow the textures to show up when you use the UV picker to select textures for your particle.

After that, create a new folder (you can name it whatever you want) in the Program Files\Sega\Universe At War Earth Assault destination. Move these files into that folder:

ParticleEditor
binkw32.dll
ZedGraph.dll
ParticleEditorPrefs

With that you’re ready to use the particle editor. You should see 4 windows:

Petroglyph Particle Editor: The main window, where you see the particles

Simulation: Contains the “playback” features to view your particle in motion. There’s also a feature in there to specify a target for you to observe how an attractor particle behaves when attracted to a target.

Particle Editor Plug In Settings: This is where you edit the various characteristics of your particles by modifying plugins that control size, colour, texture etc.

PlugInGraphWindow: This is where you edit keyframe graphs, which are graphs representing certain qualities with respect to time. The horizontal axis represents time as a fraction (e.g the middle, which says 0.5 is the halfway mark in the timespan of a particle, it does NOT mean 0.5 seconds)

EMITTERS AND THEIR PARTICLES
In the editor, a particle model is an Emitter containing one or more Particles within. The particles are listed in a particular order with the ones at the bottom of the list appearing in the foreground while the ones at the top of the list will be in the background.

Posted Image
In this image you can see 2 particles, a small red one and a big blue one. The blue one is behind the red one because in the list, the blue one appears above the red one. This is the basic idea behind how the different layers are stacked. You can move a particle up or down in a list by right-clicking the intended particle  and selecting Move Particle Up/Down. The order is essential for achieving the desired look. For example in an explosion you would want the smoke to be in the background so in the list, the smoke particle must be around the top.

The 3 axes are represented by coloured lines, red = x, green = y, blue = z. The lines point in the positive directions so any directional numbers with negative values will imply a movement in direction opposite to these lines.


CREATOR PLUGIN
Creator Plug In is responsible for basic things like the spawning frequency of a particle, as well how the particles move, etc. There are several types of creator plugins but the most common one is the Shape type. Nearly all known particles use this type so I’ll focus on it.

The shape creator plugin has some LOD (level of detail) sliders, but I’ve never really gone and experimented with them.

The particle-spawning adjuster sliders are labelled with pretty straightforward text, although you’ll notice something called Enable Bursting below the Spawn Interval slider. If Enable Bursting is set to “On”, the particles that spawn every interval will emerge all at once. If set to “off” (the default setting), they will come out one-after-another but very rapidly. The bursting toggle is good for particles like explosions, while for fire, smoke, etc, it is best left toggled “Off”.

Below the spawning adjusters are position and velocity adjusters. “Position” determines the possible places where particles can spawn, while “velocity” determines the speed and direction of movement. A brief description of each of the 7 types:

Point A specific user-defined point in the 3D space. If this is used to define position, the particle will spawn at the specified xyz coordinates. Think of it as a Cartesian system, with the Emitter as the origin.
If this is used to define velocity, the particle will move towards the specified xyz coordinates with reference to where the particle appeared (not with reference to the emitter). Think of it as a Cartesian system, this time with the Particle’s spawn point as the origin.
Posted Image
A particle with point position x:0, y:0, z:200 and a point velocity x:0, y:100, z:100, the particle’s colour is set to change from blue to red so you can see how it moves

Note that you can input negative values for “opposite” directions.

Direction The “direction-type” modifier is similar to the idea for points, but instead of particles spawning from or moving towards a certain point, in this case it’s a series of possible points that lie on an “imaginary line”. The Min/Max Magnitude values will determine exactly where this “imaginary line”.

Sphere In this modifier, particles will spawn(for position) or move towards (for velocity) points on the surface of an imaginary sphere. The size of the sphere is a random variable, ranging from different radii which can be adjusted. Put simply they can spawn anywhere within the 3D space as long as the distance between the spawn point and the Emitter is not smaller than the Min. Radius value, and no farther than the Max. Radius value

Range This one is similar to the sphere except instead of an imaginary sphere, it’s an imaginary cuboid. Particles can spawn anywhere within this imaginary cuboid. One advantage of this compared to the Sphere is that the “spawning/moving region” need not be centred around the Emitter.

Posted Image
In this example, the X-range Is from 100 to 100, while the Y and Z-ranges are both from -100 to 100. This means that the particles can be spawned anywhere on an imaginary 200 by 200 square located exactly 100 points away (in the positive x-direction) from the emitter

Spherical Range This one is similar to the sphere except instead of an imaginary sphere, it’s an imaginary hemisphere around the Emitter. The Min/Max angle adjusters will determine the range of possible angles at which the particle can spawn. A value of 0.00 means 90-degrees (I,e, vertical) and at the other extreme end, 1.00 represents horizontal.

Therefore if you set both the min and max angles to zero, the particles can only spawn directly above the Emitter, and if both values are set to 1, the particles can only be spawned on the horizontal X-Y plane (this can be used for things like smoke spreading on the ground). To get the full hemispherical spawning region, Min Angle must be 0, Max Angle must be 1

Posted Image
Both the red and green particles have a spherical range with min-radius 0, max-radius 100 (which is why they have the same radius). However the red one displays a perfect hemispherical spawn-range, while the green one has a purely horizontal spawn range by having both the min and max angles set to 1. On the right you can see what happens when the green particle has min-radius set to 50, this causes an empty region where no green particles can spawn.

Cylinder Similar to Sphere except in this case it’s an imaginary cylinder.

Torus Similar to Sphere except in this case it’s an imaginary torus, sort of like a “donut” shape.
Posted Image
Red particles spawned within random points in a torus, as well as green particles spawned withing random points in a cylinder.

At the bottom of the Shape Creator are some velocity adjusters which I have yet to try. However I’m quite sure the Velocity in Local Space toggle determines if the direction of the velocity uses the XYZ axes of the Local Space (i.e. the Emitter) or the World Space (the in-game environment). The 2 sets of axes only coincide if the Emitter is upright. Emitters can be tilted (eg. If attached to a moving object) but the axes for the world space is tilted.


SIZE PLUGIN
Adjusts the size. There are several different types (linear size, keyed size, etc) but the Keyed Size modifier is easily the most versatile. Basically what it does is create a line graph on the keyframe system. You can add points to the graph, and each point will represent the particle size at that exact point in time. This allows you to control the size of the particle at very specific points in the timeframe.

The size variation adjuster allows you to have fluctuations in the size of the particles spawned. It helps give particles a more irregular appearance, suitable for explosion blasts, etc.


PHYSICS PLUGINS
There are several of these, the most common ones are acceleration-based plugins which can be used to make a particle change its direction and velocity. Similar to the size plugins, there are linear and keyed acceleration, which both have toggles on whether or not to have the acceleration vector be with respect to the local space (the emitter’s xyz axes) or world space (the environment’s xyz axes). Once again, keyed acceleration is much more versatile  since you can edit the acceleration with respect to time via a keyframe graph.

The attractor physics plugin is noteworthy for being responsible for attractor particles. For example if you take a look at the peacebringer’s effects XML, you’ll notice its tractor beam has one particle that starts at the target and has XML tags to specify the particles to be attracted to the source (the tractor beam hardpoint turret). However that alone isn’t enough. The particle itself requires specifically to have an attractor plugin, which happens to be located here.


ROTATION PLUGIN
Used to rotate the textures. This is very good for smoke particles in order to stop a cloud of smoke particles from visibly having smoke puffs that all clearly look identical. There are adjusters in the various plugins to control the extent of rotation as well as how random the rotations are. As with previous plugins, there are linear and keyed versions.


COLOUR PLUGIN
One of the main plugins your particles will need is a colour plugin. For this case I’d definitely recommend using the keyed one over the linear one, since the keyed plugin allows you to have your particle change colour more than once, while the linear plugin only allows you to have one colour that changes into a second colour, that’s it.

One vital thing to note about editing colours: you will see a “transparency adjuster” but that one only applies for certain shaders, most notably ParticleBillboardHeat.fx and ParticleBillboardAlpha.fx. You can see which shader your particle is using by checking out the Renderer plugin (more on that below). Now the shader that isn’t affected by the “transparency adjuster” is ParticleBillboardAdditive.fx. It’s a fairly common shader used for particles that require a bright glowy look. For particles using such shaders, the transparency concept is quite simple, the darker the colour used, the more transparent it becomes.

Therefore when editing the colours of particles that use the ParticleBillboardAdditive.fx shader, don’t bother tweaking the transparency adjuster, it won’t have any effect.

Another interesting colour plugin is the colour variance plugin which allows you to have colour fluctuations in your particle.
Posted Image

In this pic, the particles are actually the same pure red as the ones seen above. However, the addition of a colour variance plugin with max red and green variance both set to 0.5, and max blue variance 1.0 causes a variety of hues to appear. The stronger the variance levels, the more multicoloured the particles will look.  There are even sliders to adjust the alpha (transparency) variance although I suspect it also won’t affect any particles using the ParticleBillboardAdditive.fx shader.


UV PLUGIN
Another important main plugin, this one determines which portion of the particle’s texture to use. The texture (just like the shader) is specified in the Renderer plugin. The UV Plugin will determine which part(s) of the texture shows up. Use the Constant UV plugin if all you need is one texture, or if multiples are needed, the Keyed or Slotted Random UV plugins can do the job.

You’ll notice in all UV Plugins there is a button called pick. This will open a window that looks like this:
Posted Image

Recall earlier the instructions to convert some of the textures in the …ART/TEXTURE/DDS folder into tga. This here is the reason why. The editor reads tga images, so if there isn’t a file there for it to read, you won’t get all those pictures up there, just pure black with grid lines.

As you can tell from the pic, the grid can be adjusted to give a nice selection (the yellow border). You can see in the pic that the yellow border is around the hierarchy logo portion of the texture. It’s the same texture used as part of the Emitter for Kamal’s abduct. You can also manually adjust the size of the selection box through changing the values in the width and height.


KILLER PLUGIN
A Killer plugin determines the lifespan of a single particle (not to be confused with the lifespan of particle spawning, which is controlled by the Stop Time adjuster in the Creator Plugin).

I haven’t really tried the different Killer Plugins, only used the default Age Killer and even then I never really messed with the toggles in there so I can’t elaborate on those. The Stomp Time is the main focus. It determines how long a particle lasts before disappearing. The longer the Stomp Time, the longer it exists.

The Stomp Time Variation is likewise similar to the Size Variance adjuster, by changing it, you can cause random fluctuations in the stomp time. The larger the variation, the stronger the fluctuation, and some particles like missile smoke trails can exploit this so that when the missile trail is shown in-game, the smoke doesn’t fade out in an abrupt termination, but rather over a gradual transition caused by particles that die out at different times due to the Stomp Time Variation.


TRANSLATOR PLUGIN
Pretty simple, no adjusters or features, just a choice between 2 types of plugins, World Space or Local Space. Spawned Particles in a Local Space will seem to disobey the laws of relativity, for example Local-Spaced rising smoke on a moving vehicle would always form a perfectly vertical smoke column over the vehicle regardless of how fast the vehicle moves.

For another example, consider the exhaust trail on the rear end of Figments. The trail extends out while the vehicle moves because it has a world space translater. If it were local space, the particles on the rear would not form a trail because they’d just remain clustered around the particle emitter, even if the vehicle moves.. Most particles use World Space translators because it’s more realistic


[size=3]RENDERER PLUGIN
Here’s where you choose the shader and texture for your particle. Obviously you can only have one at a time (just like the UV plugins). If you try to insert  multiple render plugins, only one will take precedence.

Depending on the renderer you choose, the texture and shader will be automatically changed regardless of whether you want to or not. There are a ton of renderer plugins to choose from, but the main ones are Billboard, Chain, XY-Aligned as well as Heat and Saturation. Bear in mind that every particle you see is actually a collection of several 2D images. A smoke cloud could be 7-8 smoke puff textures floating around for instance. The renderer plugin will determine exactly how these 2D images will appear in the environment.

Billboard: The textures are simply shown as individual “pieces,” always rotated to face the camera.

Heat and Saturation: Uses the special p_particle_heat_master.tga texture and ParticleBillboardHeat.fx shader by default. Also has sliders to adjust the amount of heat distortion. Do take note that the Distance Cutoff slider should be high, a low-amount would mean that as long as your camera is farther than that small distance, you won’t see any distortion. I have no idea what the Saturation Scale slider does, never seemed to have any effect.

Chain: The textures are linked together as a chain. There aren’t really many uses for this and personally I don’t really like PG’s chain particles. For instance look at the missile trails for military units or Mirabel, note that they look like coloured ribbons, yup that’s chain rendering at work. NOTE: if you set a Chain renderer, it automatically sets the texture as W_Clouds01.tga which is useless. Change the texture to one of the more suitable particle textures (the ones whose names start with “P_”). You need not browse the files, a simple copy+paste of the filename will do.

XY Aligned: Pretty simple, the textures instead of aligned to face the camera, are laid parallel to the X-Y Plane. Easiest example of this would be the Hierarchy Symbol in Kamal’s abduct.

Posted Image
[size=1]Comparison between billboard (red) X-Y aligned (blue) and chain (green). The chain particle was given a point velocity so that you can see the “ribbon” flying outwards. Also note that the blue particles, although laid horizontal, are NOT necessarily laid flat on the X-Y plane, some of the horizontal blue particles are "floating" around.

There are lots of other renderer plugins selectable  but most are obsolete or have limited uses.


[size="3"] TIME PLUGIN
Never really used it. There’s only one type of Time Plugin called Distance Key Time which I suspect influences a particle’s lifespan depending on how far away the particle is located from a different target.


Well that’s it for now. If you wish to start on your first particle model (i.e. Emitter), simply open the editor and hit “New Emitter” and be sure to choose Default Plugins. Your emitter will start with one particle with default stuff already in, meaning you just need to tweak the stuff already laid out for you. Note that the default colour plugin is a linear colour one. I’d recommend deleting it and replacing it with the more versatile Keyed Colour.

Edited by Valdez, 29 May 2009 - 12:26 AM.

Posted Image


#2 Mike.nl

Mike.nl

    Mad Computer Scientist

  • Global Moderator
  • 1,611 posts
  • Gamertag:RationalMike
  • Fav. Game:
  • Gender:Male
  • Location:The Netherlands

Posted 29 May 2009 - 02:32 AM

Wow, nice job :thumbup:

However, I'm not so sure about this:

View PostValdez, on May 28 2009, 08:21 PM, said:

The blue one is behind the red one because in the list, the blue one appears above the red one. This is the basic idea behind how the different layers are stacked.
As far as I know, the order of emitters doesn't matter. The game Z-sorts the emitters (not the indivdual particles) in camera-space anyway. Besides, between Additive shaders, the order doesn't matter, because the particle color is just added to the final color (that's why the inner particle is purple: blue + red). And addition is commutative :)
Million-to-one chances occur nine times out of ten!

#3 Valdez

Valdez

    (・ ω ・)

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 10,633 posts
  • Gamertag:GFWL Valdez
  • Fav. Game:
  • Gender:Male
  • Location:Singapore

Posted 29 May 2009 - 02:39 AM

View PostMike.nl, on May 29 2009, 03:32 PM, said:

Wow, nice job :thumbup:

However, I'm not so sure about this:

As far as I know, the order of emitters doesn't matter. The game Z-sorts the emitters (not the indivdual particles) in camera-space anyway. Besides, between Additive shaders, the order doesn't matter, because the particle color is just added to the final color (that's why the inner particle is purple: blue + red). And addition is commutative :)

I've tried adjusting the order of particles before and yeah it does affect what shows up on-screen.


Take one official Emitter Model:
http://img32.imagesh...picture1lur.jpg

Move the smoke particle from the top to the bottom of the list and you get
http://img132.images...5/picture2v.jpg

of course this could be due to the fact that the smoke doesn't use Additive Shader (it uses alpha shader) but thene again there are quite a few exception to the additive shader that I noticed, not affected by the alpha adjuster in colour editing, etc.


Anyway I think I should post a pic showing difference between using the additive shader and alpha shader:
Posted Image

Both particles are identical in every aspect except the left one uses ParticleBillboardAdditive.fx and the right one uses ParticleBillboardAlpha.fx.

The colour used for both particles is R:255,G:0,B:0 with an alpha value of 50.


Now observe what happens when the alpha value for both of them is mazed out to 255 using the colour picker:
Posted Image
The particle using the additive shader has no change, however the one using the alpha value is now completely opaque and no longer see-through.


This is how a particle using additive shader will become "more transparent" if you use a darker colour:
Posted Image
Both particles still have an alpha of 255, but only the one on the right (alpha shader) remains opaque.

Both of them use the colour R:100, G:0, B:0. the one using the additive shader becomes more transparent while the one using the alpha shader merely grows darker.

This is very important when you are dealing with "dark" particles like smoke. Based on the above info your common sense should tell you it's impossible to have a black particle using the additive shader, because black = colour value of 0 which for the additive case also means opacity value = 0. This is why smoke particles use alpha shader, not additive shader.

Edited by Valdez, 29 May 2009 - 03:16 AM.

Posted Image


#4 Mike.nl

Mike.nl

    Mad Computer Scientist

  • Global Moderator
  • 1,611 posts
  • Gamertag:RationalMike
  • Fav. Game:
  • Gender:Male
  • Location:The Netherlands

Posted 29 May 2009 - 03:11 AM

View PostValdez, on May 29 2009, 09:39 AM, said:

I've tried adjusting the order of particles before and yeah it does affect what shows up on-screen.
Okay, then my guess would be it affects the order of the emitters at the same location. If you were to move the smoke emitter to say, (-0.1,0,0), moving it to the bottom wouldn't make a difference, because the Z-sorting would make sure it was drawn before the rest at (0,0,0). As long as you're looking at it from the +X axis, of course :). The moment you turn around and look along the -X axis, the smoke will probably show up in front.

Just to be sure, could you test this?
Million-to-one chances occur nine times out of ten!

#5 Valdez

Valdez

    (・ ω ・)

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 10,633 posts
  • Gamertag:GFWL Valdez
  • Fav. Game:
  • Gender:Male
  • Location:Singapore

Posted 29 May 2009 - 03:30 AM

Well even if they're at different positions the order still seems to apply:

Posted Image

The red smoke is at (10,10,0) while the yellow smoke is at (0,0,0). However you can see something like a "glitch" where the yellow smoke, which rightfully should be seen behind (if you take into consideration the current camera perspective) the red smoke, is instead shown to be in front. Looks funny yeah but i guess that's how the particles are done in UAW billboard rendering.

Rightfully the rendering should be in a 3D space so that depending on where you're looking, either the yellow smoke is in front of the red smoke, or vice versa. However in this case purely due to the order in the list, the yellow smoke can never be obscured by the red smoke.

i suppose rule of thumb here is that for alpha shader particles, any particle in the list will always obscure any particle above it in the list, as well as being obscured by any particle below it in the list.

Edited by Valdez, 29 May 2009 - 03:37 AM.

Posted Image


#6 Mike.nl

Mike.nl

    Mad Computer Scientist

  • Global Moderator
  • 1,611 posts
  • Gamertag:RationalMike
  • Fav. Game:
  • Gender:Male
  • Location:The Netherlands

Posted 29 May 2009 - 04:11 AM

View PostValdez, on May 29 2009, 10:30 AM, said:

Well even if they're at different positions the order still seems to apply:
Oh wow that's odd. Then I guess we'll have to take it a level further -- they'll probably just Z-sort entire particle systems. i.e., if those yellow and red particles were from different particle systems, it would be rendered properly. You could try that with the map editor or in-game. Or maybe PG's AssetViewer.

Btw, you're doing exactly the kind of stuff I was doing with EaW/FoC to figure out how particles etc worked ^_^
Only I had to hexedit the binary particle files, and boot up the map editor to inspect for changes :unsure:
Million-to-one chances occur nine times out of ten!

#7 Kelathin

Kelathin

    Petro Leader

  • Community Supporter
  • PipPipPipPipPipPip
  • 7,174 posts
  • Gamertag:Kelathin
  • Fav. Game:
  • Gender:Male

Posted 29 May 2009 - 10:55 AM

View PostMike.nl, on May 29 2009, 05:11 AM, said:

Btw, you're doing exactly the kind of stuff I was doing with EaW/FoC to figure out how particles etc worked ^_^
Only I had to hexedit the binary particle files, and boot up the map editor to inspect for changes :unsure:
Good old days ^_^

Does he need separate particle systems, what would happen with separate emitters?
Posted Image
Personal opinions are supported by personal beliefs alone. Did you know my duck avatar makes me eviler than you?
Posted Image

#8 Mike.nl

Mike.nl

    Mad Computer Scientist

  • Global Moderator
  • 1,611 posts
  • Gamertag:RationalMike
  • Fav. Game:
  • Gender:Male
  • Location:The Netherlands

Posted 29 May 2009 - 11:33 AM

View PostKelathin, on May 29 2009, 05:55 PM, said:

Does he need separate particle systems, what would happen with separate emitters?
Yes he does. Seperate emitters is what he has now.
Million-to-one chances occur nine times out of ten!

#9 Valdez

Valdez

    (・ ω ・)

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 10,633 posts
  • Gamertag:GFWL Valdez
  • Fav. Game:
  • Gender:Male
  • Location:Singapore

Posted 29 May 2009 - 11:36 AM

That pic with the red and yellow smoke is one Emitter with 2 Particles. Every alo particle model opened in the particle editor is an Emitter with one or more particles. This is based on particle editor terminology though. I'm not sure if it's correct. Sometimes I suspect it isn't and should be the other way round.

Posted Image


#10 Mike.nl

Mike.nl

    Mad Computer Scientist

  • Global Moderator
  • 1,611 posts
  • Gamertag:RationalMike
  • Fav. Game:
  • Gender:Male
  • Location:The Netherlands

Posted 29 May 2009 - 11:39 AM

View PostValdez, on May 29 2009, 06:36 PM, said:

That pic with the red and yellow smoke is one Emitter with 2 Particles. Every alo particle model opened in the particle editor is an Emitter with one or more particles. This is based on particle editor terminology though. I'm not sure if it's correct. Sometimes I suspect it isn't and should be the other way round.
Exactly, you have one particle system, with two emitters. I don't know why PG named this differently, but I don't follow their naming scheme ^_^.
Million-to-one chances occur nine times out of ten!

#11 Valdez

Valdez

    (・ ω ・)

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 10,633 posts
  • Gamertag:GFWL Valdez
  • Fav. Game:
  • Gender:Male
  • Location:Singapore

Posted 29 May 2009 - 11:48 AM

View PostMike.nl, on May 30 2009, 12:39 AM, said:

Exactly, you have one particle system, with two emitters. I don't know why PG named this differently, but I don't follow their naming scheme ^_^.

Well the terminology issue only seems to apply to the particle editor anyway. In the XMLs it's properly called ParticleSystem not EmitterSystem.

Posted Image


#12 Valdez

Valdez

    (・ ω ・)

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 10,633 posts
  • Gamertag:GFWL Valdez
  • Fav. Game:
  • Gender:Male
  • Location:Singapore

Posted 10 June 2009 - 02:22 AM

Specific Guide on Attractor particles

Attractor Particles, when spawned, are designed to attract from the point where they are spawned to a target location.


Posted Image
The yellow circle shows my particle model's position. It is moving in a circle around the Center Point (where the 3 axes intersect). The particle has 2 emitters, one venting orange another green. The green one is attracted to target.

Where is "target"? Well you can simulate a target's position by inputting values. Look at the Simualtion window (the one with the play/pause buttons). Above the button that says "reset Dynamic Settings" There are 3 boxes where you can input the coordinates of where you wanna see the particles attracted to. Note this is a simulation and won't really make the particles move exactly like that. It's just to show you how the particle will look like in-game when being attracted to somewhere.

Now here's the difficult part. I myself am not sure hwo to tweak the attractor plugin. I have my guesses but nothing certain because I copy+pasted the plugin from the PB's tractor beam target particle. These are the exact values I used:

Posted Image

Pay attention to the value for Constant Attraction. A negative value will attract the particle to the target. A positive value makes it go in the REVERSE direction. So if you want attract, use negative value. be sure to set target position to Target.

As for the difference between the constand and linear attraction. I honestly dunno.
Posted Image
Green = linear, red = constant. You can decide for yourself.

Do be careful. The attractor plugin might clash with other physics plugins like acceleration which could cause the particle to travel somewhere you do NOT want it to go.

Next step you NEED to specify the particle Killer to "Target". By default, Particles have the "Age" killer meaning a particle only disappears after its Stomp Time lifespan is up. This is what happens

Posted Image

Now you wouldn't want that so you need to set Killer to "Target"

Posted Image
Be sure to specify the target position as "target". if you set it to "Emitter", the particles will spawn at the emitter... and attract to the emitter... and since they would be programmed to disappear when they're a certain distance from where they're attracting to... they would disappear instantly. i.e. you do not see any particles AT ALL.

Also be careful not to set the Stomp Time too low (like 1 second). It may cause the particle to vanish before it even reaches its destination.

With that done, your particle is ready. Now comes the XML stuff. You've seen how some Effects have particle system effect components. Here's one used by the constructor

      <Effect_Component Type="ParticleSystem">
         <Particle_System_Type>NI_Naniteswarm_build_Source</Particle_System_Type>

         <Position_Type>AtSource</Position_Type>
         <Attachment_Bone_Name>MuzzleA_00</Attachment_Bone_Name>

         <Attractor_Type>AtTarget</Attractor_Type>
         <Attractor_Bone_Name>Lightning_emitter_B_00</Attractor_Bone_Name>

      </Effect_Component>


Note the position type and the attractor type. Specify those carefully so that the origin and destination of the particles are correct.

Edited by Valdez, 10 June 2009 - 03:26 AM.

Posted Image


#13 Mike.nl

Mike.nl

    Mad Computer Scientist

  • Global Moderator
  • 1,611 posts
  • Gamertag:RationalMike
  • Fav. Game:
  • Gender:Male
  • Location:The Netherlands

Posted 10 June 2009 - 10:29 AM

View PostValdez, on Jun 10 2009, 09:22 AM, said:

As for the difference between the constand and linear attraction. I honestly dunno.
I believe linear attraction means that the attraction is somehow multiplied with the distance to the target. It basically boils down to:

attraction = constant_attraction + linear_attractation * distance

Maybe with contants or sign flips here or there. Inv. linear is probably a "distance/linear_attraction" component added as well.
Million-to-one chances occur nine times out of ten!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users