Adding a box and a diagram¶
Ankh-Morpork burns now and then, and no system page draws fire yet. Two pieces of it are already on the diagrams. A dark evening puts customers off supply on the power page, and the Cockbill Street Pump gives water for fighting fires on the homes page.
The rows¶
A new diagram starts as rows in a spreadsheet beside the game’s other diagram files, one per arrow:
cause,effect,sign,agent,evidence,label
customers off supply,candles lit,same,human,plausible,
candles lit,fires burning,same,natural,plausible,
fires burning,bucket chains,same,human,plausible,
bucket chains,fires put out,same,natural,plausible,
water for fighting fires,fires put out,same,natural,plausible,
fires burning,water for fighting fires,opposite,natural,plausible,
fires put out,fires burning,opposite,natural,plausible,
Customers off supply and water for fighting fires are spelt exactly as the other pages spell them, and that is what joins fire to the rest of the city. A power cut now lights candles, and a stopped pump now leaves the bucket chains dry. Spelt differently, either one would be a new box that nobody asked for.
The rows hold two loops. More fires bring out more bucket chains, and the chains put fires out, a balancing loop. More fires use up the water, less water puts fewer out, and more fires burn, a reinforcing one.
The drawing¶
From the rows, systemdiagrams draws a diagram for LibreOffice Draw. Its layout is untangled by hand, the tool puts the loop marks back, and the SVG goes into the images. The homes page gets a section with the figure, a description of what it shows and the two loops listed under it.
The box list¶
Four names are new, so the box list gets four rows:
box,level,decider,piles up
candles lit,district,the public,
fires burning,district,,yes
bucket chains,district,the public,
fires put out,district,,
Nobody decides how many fires burn or how many go out. The public decides whether to light candles and whether to form a chain. The city once paid a fire brigade by the fire put out, and soon had a great many fires to put out, so there is no brigade to press.
Fires burning piles up, since a fire burns until something puts it out. The rest are worked out each hour.
No row gives a floor, a ceiling or a starting value, because every quantity is measured against normal. Normal, for fires burning in a district of Ankh-Morpork, is not none.
The check¶
Before the four rows are in, the check fails and names the four boxes. Once they are in, it passes, provided the loops listed under the figure are the loops in the rows. Nothing else changes: no other spreadsheet, no other row in the box list, and no code, because the engine knows how to apply links and nothing about fire.
One more box¶
Sometimes an existing diagram needs one box more. On the triggers page, a hostile state opened valves from a distance, and the water went nowhere. One row joins it to the water page:
valves opened,network pressure,opposite,natural,plausible,
Network pressure already has a row in the box list, so the list does not change. An opened valve now drains the mains, and low pressure brings the water page’s loop with it: contamination getting in, illness, and a boil notice in the Shades.
The diagram had already been laid out, so it is not drawn again. The new box and arrow are added by hand in Draw, and the tool puts the marks back.