df_core
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->
df_core
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->TODO: describe this module.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2df_core — Deep Field's shared spine. Every slice of this game reads its constants, its species roster, its runtime state and its event bus from here. Nothing else is shared: a slice writes only the files it owns and talks to the rest of the game through this module. Requiring it: local Core = require("@self/game/df_core") Read /zero/source/design/spec.md for the design this encodes.
depthToY(depth: number) → number
| arg | type | description |
|---|---|---|
| depth | number |
yToDepth(y: number) → number
| arg | type | description |
|---|---|---|
| y | number |
stratumAt(depth: number) → void
| arg | type | description |
|---|---|---|
| depth | number |
stratum(id: string) → void
| arg | type | description |
|---|---|---|
| id | string |
lampReach(brightness: number, depth: number) → number
The lamp's throw at a given brightness, in metres.
| arg | type | description |
|---|---|---|
| brightness | number | |
| depth | number |
stopAll( ) → void
bootAll( ) → void
registerSpecies(spec: ?) → void
| arg | type | description |
|---|---|---|
| spec | ? |
loadSpecies( ) → void
Requires every module in SPECIES_MODULES and registers what it returns. A module that is not written yet is skipped with a warning rather than taking the game down — the fauna slices land at different times.
speciesAtDepth(depth: number) → void
Every species whose depth band overlaps `depth`, as a list of specs.
| arg | type | description |
|---|---|---|
| depth | number |
speciesInStratum(stratumId: string) → void
| arg | type | description |
|---|---|---|
| stratumId | string |
resetState( ) → void
on(name: string, fn: (any) → void
| arg | type | description |
|---|---|---|
| name | string | |
| fn | (any |
off(name: string, fn: (any) → void
| arg | type | description |
|---|---|---|
| name | string | |
| fn | (any |
emit(name: string, payload: any) → void
| arg | type | description |
|---|---|---|
| name | string | |
| payload | any |
clearListeners( ) → void
Drops every handler. Called when the game restarts so a reload does not stack two copies of every listener.
rig(name: string) → void
| arg | type | description |
|---|---|---|
| name | string |
lerp(a: number, b: number, t: number) → number
Small helpers everyone needs
| arg | type | description |
|---|---|---|
| a | number | |
| b | number | |
| t | number |
smoothstep(a: number, b: number, x: number) → number
| arg | type | description |
|---|---|---|
| a | number | |
| b | number | |
| x | number |
readability(brightness: number, distance: number, depth: number) → number
How readable a creature is right now: 0 = pure silhouette, 1 = full detail. Everything that grades a creature's appearance uses this, so the journal's promise ("dim light leaves you guessing") is one number.
| arg | type | description |
|---|---|---|
| brightness | number | |
| distance | number | |
| depth | number |
Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ 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".
Scoped to this part · feeds back into the world's score.