Essentials Series/Particles

Revision as of 23:12, 29 April 2020 by Battlepedia>Igorseabra4 (→‎PARE)
Essentials Series
  1. Introduction
  2. Industrial Park basics
  3. Editing Assets
  4. Templates
  5. Links
  6. Dispatchers
  7. Tikis and Enemies

This page is part of the Essential Series modding tutorials. Particles are visual effects, such as smoke, fire or sparkles. They can have various kinds of behavior and spawn from multiple places. A lot is not yet known about particles, but enough is for us to be able to make custom ones.

Particles are controlled by multiple assets and there are no templates for them, so if you want to make custom particles, you must copy existing particle assets which are already similar enough to how you want yours to behave. You do not need to edit values if you do not understand what they mean, but understanding them can help you make your particles look more like you want them to.

Particle Assets

When using particles, you need to deal with three asset types.

  • PARE, which controls where particles will be emitted, is the simplest to deal with.
  • PARP, which controls how particles change during their lifetime (size, color, movement) is the most complex of the 3.
  • PARS, which controls the rendering data for a particle (including the texture), is the one we don't know much how to change yet, as it contains a constructor function for the particle in its data which is best left alone for now (I would recommend changing only the particle texture and the render modes if you understand what they mean).

PARE

This stands for Particle Emitter. They contain a reference to the PARP they will use, so be sure to update that if you renamed your assets. They contain data which tells where particles will show up, such as from a fixed point or from a specific entity asset.

By setting the Emitter Type to one of the possible shapes, you can choose if the particles emit from a point, sphere, box or line shaped region, for example. This region will be placed in the center of the emitter position. The PareSpecific region contains the information about this region, which you can change.

If you want, you can set the Emitter_AssetID property to 0 and set the XYZ values of the emitter position directly in the PARE asset.

To use marker assets as emitters, place as many markers as you want using the template. Place a Group template as well and put all the markers in the group. Put the Group's assset ID in the Emitter_AssetID field of the PARE. The particles will be emitted from all the markers.

Another option is to use an entity asset. Set the EmitterType to Entity Bound and the asset ID of the entity in the Emitter_AssetID field of the PARE. The particles will be emitted from the entity's position at the time of emission.

Use events to control particle emission.

PARP

This stands for Particle Prop. They contain a reference to the PARS they will use, so be sure to update that if you renamed your assets. They contain general information which tells how particles are created: their size, color, lifetime, how they move. A PARP asset contains a section of 14 different structs. Each of them controls the value of one aspect of the particle, and each of them have internal controllers to decide the value. These are the fields that each of the 14 structs have:

  • Interpolation Value 0/A: this is the minimum interpolation value for the struct.
  • Interpolation Value 1/B: this is the maximum interpolation value for the struct.
  • Frequency (Random, Linear and Step): this is the frequency in which the values for the Random, Linear and Step functions will be updated.
  • Frequency (Sin and Cos): this is the frequency in which the values for the Sine and Cosine functions will be updated.
  • Interpolation Mode: this defines which function will be used to choose an interpolation value for this struct. The value chosen for each particle is a function of the particle prop's elapsed time and will always be between values 0/A and 1/B. These are the possible functions:
    • ConstA: always value 0/A.
    • ConstB: always value 1/B.
    • Random: a new random value between 0/A and 1/B is chosen. The rate is defined by the frequency (above).
    • Linear: a new value between 0/A and 1/B is chosen using linear interpolation.
    • Sine: a new value between 0/A and 1/B is chosen using sine interpolation.
    • Cosine: a new value between 0/A and 1/B is chosen using cosine interpolation.
    • Time: a new value is chosen using the time of the interpolation directly.
    • Step: the start value until time*freq >= 0.5, then the end value.

These are the 14 structs for which the fields above apply:

  • 0 - Rate: how many times per second a particle is emitted.
  • 1 - Life: particle lifetime in seconds.
  • 2 - Birth Size: particle birth size in units.
  • 3 - Death Size: particle death size in units.
  • 4 - Start Color (R): red component of the particle birth color (0 to 255).
  • 5 - Start Color (G): green component of the particle birth color (0 to 255).
  • 6 - Start Color (B): blue component of the particle birth color (0 to 255).
  • 7 - Start Color (A): alpha component of the particle birth color (0 to 255).
  • 8 - End Color (R): red component of the particle death color (0 to 255).
  • 9 - End Color (G): green component of the particle death color (0 to 255).
  • 10 - End Color (B): blue component of the particle death color (0 to 255).
  • 11 - End Color (A): alpha component of the particle death color (0 to 255).
  • 12 - Unknown/Unused
  • 13 - Unknown/Unused

PARS

This stands for Particle System. In the PARS asset editor, you can set the texture the particle will use, the pipeline rendering options for the particle, and the maximum amount of this particle that will be visible at once (although this sometimes seems to be ignored).

Events

  • On: send this event to the PARE to begin particle emission.
  • Off: send this event to the PARE to stop particle emission.