HeatSystem¶
HeatSystem
| Phase · priority | Environment · 20 (before FireSystem) |
| Reads | temperature on ThermalBody nodes; ambient_temperature |
| Writes | temperature |
| Settings | EquilibrationPerHour 0.17 (≈ 0.02 per tick at the default clock) |
| Status | designed · Phase 1 (#34) |
| PLAN | §11.5, §3.9 |
| Player | Fire and heat |
Thermal equilibration: every ThermalBody node is nudged toward the ambient temperature each tick. FireSystem drives temperature up; HeatSystem brings it back down, so burned rooms cool and the world cannot accumulate infinite heat.
var ambient = view.GetOrDefault(world, "ambient_temperature", 20f);
foreach (var node in view.NodesWithComponent("ThermalBody"))
{
var temp = view.GetOrDefault(node, "temperature", ambient);
var delta = (ambient - temp) * s.EquilibrationPerHour / ctx.Hours(1);
if (Math.Abs(delta) > 0.01f) yield return new DeltaAttributeIntent(node, "temperature", delta);
}
Deltas sum with FireSystem's propagation in the same batch: a room receiving +64 from a fire next door and −0.9 toward ambient nets +63.1. After a fire goes out a building decays about 17 % per hour and is near ambient in about 18 hours. ThermalBody is on all location nodes by default; items and creatures do not have body temperature in Phase 1.
Hot-toggle: off, nothing cools — a burned building stays hot forever until it is turned back on. Trace: deltas with no Inputs; WhyChanged(inn, temperature, g) answers "HeatSystem cooled it toward ambient".
The worked example in PLAN §3.9 ("the inn has been above 40° for three hours") would live here as a since-timestamp heat.hot_since.
History¶
| Phase | Change |
|---|---|
| 1 | Introduced; rate per hour instead of per tick. |
See also: FireSystem · DayNightSystem