Particle effects
Hover over the keys of a particle effect to see what they do, and get warnings where the game would not do what you wrote.
Particle effects are the smoke, sparks and flashes of units and buildings: the
particle = { … } blocks of .asset files, such as the base game’s
gfx/particles/artillery_cannon.asset. Etch explains their keys when you hover over them. It also
warns you about mistakes that the game does not report, or reports only in its error log.
The parts of an effect
Section titled “The parts of an effect”subsystem: an emitter. It sends out particles, small pictures that face the camera. An effect can have several: the base game’sartillery_cannonhas smoke, sparks, a flash and fire.texture, inside a subsystem: the picture (file) and how it blends with what is behind it (shader).animation: a curve with a name. It makes a value change over time, for example over the life of a particle. A key uses it by writing its name after the number and a comma:alpha = { 75,smoke_fade }fades the particles out.force: a force with a name, such as gravity or drag. A subsystem lists the forces that act on its particles:force = drag,gravity.
Hover over a key
Section titled “Hover over a key”- Open an
.assetfile with aparticle = { … }block. - Hold the mouse over a key, such as
lifein asubsystem.
A box shows what the key takes and what it does. Over other words you see:
- A curve name in a value, such as
size_increaseinsize = { 1.75,size_increase 0.4 }: the box shows thatanimationblock, with the points of its curve. - A force name, such as
draginforce = drag,upforce: the box shows thatforceblock.
In a .gfx file, the keys of a pdxparticle = { … } get the same boxes.
The game does not document these keys. Etch knows which keys the game reads, and the values some of them take. For many keys, what they do is Etch’s reading of their names and of how the base game uses them. The box then ends with “It is not checked in the game.”
Warnings
Section titled “Warnings”Open an .asset file from a gfx folder. A wavy underline marks each case below. The same
warning shows in VS Code’s Problems panel (Ctrl+Shift+M), with “Etch” next to it.
-
A key the game does not read, such as
lifee. The game does not use it. The warning names the key you probably meant, herelife. -
A curve or force name with no
animationorforceblock of that name in the sameparticleblock, such assize_increse. The game leaves the curve or force out. It writes one line about it in its error log, among many others, so it is easy to miss. The warning names the curve or force you probably meant, heresize_increase. -
A curve’s
timethat the game reads asspawn. The game knows onlylife,life_abs,systemandspawn, in lowercase. The base game’s files have a comment# Life, buttime = "Life"counts asspawn. Then the curve does not follow the life of each particle: by Etch’s reading,spawnis the effect’s time when the particle was born. -
A curve’s
durationof 0 or less. The game uses 1 instead. -
A word the game does not know in a force’s
type, a subsystem’ssortoremitter_type, or a curve’sop, such astype = "gravity". The game knows these words, in any case:Key Words Without one the game knows typeplanar,point,vortex,friction,turbulence,spinplanarsortdepth,distance,agenot sorted emitter_typepoint,sphere,boxpointopmul,add,absaddIt skips any other word. The block then keeps the word written before it, or gets the value in the last column, and Etch’s preview plays it the same way. A curve without
opadds to the value: writeop = "MUL"to scale it, as the base game does. -
A key the game does not take in a
positionorcolorblock, such aszz. The game takesx,y,zandw, orr,g,bandalpha(ora), in any case and in both blocks:ris the same asx, andathe same asalphaandw. When a block has a key twice, the last one wins. The game skips any other key and writesUnexpected tokenin its error log. Apositionhas no fourth value: the game reads itswand drops it, without a line in its error log. The game also swaps aposition’sxandz:xmoves the emitter along the z axis, andzalong the x axis. The preview does the same. -
A
positionwithout keys, such asposition = { 0 1 0 }. The game reads a subsystem’spositiononly by its keys. It writesUnexpected tokenin its error log for the first value, then reads the rest of the particle wrongly and loads none of it, so the effect shows nothing. Writeposition = { x = 0 y = 1 z = 0 }. A force’spositionis different: it takes three values without keys. -
A key of the other emitter shape:
box_emitter_xwithemitter_type = sphere, orsphere_emitter_radiuswithemitter_type = box. The game stores the two shapes’ keys in the same three places, so such a key still sets a value of the shape you have:Sphere Box sphere_emitter_radiusbox_emitter_xsphere_emitter_yawbox_emitter_ysphere_emitter_pitchbox_emitter_zWith
emitter_type = sphere,box_emitter_x = 30is a radius of 30. When a subsystem has both keys of a row, the last one wins. The preview reads them the same way. -
A shader effect the game does not have. The texture’s
shadermust name an effect ofgfx/FX/particle.shader. Withtrail = yesorbillboard = no, the game addsTrailorNoBillboardto that name. The base game’s file has no effect with either ending. So such a subsystem needs agfx/FX/particle.shaderin your mod with that effect, such asParticleAlphaBlendTrail. Without one, the game draws a trail as a flat grey band, and not at all while the effect’s other parts have particles on screen, unless a trail with its own effect comes before it: then it is drawn with that effect (see Entities). -
local_space = yesthat the shader does not place. The game passes the effect’s place togfx/FX/particle.shaderinInstanceWorldMatrix. The base game’s file does not use it. So the game draws these particles at their own coordinates on the map: around its south-west corner, and not at the effect. The subsystem’spositionmoves them there, itsxtowards the north and itsztowards the east. Leavelocal_spaceout, or ship aparticle.shaderin your mod whose vertex shader multiplies the position byInstanceWorldMatrix. -
A texture that is missing: your playset (the game, your mod and the mods it depends on) has no file at the texture’s
file.
When the game writes a line to its error log for a case, the warning quotes it.
The warnings update as you type. For shader effects, local_space and textures, Etch looks at the files saved on
disk. After you add one, save its file, and the warnings update.
An entity’s event names the particle that it starts. Those names have warnings of their own:
see Warnings in the files on the Entities page.
What it doesn’t do
Section titled “What it doesn’t do”- Opening an
.assetfile does not show its effects. To see one, open the entity preview of an entity whose state starts it (see Entities). - What many keys do is Etch’s reading, not checked in the game. Etch does not know how a value’s
variation (the second number in
{ 1.75 0.4 }) and its curves add up. - The warnings about shader effects,
local_spaceand textures need the game folder: without it, Etch gives only the others. - It does not change your files.