core
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->
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/v2game/core.module — the frozen shared contract for Escapement. Every slice reads this module. NOBODY edits it. It holds the numbers the game is measured in, the gear geometry every other file derives world positions from, the shape of the game state, and the signal bus the slices talk to each other over. local Core = require("@world::game.core") The one idea the whole game rests on: a cell address is GEAR-LOCAL. `{ring, sector}` names a tooth on a gear, and it never changes when the machine turns. What changes is where that tooth IS — `Core.cellPosition` takes the current tick and works out the world point. A unit standing on a cell is therefore carried by the machine for free: nothing moves it, the floor under it rotates.
ring(ringIndex: number) → void
Gear geometry — the shared derivation The ring record for a ring index (0 = the escapement).
| arg | type | description |
|---|---|---|
| ringIndex | number |
cellAngle(ringIndex: number, sector: number, tick: number) → number
The world angle, in radians, of a gear-local sector at a given tick. This is the whole machine in one line: the address is fixed, the angle carries the tick.
| arg | type | description |
|---|---|---|
| ringIndex | number | |
| sector | number | |
| tick | number |
cellPosition(ringIndex: number, sector: number, tick: number) → void
The world position of a cell at a given tick.
| arg | type | description |
|---|---|---|
| ringIndex | number | |
| sector | number | |
| tick | number |
angleDelta(a: number, b: number) → number
How far apart two angles are, taking the short way round.
| arg | type | description |
|---|---|---|
| a | number | |
| b | number |
isMainspring(ringIndex: number, sector: number) → boolean
Is this cell a mainspring node?
| arg | type | description |
|---|---|---|
| ringIndex | number | |
| sector | number |
neighbours(ringIndex: number, sector: number, tick: number) → void
Adjacency — what the machine allows THIS tick Every cell reachable from `{ring, sector}` at `tick`, as a list of `{ ring = n, sector = n }`. Along the ring is always open; across rings only where the teeth currently line up; the escapement only through its one gate. This is the function that makes a line dissolve two turns later — call it fresh every time, never cache it across a tick.
| arg | type | description |
|---|---|---|
| ringIndex | number | |
| sector | number | |
| tick | number |
linked(aRing: number, aSector: number, bRing: number, bSector: number, tick: number) → boolean
Are two cells linked right now?
| arg | type | description |
|---|---|---|
| aRing | number | |
| aSector | number | |
| bRing | number | |
| bSector | number | |
| tick | number |
key(ringIndex: number, sector: number) → string
A stable string key for a cell, for use as a table index.
| arg | type | description |
|---|---|---|
| ringIndex | number | |
| sector | number |
allCells( ) → void
Every cell on the board, as `{ ring, sector }` records.
on(signal: string, fn: (any) → void
| arg | type | description |
|---|---|---|
| signal | string | |
| fn | (any |
emit(signal: string, payload: any) → void
| arg | type | description |
|---|---|---|
| signal | string | |
| payload | any |
newState( ) → void
state( ) → void
resetState( ) → void
mintId(prefix: string) → string
Mint a unique unit id.
| arg | type | description |
|---|---|---|
| prefix | string |
unitsAt(ringIndex: number, sector: number) → void
Every unit standing on a cell.
| arg | type | description |
|---|---|---|
| ringIndex | number | |
| sector | number |
unitsOf(side: string) → void
Every unit on one side, as a list.
| arg | type | description |
|---|---|---|
| side | string |
archetype(unit: ?) → void
The archetype record behind a unit.
| arg | type | description |
|---|---|---|
| unit | ? |
unitPosition(unit: ?) → void
The world point a unit is standing at, right now, mid-animation included.
| arg | type | description |
|---|---|---|
| unit | ? |
cellPositionNow(ringIndex: number, sector: number) → void
The world point of a cell, right now, mid-animation included.
| arg | type | description |
|---|---|---|
| ringIndex | number | |
| sector | 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.