Update #140 for *Shogun Exodus* introduces a comprehensive overhaul to the game’s lighting system, adding a new buildable small wall lamp alongside dynamic room darkness mechanics. This update implements a shader-based darkness overlay that scales with the time of day, requiring strategic placement of light sources to illuminate room interiors. Built using conductive ingots and governed by new spacing rules, these lamps feature customizable hue settings and cast realistic pools of warm light that dynamically tint room environments, floor reflections, and structural elements.
Beyond visual upgrades, the update introduces new management mechanics, including happiness debuffs for actors caught in unlit or poorly lit rooms outside of daytime working hours. The new LightingSystem coordinates environmental darkness across building shells and underground layers, while critical z-ordering fixes ensure that carried and loose items now darken correctly within the night cycle.
Raw Patch Notes
UPDATE 2026-07-03 #140 - Lighting: Small Wall Lamp, Room Darkness & "Dark Room" Debuffs
- Added a buildable `small_wall_lamp` placeable (1m wide x 2m tall) that emits a warm, room-clipped fake light, plus time-of-day room darkening so lamps matter. Light is fake (blend-mode only, no Light2D / screen reads) for cheapness at high pawn/room counts; the render is isolated behind one helper so a real Light2D can be swapped in later.
- New `light` placeable component (`Scripts/Placeables/Components/PlaceableLightComponent.gd`) + shared `RoomClippedLight` helper (`Scripts/Placeables/Components/RoomClippedLight.gd`): renders a single additive radial glow reparented into a `clip_contents` Control sized to the lamp's current room, so light never spills to other rooms/floors. Light point, colour, radius, energy, alpha and falloff are all data-driven in the placeable's `light` component. E on a lamp opens a Hue popup (`Scripts/UI/LightHuePanel.gd`) with live preview + Accept/Cancel; the chosen colour persists in component_state. `requires_power` is a reserved future hook (cables/Generator) via `is_light_active()` — currently lamps need no power.
- Construction: lamp costs 1 ingot (any) + 1 ingot with conductivity >= 7. New data-driven `placement_rules.min_knob_spacing_same_placeable` (2 for the lamp): a lamp cannot be built/placed within 2 placement knobs of another lamp in the same room; violations are refused and show an on-screen notice via the new `ScreenNotice` autoload ("Cannot place a Small Wall Lamp within 2 knobs of another Small Wall Lamp.").
- New `LightingSystem` autoload (SmokeSystem-shaped): tracks rooms + active lamps, applies the room "dark" happiness debuffs, drives day/night darkening, and provides reflection tinting. Room lit-state: 0 lamps = unlit, 0 < lamps = required = lit. Required lamps scale with room width (small/standard = 1, large = 2; wider future rooms use `meters_per_lamp`). Debuffs (applied to any actor with Stats, incl. the Shogun): `in_the_dark` (-20 happiness, unlit) and `in_badly_lit_room` (-10 happiness, under-lit) — but ONLY outside working daylight hours [9:00, 17:00).
- Room darkening: each `GeneratedRoom` owns an always-on multiply `DarknessOverlay` (z 17: above actors/placeables/floor/wall, below pillars/roof at 20, so the building shell AND the underground stay unaffected), clipped to the room rect only. Its colour lerps from `day_color` (natural look) to `night_color` as the clock moves through day->night peaks; lamps carve local bright pools on top. Only the darkness is time-driven — lamp light is not. Reflections (pawns + placeables) are tinted to match their room's current darkness/lamp light via `LightingSystem.get_floor_modulate_at()` so they don't read too bright at night.
- Tuning: all lighting knobs live in the new moddable `Data/lighting.json` (darkness day/night colours + peak windows + overlay z, debuff daylight window + effect ids, required-lamp rules). New `lighting` tick channel (2s) drives debuff/darkness evaluation.
- Note: pre-existing generator glow lights sit below the darkness overlay (z ~11-12) so they now dim with the room at night; bump their `z_index` in `placeables.json` if you want them to punch through like lamps.
- Files: `Data/Items/placeables.json`, `Data/Stats/status_effects.json`, `Data/lighting.json` (new), `Data/tick_channels.json`, `project.godot`, `Autoload/GameDB.gd`, `Autoload/TimeSystem.gd`, `Autoload/LightingSystem.gd` (new), `Autoload/ScreenNotice.gd` (new), `Scripts/Placeables/PlaceableBase.gd`, `Scripts/Placeables/Components/PlaceableLightComponent.gd` (new), `Scripts/Placeables/Components/RoomClippedLight.gd` (new), `Scripts/UI/LightHuePanel.gd` (new), `Scripts/Buildings/GeneratedRoom.gd`, `Scripts/Buildings/GeneratedPlacementKnob.gd`, `Scripts/Player.gd`, `Scripts/Visual/FloorReflectionBase.gd`, `Scripts/Visual/CharacterReflection.gd`, `Scripts/Visual/PlaceableReflection.gd`, `Data/LoadingScreenText.json`, `current-game-setup.txt`, `mod-guide.txt`, `update-log.txt`
- Fix (lighting v2, floor coverage + real-light feel): (1) the darkness overlay was clipped to the room rect, so the 200px floor band (and the lower part of pawns standing on it) never darkened — extended the overlay down by `darkness.floor_cover_px` (200, the floor height) so floor + pawn feet + floor reflections darken, while the underground below stays untouched. (2) The lamp was a flat additive glow drawn on top, reading as a solid colour film over pawns. Replaced it with a shader `DarknessOverlay` (`Art/Effects/RoomDarkness.gdshader`, blend_mul): it darkens toward night colour but LIFTS back toward a warm-white around each lamp (the "reveal"), so lit surfaces show their true, warmly-tinted colours like real light. The additive is now only a small bulb bloom. `LightingSystem` feeds the shader per-room lamp positions/radii/intensities + averaged warm colour each tick. Reflections are now darkened/revealed automatically by the extended overlay (removed the per-reflection modulate + `get_floor_modulate_at`). New lamp `light` keys: `radius_px`/`intensity` (reveal) and `glow_radius_px`/`glow_energy`/`glow_alpha`/`glow_falloff` (bloom); new `lighting.json` `darkness` keys `floor_cover_px`, `reveal_warm_amount`, `reveal_falloff` (replacing `affects_reflections`). Files: `Art/Effects/RoomDarkness.gdshader` (new), `Scripts/Buildings/GeneratedRoom.gd`, `Autoload/LightingSystem.gd`, `Scripts/Placeables/Components/PlaceableLightComponent.gd`, `Scripts/Placeables/Components/RoomClippedLight.gd`, `Scripts/Visual/FloorReflectionBase.gd`, `Scripts/Visual/CharacterReflection.gd`, `Scripts/Visual/PlaceableReflection.gd`, `Data/Items/placeables.json`, `Data/lighting.json`.
- Tweak (lighting v3): (1) enlarged the lamp reveal radius ~50% (`small_wall_lamp` light `radius_px` 950 -> 1425 in `Data/Items/placeables.json`) so the pool reads stronger and reaches the floor better. (2) The whole base now darkens at night / lightens by day, not just room interiors: `LightingSystem` applies the current time-of-day darkness colour to each building's structural shell (roof/pillars/door/end walls/underground) via new `BuildingSpawner.apply_environment_darkness()` (modulates `FrontParallaxLayer`), pulled on build `_ready` and pushed each lighting tick. Lamp light stays room-only; room interiors + floor keep their own room overlay, so nothing double-darkens. (3) Fixed a startup ParserError: a stray `a` character had been inserted at the start of a line in `Autoload/LightingSystem.gd` (`_update_lighting_debuffs`), which blocked the whole project from loading. Files: `Autoload/LightingSystem.gd`, `Scripts/Buildings/BuildingSpawner.gd`, `Data/Items/placeables.json`.
- Fix (lighting v4, carried items z-order): carried item sprites were at `z_index = 300`, so they drew IN FRONT of building pillars (z 20) and ABOVE the room darkness overlay (z 17) — meaning carried items never darkened at night and clipped over pillars instead of passing behind them like their carrier. Lowered `CarriedSprite` z to 12 in `Scenes/Actors/Player.tscn` and `Scenes/Actors/AI/BasicAI.tscn` (above the pawn visual at z 10, below the darkness overlay at 17 and pillars at 20), so carried items now darken/reveal with the room and correctly render behind pillars. Also lowered the loose `PlacedItem` StackLabel from z 50 to 13 (same class of bug); the loose item Sprite was already z 10 and correct. Files: `Scenes/Actors/Player.tscn`, `Scenes/Actors/AI/BasicAI.tscn`, `Scenes/Actors/PlacedItem.tscn`.
*This is an automated post, using Python and LLMs to summarize game updates. Mistakes, while rare, may happen.

Reply