Weather particle systems define the appearance, density, and physical behaviour of weather like rain and snow.
Usage
To use weather in your level, you must create weather palette entries in Sapien referencing a weather particle system and optionally wind. You then assign these entries to BSP clusters within the level, allowing different areas to have different weather. Areas under overhangs and roofs which should not have weather can be masked with weather polyhedra, added while modeling the level.
Simulation
Each weather particle type get simulated in a cube the size of its fade out end distance, originating at the world's 0,0,0 origin point. It can be visualized by enabling debug_point_physics. Particles wrap around when they reach the edge, making the simulation tileable. All other weather particles in the level are simply a trick of rendering.
Individual particles are simulated according to their point_
Limits
The game can simulate up to 512 weather particles. There is therefore a tradeoff between particle count and view distance: if your view distance is large, a high density is not possible because the budget of 512 particles must be spread out in an exponentially larger simulation cube. Here's a table summarizing the maximum densities for various fade out end distances:
| Fade out distance (wu) | Max achievable density (particles/cubic wu) |
|---|---|
| 0.5 | 4096 |
| 1 | 512 |
| 2 | 64 |
| 4 | 8 |
| 8 | 1 |
Setting the particle count higher than these values will not achieve a higher density. When a weather particle system has multiple particle types, the first type gets first "dibs" on the particle budget. If it uses up all the budget then the following types' particles will not be present.
If you require a high density of particles, simply include multiple particles spaced out within the sprite texture and set the random rotation flag. The stock snow sprite does this and it's fairly convincing. If you need to increase the particle radius to accomodate this, don't forget to adjust density accordingly.
Particle acceleration
Use the acceleration parameters to give weather particles their own acceleration, independent of any external forces. Particles have an individual acceleration vector which can change direction over time, and the amount of acceleration can vary too. This is used to simulate particles that move on their own like flying insects.
Particles with similar acceleration parameters to c10's beetles. There is no wind in this scenario.
Added motion
The game adds fixed motion to weather particles each rendered frame, unrelated to wind (global or local variation) or acceleration. Added motion is not "true motion" for the purposes of particle orientation, so you may see velocity-oriented particles unaligned with their apparent direction of movement.
The direction is "random" and unique to each particle, unchanging after creation. However, the algorithm the game is using for this introduces some likely unintended bias in the direction. The first 128 particles created have a general +x -y +z direction, similar to the bias in wind local variation. At 256 particles, some particles now move in the -x direction too. At the limit of 512, there is a good distribution of horizontal directions but the particles still move upwards on average. The bias is noticeable at high framerates, but not at 30 FPS. When you open the console in Standalone, which pauses the simulation, this added motion is apparent.
128 weather particles showing a bias in added motion, at 1000 FPS.
Speculating, this motion may have been added as a cheap way to avoid noticeable patterns like the same rain drop falling in the same place, since the simulation "wraps around".
Known issues
- When the player is within a dense fog with a nearby opaque distance, weather particles will stop drawing even if set for the cluster containing fog. Ensure the opaque distance is sufficiently far away if weather particles in fog are desired.
- Some features of this tag are framerate-dependent. See tag fields.
- The added motion bias, described earlier.
- Changing acceleration eventually gets stuck at 0 if 0 is the minmum bound.
Related HaloScript
Function/global | Type | |
|---|---|---|
Renders green or red markers wherever point_ Red markers indicate point_ It can help to enable | Global | |
Renders 2D sprite effects like particles and weather_ | Global | |
Toggles the rendering of particle_ | Global | |
Toggles the rendering of all weather_ | Global |
Structure and fields
| Field | Type | Comments | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| flags | bitfield | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| particle types | Block | A list of particle types that are present in this weather system. As an example, the c10 swamp weather uses one type for rain and two types for flying insects. Note that the first particle type may use up the 512 weather particle budget if it's too dense, and other types will not render. Particle types with identical fields will not spawn at the same locations, so this cannot be used to combine sprites in different orientations. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Acknowledgements
Thanks to the following individuals for their research or contributions to this topic:
- Conscars (Testing and documenting tag features)
- Kavawuvi (Invader tag definitions)
- MosesOfEgypt (Tag structure research)