Temperature Query #001 2026-03-19 Namespace: Verse

Room Temperature Equalization System

"How does the room temperature equalization system work internally?"

Answer confidence:
75% — Architecture complete, formulas partial

Overview

Every 120 ticks (~2 seconds game time), Verse/MapTemperature.cs calculates the temperature for every room on the map. The actual computation is delegated to Verse/RoomTempTracker.cs, which adds up 4 equalization sources per room.

Core Principle
Temperature always flows from hot to cold. The rate depends on the source (wall, roof, open) and is logarithmically dampened by TempDiffAdjusted at extreme differences.

Flow Per Tick

MapTemperatureTick() foreach Room RoomTempTracker.EqualizeTemperature() Add 4 sources Room.Temperature +=

On room rebuild, equalizeCells are collected and Shuffle() is called:

MP-Critical
equalizeCells.Shuffle() consumes Rand calls. If rooms rebuild at different times on different clients → different Rand sequence → Desync.

Verse/RoomTempTracker.cs:174

The 4 Equalization Sources

1. Wall Equalization Constant

Heat flows through walls to neighboring rooms. Per wall cell with a neighbor room.

Rate: 0.00017f per wall cell per interval

Note: Identical for ALL wall materials — wood insulates like granite!

Verse/RoomTempTracker.cs:215-252

2. Thin Roof Equalization

Slow equalization with outdoor temperature through thin roof.

Rate: Very slow — significantly less than NoRoof

3. No Roof / Open 14× Door

Open cells without roof. Near-instant equalization with outdoor temperature.

Rate: 14× door rate

4. Deep Underground

Mountain roof pulls temperature towards 15°C. Only acts as cooling.

Target temperature: 15°C

Outdoor Threshold

Binary Threshold
A room uses UsesOutdoorTemperature when:
≥25% of cells have no roof, OR
• Room TouchesMapEdge

24% open = indoor with equalization. 25% = full outdoor temperature. No transition.

Key Constants

ConstantValueMeaning
MinTemperature-273.15°CAbsolute zero
MaxTemperature1000°CTemperature cap
Vent_TempEqualizeRate14×Vent building vs. door
DeepUndergroundTemperature15°CMountain target temperature
RoomEqualizeInterval120 Ticks~2 seconds
WallEqualizeFactor0.00017fPer wall cell, all materials equal
DoorOpenTicks34Door stays open after passing

Verse/TemperatureTuning.cs

PushHeat & ControlTemp

Buildings (heater, cooler, fire) affect temperature through two APIs:

MethodPurpose
GenTemperature.PushHeat(cell, map, energy) Adds heat energy to a room (fire, explosions)
GenTemperature.ControlTemperatureInRoom(cell, targetTemp, energyLimit) Heater/cooler steer towards target temperature

Verse/GenTemperature.cs

Modding Hint
ComfortableTemperatureRange = pawn stat ± 10°C buffer. Outside this range → Hypothermia/Heatstroke hediffs via SafeTemperatureRange.

Also Affects

If you modify the temperature system, these systems are directly impacted:

Health & Damage — Temperature Hediffs Temperature outside SafeRange → Hypothermia / Heatstroke hediffs automatically
→ Read more
Region System — Danger Detection Region.DangerFor(Pawn) checks room temperature — pawns avoid dangerous rooms
→ Read more
Pawn — Comfort Temperature ComfortableTemperatureRange (stat + apparel ± 10°C) determines if the pawn suffers
→ Read more
Game Loop — Tick Order MapTemperatureTick runs in the DoSingleTick path every 120 ticks — fixed position in the loop
→ Read more
Thing Spawning — Room Rebuild When a building spawns/despawns, it triggers a room rebuild → new equalizeCells
→ Read more
RNG / Rand — MP-Critical equalizeCells.Shuffle() consumes Rand on every room rebuild — desync risk
→ Read more

Knowledge Status of This Answer

1.54%
142 of ~9,200 files analyzed
Grows with each analysis session

RimWorld has ~9,200 C# files. This knowledge system analyzes them step by step by reading the decompiled source code. So far the core architectures have been captured — the systems that hold everything together (tick loop, thing hierarchy, job system, pathfinding, health, etc.).

NamespaceFilesAnalyzedStatus
Verse1,74785🔄 Core systems captured
Verse.AI~27830🔄 Job/ThinkTree/Combat
RimWorld5,91325🔄 Needs/Apparel/Recipes
Rest (8 namespaces)~1,2600⬜ Not started yet

What's Missing in This Answer

These files have not been read yet

The following code locations belong to the temperature system but are not yet captured in the knowledge base. The answer above is based on what has been analyzed so far — it is correct but not complete.