This is a p5.js sketch to explore forest fires (aka wildfires), their propagation and suppression.
Fires have intensity (yellow to red) and spread to surrounding green (fuel) areas, and can fully exhaust the fuel (black, charred areas) and users can create fire breaks (remove green fuel) to control the spread.
You can click the
Randomize button until you find a map you find interesting; or run one of the existing scenarios.
If you’re using a Random map, you can press
L or click the Lightning tool to start a fire, and then use the Fire Break or Knock Down techniques to suppress the fire.
l- Triggers Lightning, igniting one of the green (foliage) cells.
p- Saves a screenshot of the sketch to your Downloads folder.
P- Saves a screenshot of map (which can be re-uploaded)
O- Opens up the Terrain loading dialog; can drag & drop an image previously saved.
[- Slows down time.
]- Speeds up time.
\- Toggles pause of the system.
ESC- Closes an open dialog.
This sketch has a concept of ‘tools’ or cursor modes, which alter the behavior of clicking within the sketch.
L- Triggers Lightning beneath the mouse cursor
f- Turns a FOLIAGE (green) cell into a SOIL (brown) cell, preventing fire from propagating to it.
k- ‘Knocks-down’ the fire where clicked.
[0-7]- Enters into a draw mode; where the number sets the terrain to effectively paint onto the map.
0- Soil, won’t catch fire.
1- Water, won’t catch fire.
2- Foliage, susceptible to catching fire.
3- Burning, denotes a low-moderate burn of foliage.
4- Engulfed, denotes a high-intensity burn of foliage.
5- Smoldering, the fire is out, but there is still a risk of spreading.
6- Burnt, the fire is out, and there is no remaining fuel.
7- Partial Burn, the fire is out, and but there is remaining fuel.
seed- Using the same seed and reloading the page will result in the same terrain. (Example)
cellWidth- Controls how big each cell is. (Default is 20px). (Example)
scenario- (Values 0-2) loads the corresponding scenario; currently there are 3. (Example)
lightning_at- Controls initial lightning strikes. Format:
ycoordinates are pixel coords with top-left of the map being