Create a DarkPlaces particle effect with effectinfo.txt
Source: https://github.com/DarkPlacesEngine/DarkPlaces/blob/master/cl_particles.cDarkPlaces can define particle effects in effectinfo.txt. Each effect line starts an emitter; the lines below it describe the particles that emitter produces. In this tutorial you will replace a gunshot impact with a broad burst of amber sparks and a textured puff of smoke. You can test the effect without compiling QuakeC.
1. Set up a small mod directory
You need DarkPlaces and a working Quake installation with its id1 game data. Create a directory beside id1, and put a plain-text file named effectinfo.txt at its root:
Launch DarkPlaces with -game particlelab. The file may also live at the root of a PK3 inside particlelab, but a loose file is easier to edit while learning. Save it as text, not as effectinfo.txt.txt.
2. Add a spark emitter and a smoke emitter
Paste the following into particlelab/effectinfo.txt. The two blocks share the name TE_GUNSHOT, so DarkPlaces runs both when that effect is triggered. Lines beginning with // are comments.
The first block uses the engine's spark type, which is stretched along its motion and uses additive blending. The second uses smoke textures and explicitly selects alpha blending for a quieter cloud. tex 0 8 selects one of the built-in smoke cells numbered 0 through 7: the upper bound is exclusive. The larger smoke size and wider spark velocity give the impact a stronger silhouette.
3. Test and reload it in game
Load a map and fire the shotgun into a nearby wall. The impact should show warm streaks and a little gray smoke. To change the effect without restarting, edit and save effectinfo.txt, open the DarkPlaces console, and run:
Fire again to compare. You can also run which effectinfo.txt to see which file DarkPlaces reads. This matters if another game directory or PK3 supplies a copy.
Make the preview richer with a custom atlas
The cover image is an actual FTEQW screenshot from a test map with textured stone and warm lighting. Its larger, three-layer variant uses a custom particles/particlefont.tga adapted from the Libre-life project: cell 63 for spark heads, cells 48–55 for smoke, and cell 47 for a brief star-shaped core. That atlas is optional; the two-block example above uses stock textures and is the one to start with.
Download the compact particle atlas (ZIP, 69 KB). Extract it into your mod directory so the file is at particles/particlefont.tga. The archive includes its GPL-3.0 license. It replaces the particle atlas for the whole mod, so review your other particle effects before shipping it.
To build a similar variant in your own mod, provide an 8×8 particle atlas with the artwork in those cells, then change the spark block to tex 63 64 and the smoke block to tex 48 56. Add this third block for a short central flash:
Keep this layer short and faint: a large additive flash can wash out the sparks. The preview map also places the camera close to the impact. Distance and lighting change how large the same particle sizes look on screen.
Using the file in FTEQW
FTEQW has its own native particle format in particles/*.cfg. It can also import DarkPlaces effectinfo.txt through a compatibility path. With the same particlelab mod active, start FTEQW and enter this in its console before testing the shotgun impact:
Load a map and fire into a wall. FTE's importer is a compatibility feature, so compare the behavior rather than expecting an identical image in both engines. The DarkPlaces reload command above is specific to DarkPlaces; this FTE step selects the particle description to load.
For a mod-defined effect with a new name, FTE also recognizes the effectinfo. namespace. For example, an effect myimpact block can be requested from QuakeC as particleeffectnum("effectinfo.myimpact"). Precache custom effects during game initialization so clients know their names before the first event. The TE_GUNSHOT exercise needs no QuakeC because it replaces an existing effect name. If you later need FTE-only controls, use its native particle script format.
What the numbers control
| Setting | Meaning in this example |
|---|---|
| countabsolute | Fixed particles per call, independent of cl_particles_quality. Use count if you want the engine's requested count and quality multiplier involved. |
| color | Two hexadecimal RGB colors; each particle gets a color from that range. |
| size and sizeincrease | Starting size range in game units, then change in size per second. |
| alpha | Minimum opacity, maximum opacity, then fade per second. Opacity uses 0–256, where 256 is fully opaque. |
| time | Minimum and maximum lifetime in seconds. A particle also disappears when its alpha reaches zero. |
| velocityjitter and velocityoffset | Random motion on each axis, plus a fixed addition. The smoke's positive Z offset sends it upward. |
Try changing just one value at a time. For example, double the spark velocityjitter to widen the burst, or lower the smoke's alpha fade from 260 to 180 to keep it visible longer. Reload, fire once, and compare.
Common problems and next steps
- Nothing changes: confirm -game particlelab, run which effectinfo.txt, and check the console for a line-numbered parse error. Keep one setting per line with the exact number of values shown.
- Particles are hidden: check cl_particles 1, cl_particles_quake 0, and the type switches cl_particles_sparks 1 and cl_particles_smoke 1.
- The impact looks different from stock Quake: defining TE_GUNSHOT replaces DarkPlaces' built-in fallback for that effect, including its default particle mix. Remove or rename this definition to restore the fallback after reloading.
- You need an effect only your mod can call: give it a unique name, then trigger that name from QuakeC with particleeffectnum and the particle-effect builtins. A name in the file alone does not make the engine emit it.
For one map only, DarkPlaces also loads maps/<mapname>_effectinfo.txt after the global file. Use the map name without the .bsp extension. Keep broad effects in the global file and map-specific changes in the map file.
Sources
This hands-on example was developed from the archived Blood Wiki effectinfo reference and checked against the current official DarkPlaces particle source and engine documentation. The FTE notes were checked against the supplied Quake technical knowledge base and FTE's extension definitions and particle script specification. Compatibility is not a guarantee of identical rendering.
Tags: DarkPlaces, FTEQW, effectinfo, particles, Quake modding
Comments