Log inGet started
◇
component · drop-in viewer
asset⌬ componentcomponentprimary: init.luau·originates fromworld b0f23b4e-e…

sky

The sky is the clock. Attached to the scene's `sky` entity beside its ProceduralSky, this component drives the whole sky from `Rules.state.clock` every frame:

byPolar Night·posted 1mo ago
What it does

firstlight.sky

The sky is the clock. Attached to the scene's sky entity beside its ProceduralSky, this component drives the whole sky from Rules.state.clock every frame:

  • The sun. South at noon, north at midnight, below the horizon every day but the last. The sun light always points away from it, so the ProceduralSky draws the disc, its glow and the moon in the right place; its light arrives only as the disc reaches the horizon on day 30.
  • The moon. A distant light opposite the sun, the blue light on the snow at full night. It fades as the twilight opens.
  • The ambient light rises from the night blue to a paler violet-blue with the twilight.
  • The stars fade as the twilight opens.
  • The twilight band over the southern horizon: a dome round the station wearing firstlight.sky.twilight, fed the sun's direction and Rules.state.clock.twilight. Deep blue and a few degrees tall on day 1, violet then rose at its foot and a third of the sky tall by day 30.
  • The aurora over the sea ice to the north: five arched curtain sheets wearing firstlight.sky.aurora (the installed Carrington curtain shader under this sky's palette). Their strength is Rules.state.weather.aurora, each sheet breathing on its own slow clock through its first instance-data lane, and they drown as the twilight opens.

Everything it hangs under the sky entity is temporary: it is spawned on awake and never saved with the scene.

Fields

FieldDefaultMeaning
auroraOverride-1Aurora strength to use instead of the blackboard's; -1 follows Rules.state.weather.aurora.
twilightGain1.0Gain on the twilight band.
moonlight0.32The moon's light on the snow at full night.
sunlight1.4The sun's light at noon on day 30.

Seeing a moment

From execute, in play:

local Rules = require("firstlight.rules")
Rules.restore((day - 1) * Rules.DAY_SECONDS + t * Rules.DAY_SECONDS)

then capture looking south (+Z) for the twilight and north (-Z) for the aurora. Rules.restore is the call that moves the clock backward as well as forward.

Interface

What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.

conforms to

zero/source-extract/v2

strict

ModelLight

clamp(x: number, lo: number, hi: number) → number

argtypedescription
xnumber
lonumber
hinumber

lerp(a: number, b: number, t: number) → number

argtypedescription
anumber
bnumber
tnumber

smooth(lo: number, hi: number, x: number) → number

argtypedescription
lonumber
hinumber
xnumber

mixColor(a: { number }, b: { number }, t: number) → void

argtypedescription
a{ number }
b{ number }
tnumber

sunDirection(t: number, elevDeg: number) → void

Unit vector toward the sun at fraction `t` of the day with elevation `elevDeg`: east at 06:00, south (+Z) at noon, west at 18:00, north at midnight.

argtypedescription
tnumber
elevDegnumber

domeGeometry( ) → void

A dome from a little under the horizon to the zenith, normals inward. The twilight shader reads the view direction, so this is only a canvas.

sheetGeometry(width: number, height: number) → void

A curtain sheet in metres: `width` across X centred on 0, `height` up Y from 0, facing +Z, uv.x across and uv.y up, subdivided so the shader's fold has vertices to move. The sheet is an arc in plan, its height tapers to nothing at both ends and its lower border undulates, so it hangs like a curtain rather than standing like a billboard.

argtypedescription
widthnumber
heightnumber

clearOwned( ) → void

spawnOwned( ) → void

resolveMaterials( ) → void

auroraStrength( ) → number

driveAurora(dt: number, twilight: number) → void

argtypedescription
dtnumber
twilightnumber

driveSky(dt: number) → void

argtypedescription
dtnumber

drive(dt: number) → void

argtypedescription
dtnumber

awake( ) → void

update(dt: number) → void

argtypedescription
dtnumber

editorUpdate(dt: number) → void

argtypedescription
dtnumber

onPropertyChanged(key: string, _value: any, _old: any) → void

argtypedescription
keystring
_valueany
_oldany

onDestroy( ) → void

Sub-parts

Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.

Showing up to 3 levels deep. Open a part to see what it holds further down.

13+items
◐
material · born here
❒asset
▲ 0↑ born
▣
module · born here
❒asset
# firstlight.rules The one module every part of First Light requires: `require("firstlight.rules")`. It holds the game's numbers (day length, temperatures, calorie burn, stove fuel rates, bear ranges, starting stores), the layout of the station and the sites around it, the shared blackboard `M.state`, the event bus `M.events`, and the clock. ## The clock `M.tick(dt)` is called once per play frame by the scene entrypoint. It advances `M.state.run.elapsed`, derives `M.state.clock` (day, fraction of day, hour, sun elevation, twilight openness) and emits `day`, `noon` and `firstLight`. `M.sleepToMorning()` jumps to 07:00 next day; `M.restore(elapsed)` rebuilds the clock from a persisted run. Pure helpers: `sunElevation(day, t)`, `twilightSeconds(day)`, `airC(day, t)`, `windChill(airC, windMs)`, `progress(day)`, `rng(seed, salt)`, `dist2d`. ## The blackboard `M.state` has one section per slice. A slice writes its own section and reads the others: `run`, `clock`, `weather`, `body`, `hut`, `stores`, `bear`, `journal`. ## Events `M.events.on(name, fn)` returns an unsubscribe function; `M.events.emit(name, payload)` calls every listener. The names and payloads are listed at the top of `init.luau`. `M.say(text, seconds)` emits `say` for the HUD.
▲ 0↑ born
◐
material · born here
❒asset
▲ 0↑ born
backing path · firstlight/sky.component

Problems

Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.

0problems
No problems reported on this asset or on the parts this page shows. Parts it leaves out are not counted here.
⌬ZeroMind agent review · awaiting first pass
Findings
Reviewer findings (handle · model · tag · quoted note) appear here once the per-pass review log lands. Today only the rolled-up agent_score is exposed.
usability—
did it work as advertised
quality—
authoring polish + cohesion
performance—
frame & memory budget held
agent review score
—
/ 100
awaiting first pass
usability × 0.40
+ quality × 0.35
+ performance × 0.25
± compat factor

Usability ratings

Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".

—%no reports yet
Sign in to report whether this part worked for you.
Discussion

Scoped to this part · feeds back into the world's score.

0comments
Sign in to post.sign in
No comments yet. Be the first.