Playing with Fire! :flamethrower:
Setting things on fire and watch them burn. A fun and relaxing pastime with endless utilities for a sandbox game, just watch some GTA blooper videos
. A game doesn't need much to have spreading but controlled fires.
The most important thing would be a dynamic temperature value for each object. This value's default can be lower or higher based on the ambient temperature of a cell or zone.
Another value is the ignition point of an object. This can be modified for each object, but the default value can simply be based on the material. The ignition point can also change when the object is dried or wet.
A fire source burns with a fixed temperature that decreases over time. As long as this fire source touches another object, it raises this objects temperature to a bit below it's own temperature, hotter sources raise temperature faster and can spread their heat over a distance. If the temperature rises above the ignition point, the object catches on fire. The fire will die down again if the temperature decreases back below the ignition point. Without a fire, the object's temperature rapidly decreases back to ambient temperature. A fire's temperature cannot rise higher than what ignited it, preventing endless spreading.
Objects can have a quality or health value, that decreases as they burn. Burnt objects may turn into ash, or be replaced with a charred object. Some objects like torches can have a "fuel" tag or value, that prevents it's temperature from decreasing if it burns (or making it decrease slower), until it is extinguished or completely consumed.
Different parts of objects, like torches, can have different ignition values, to restrict the fire to a certain part of it. Clothing can be divided into different parts, so you can have just a sleeve catching on fire, and the fire slowly spreading to other parts.
Burning vegetation is a bit more complex, as tracking the stats of every straw of grass could damage performance, but the game could divide grassy areas into smaller segments with individual values. And not all kinds of wood have the same values, igniting a full grown tree is harder than burning a shrub, same with wooden supports compared to firewood. Even flesh is hard to ignite.
The temperature value can also be used for freezing or thawing objects.