Taking the sky's light out of dungeons and buildings
Floors of the Breakout Site now brighten going up, and no room in the game takes sun, moon or sky light indoors. Each place gets a fixed ambient light instead.
Inside any room in the game, the sky now gives no light at all. A room looks the same at noon as at midnight, whether it’s a dungeon floor, a town building, the tower, the Works or a stand-in house on the island. The same day I also made the upper floors of the Breakout Site fail by floor 1’s rules, but each floor up is kept better, so the building brightens as the party climbs.
Why did floors 2 to 4 need their own brightness?
I wanted the floors above floor 1 to have failing lights too, using the same rules, but getting brighter as you move up. Each floor’s entry now has one number beside the failing-lights flag, called upkeep, from 0 to 1. Floor 1 says nothing, which is 0, so it’s exactly as it was. Floors 2, 3 and 4 say 0.2, 0.4 and 0.7. I don’t have a reason for those steps beyond “brighter going up” and the pictures I picked them from.
I couldn’t just add up the lamp energy, because floor 1 has 88 lamps and the floors above have about 24 each. So brighter means more of the lamps alive and more energy per lamp. Upkeep is the share of the way each of the failing rule’s numbers moves toward a kept floor’s value, and it works out like this:
- A lamp’s energy is multiplied by a lerp from 0.8 up to 1.
- In meat, a lamp’s dimming goes from 0.4 up to 1.
- The chance a lamp is dead gets multiplied by 1 minus upkeep.
- A room under thick meat keeps alive a share of its lamps that goes from 0.75 up to 1.
- The share of living lamps that flicker gets multiplied by 1 minus upkeep.
The roll for each lamp is a hash of the dungeon, the word lights and the tile, so the broken set is the same on every build and nothing needs saving. In the test and the film, the lamps alive on floors 1 to 4 are 42%, 67%, 90% and 92%.

One corridor of each floor, 1 to 4. The mean brightness is 35.9, 54.8, 61.3 and 63.8 out of 255.
One thing I found on the way was that a floor above the first couldn’t say it had failing lights at all. The database allowed the field, but the list of fields a floor copies into its plan didn’t name it. Now it does.
How do you stop the sky lighting a room?
On floor 1 the sky turned out to be most of what lit the rooms. I first thought about extending floor 1’s trick of holding the sky’s ambient light down, but I dropped that for a wider rule. Indoors, no light from outside should affect the room.
I made a small node, called IndoorSky, a child of the day and night cycle. Every place with an inside joins a group and answers one question: is this point indoors, and with what light? The place nearest the top wins, since the floors of a dungeon are boxes that overlap. A timer asks every 0.25 seconds where the camera is.
When the answer is yes, sun and moon energy get multiplied by 1 minus how indoors you are, and the lights are switched off at 0. The ambient light’s color and energy move to the place’s values, and the fog color moves to a fixed dark haze. The reflected light source in the environment also changes from the sky to disabled, because without that the sky still showed up in shiny metal. Stepping through a door eases all of this over 1.5 seconds, which is real time since it’s the eye adapting.
Each place’s ambient light replaces the sky’s. In a dungeon it’s 0.3 where the lights are kept, and it drops to 0.06 in thick meat on floor 1. That drop is lessened by upkeep. The Sump is 0.3 and the vat bay’s hall is 0.22.

The same room of a dungeon at noon and at midnight. Both come out at 58.3 out of 255. The vat bay’s hall at midnight is below.
How did every building get the same treatment?
After that I was asked on a page of questions whether the Works, the tower and the town’s buildings should lose the sky inside too, and I picked “Yes, all of them, now”. I could have kept a list of buildings to add, but the buildings are all made of one kind of room. So I made the room itself an indoor place, and anything built of it is indoors with no more said.
A room under a cover answers for itself. It counts as indoors inside its footprint including its walls, so a threshold is inside and the step before it isn’t. Vertically it runs from under the floor slab to the top of the roof slab, which leaves no gap between two storeys on a ramp and leaves a flat roof outdoors. A storey with a ramp up counts as covered, since the storey above is its roof. A building’s rooms get 0.3 ambient, tinted from the lamp’s color toward white by 0.45, so a building is warm. The Works doesn’t use that room, so it has its own answer from its list of rooms, with doorways counted, and its ambient is 0.25 and cold.
The stand-in buildings on the island had no lamp, so each one got an indoors box and one lamp. The lamp’s energy is 1.2, and taller buildings get more, up to a factor of the height divided by 3.

A town building, the Tallow Exchange, at noon on the left and midnight on the right. The window in the far wall is black in both.
What’s still wrong?
Light through doorways and windows. From inside, the outdoors seen through an opening has no sun on it, because the sky is one switch for the whole picture, and the sky seen through a window is dark. That’s the black window above. I had set this aside, since I thought it needed raycasting. I then looked at the doorway at noon from inside and asked for it to be done properly, and that’s next.

A doorway at noon seen from inside. On the left it’s dark beyond the door, and on the right is how it was, with a pale day in the opening.
The picture checks in the building test need a window to run, so the headless suite only runs the checks that don’t need a picture. I want the suite to run them in a window, or at least say they weren’t run. In the window, the test passes 63 checks in the vat bay’s world and 49 on the island.
Also done
- The lift stops on floors 2 to 4 were looked at with the car away, and none is black, so I added no lamps.
- A script with statics is now marked as a tool script, as the editor-safety check asks.