Birdoggydog's Builds

Roofing a staggered house by searching for its one roof

Staggered ranges can not have their ridges cross, so the roof solver searches every corner height, finds one roof, a short jog, and proves the pinwheel has none.

The building roof solver can now roof a stepped house, the kind where two ranges are two squares across and each hangs half off the next, so the plan zig-zags. The roof it finds is a jog, a ridge one square long across the contact. It roofs 120 steps (5 steps, 4 turns, gable and hip, 30, 45 and 60 degrees). The pinwheel, a middle with ranges hung off it both ways, has no pitched roof at one height, and the solver now says so and makes it flat instead.

Top-down plans of stepped houses and tenements in four turns, with red ridges, teal valleys and a ridgejog label at each jog, then the pinwheel made flat and refused with its reason.
The steps in four turns, gable and hip. The pinwheel is the blue flat one and the two pink refusals.

Why can’t the ridges just cross?

I asked for this on 22 October: the stepped and zig-zag footprints had been refused, and I wanted them roofed, with the solver ready for wider wings, setbacks and castle towers later.

An L is easy, one ridge meets another at a valley. A step is two ranges running the same way, end to end, one square apart sideways. Each range’s ridge runs down the middle of its range. At the contact each ridge would end on the other range’s wall. They can’t cross.

How do you find a roof that isn’t obvious?

I stopped guessing and searched. For every grid corner of the footprint, I tried every height it could take, eave height or ridge height, and asked whether the planes closed over every square once with edges that agree. For a step the search finds one roof. For the pinwheel it finds none.

The step’s roof is the jog:

  • A ridge one square long across the contact, joining the two ranges’ ridges. It is the ridge of a small jog wing, the contact’s two squares running the other way.
  • Each range’s jogged end is a half gable over its own wall. It is never hipped, even on a hip roof.
  • A valley on each side of the contact, each falling to a foot with a kneeler, the same as at the foot of an L.
  • A new junction, ridgejog, at each end of the jog’s ridge, where two half gables and two ridges meet.

The solver finds steps through BuildingWings.chain_cuts(), which looks for two or more ranges one way, all joined by jogs. It tries chains only after every other cut has failed, so no plan made before can change. I checked that over 400 test requests, 37 sheet plans and 10,000 random footprints with 4 roofs each. The only plans that changed did so by two wording fixes, in how an eave’s ends and a lean-to’s half gable are written.

Why does the pinwheel get a flat roof?

The middle of a pinwheel has ranges hung half off it in both directions, so its ridge would have to run both ways. The search finds no roof of ranges two squares across at one height. The solver refuses a pitched roof with that reason, named “pinwheel”, and the tenement kind makes it flat. A raised middle would be a different job, LV-46.

Two other shapes still get the old refusal: a middle range one square long, and two jogs on the same side of a range two squares long, which would make a trough between them.

Can a courtyard step too?

Later the same day I picked “Manors and courtyards both” for the next step. The manors H, E and U now take the stepped footprint, since the jog roof already covers them. The courtyard house now takes a stepped ring: a ring of ranges round a court, where the front side, the back side or both may step.

Top-down plans of a stepped courtyard house roofed in four turns, then the three stepped manors, then three ring shapes refused with their reasons.
The ring in four turns, the three manors, and the three rings with no roof.

The ring is cut into two strands, a front and a back. Each strand is a chain of ranges joined by jogs, or one range, and at least one of them has a jog. What is left hangs between them as connectors, and the court is the hole in the middle. Every piece is then something the solver already roofs, so no new junction or roof member was needed. Every edge of the court faces inward, as an eave or as a jog’s half gable, and each inside corner is closed by an eavein or, where a jog meets the court, a ridgejog.

The ring cut is only tried on a footprint with a hole, and only after every older cut has failed. The same height search finds that three rings have no roof at one height:

  • A court one square wide beside a jog that steps into it.
  • A range two squares long jogged at both ends to the same side, which makes a trough.
  • A range one square long between two jogs.

Each is refused with its reason and made flat. The roof test now roofs 120 stepped rings. Across 10,000 random footprints with 4 roofs each, 614 rings per pitched form get a roof they did not have, 276 of them stepped courtyards and 338 irregular, and no roof made before changed.

What’s left

The art kit has no ridgejog piece yet and no 30 or 60 degree half gables, so none of these roofs can be built into a model. The wide wings, setbacks and towers I asked for aren’t built either. The solver now keeps a wing’s span, the cells of each storey and an optional list of parts in the plan for them, and the notes on how each one goes are written down. The roof test now has 5052 checks and the recipe test 5252, and all of them pass.