Log inGet started
▣
module · drop-in viewer
asset⌬ modulemoduleprimary: init.luau·originates fromworld 57e766d1-6…

core

The shared vocabulary of THE CITY REMEMBERS.** Every build slice reads it; no slice writes it.

by◐kemz·posted 18d ago
What it does

game.core

The shared vocabulary of THE CITY REMEMBERS. Every build slice reads it; no slice writes it.

It answers the questions five agents building at once would otherwise each answer differently: where the districts are, how big a block is, what the clock says, what a reputation score is worth, how much heat is a star, which colours the references were drawn in, and the names of the scene entities each slice attaches its component to.

It holds no behaviour. Rules live here (a pure function from position to district, from score to band, from heat to stars); systems live in the slices.

What is in it

FieldWhat it settles
city9 × 9 grid of 80 m blocks on a 100 m pitch, 20 m streets, origin at block (4, 4), ground 1400 m.
districtsThe six districts in the ledger's own order, each with the grid test that claims a cell and its character, height range, density and police presence.
landmarksThe named places the city must contain (station, hospital, precinct, bank, dealer, market, hotel, diner) with the grid cell each sits in.
clockOne game day is 24 real minutes. Day 1 begins at 07:20, when the player steps off the train.
reputationOne score per district, −100 … +100, labelled in the ledger's six bands: RESPECTED, CAUTIOUS, NEUTRAL, SKEPTICAL, WARY, HOSTILE.
wantedHeat in points, five star thresholds, decay and the cooldown before heat falls.
money, health, xpStarting money 0, health, regen, hospital fee, and the rank ladder from NOBODY upward.
memoryThe fifteen memory kinds with each one's reputation weight, witness radius and ticker pattern, plus the bond thresholds that turn a stranger into an ally or a foe.
palette, uiEvery colour in the references, so five slices produce one city.
idsThe scene's named entities and the six mounts each slice attaches to.
camera, arrivalThe gameplay camera's setting, and where the player arrives.

Functions

local Core = require("game.core")

Core.districtAt(x, z)        -- -> "oldTown"      the district a world position is in
Core.districtName("oldTown") -- -> "Old Town"
Core.cellOf(x, z)            -- -> i, j           the grid cell a position falls in
Core.blockCentre(i, j)       -- -> x, z           world centre of a cell
Core.clockOf(elapsed)        -- -> { day, label, phase, ... }
Core.dayStamp(5)             -- -> "DAY 5"
Core.reputationLabel(70)     -- -> { label = "RESPECTED", colour = "teal" }
Core.wantedStars(140)        -- -> 3
Core.rankName(500)           -- -> "SOMEBODY"
Core.memoryShape()           -- -> the shape one stored memory has

The mounts

A slice attaches its component to its own mount and to no other one. The mounts are entities the scene build places; adding a component to one is an entityOps.addComponents call and does not involve writing the scene file.

mount_city     the city's geometry and atmosphere
mount_life     pedestrians, traffic, the police
mount_memory   the memory ledger and reputation
mount_player   the player, vehicles, the arrival
mount_ui       every screen
mount_world    weather and ambience

The memory contract

game.core defines what a memory is; game.memory (the memory slice) is what stores one. Any slice that wants the city to remember something calls:

require("game.memory").record({
    kind = "helped",
    district = Core.districtAt(x, z),
    subject = npcId,
    subjectName = "the man from the alley",
    text = "Helped a stranger out of a bad alley.",
    x = x, z = z,
})

and the memory slice dates it, weights it, files it, moves that district's reputation, gives it to whoever saw it, and draws it in the ledger.

Interface

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

conforms to

zero/source-extract/v2

game.core — the shared vocabulary of THE CITY REMEMBERS. Every slice reads this and none of them writes it. It holds the city's measured facts (where the districts are, how big a block is), the game's scales (reputation, wanted heat, money, the clock), the palette the references were drawn in, and the names of the scene entities each slice attaches to. It deliberately holds no behaviour: rules live here, systems live in the slices.

cellOf(x: number, z: number) →

The grid cell a world position falls in, clamped to the city.

argtypedescription
xnumbernumber world x
znumbernumber world z

blockCentre(i: number, j: number) →

World centre of a grid cell.

argtypedescription
inumbernumber
jnumbernumber

grid(i: number, j: number) → void

argtypedescription
inumber
jnumber

grid(i: number, j: number) → void

argtypedescription
inumber
jnumber

grid(i: number, j: number) → void

argtypedescription
inumber
jnumber

grid(i: number, j: number) → void

argtypedescription
inumber
jnumber

grid(i: number, j: number) → void

argtypedescription
inumber
jnumber

grid(i: number, j: number) → void

argtypedescription
inumber
jnumber

districtAt(x: number, z: number) → string

The district key a world position belongs to.

argtypedescription
xnumbernumber
znumbernumber

districtName(key: string) → string

The district's display name.

argtypedescription
keystringstring

clockOf(elapsed: number) →

Break elapsed seconds into the city's calendar.

argtypedescription
elapsednumbernumber seconds since the world started counting

dayStamp(day: number) → string

The stamp the ledger writes against an entry.

argtypedescription
daynumbernumber

reputationLabel(score: number) →

Name the band a reputation score sits in.

argtypedescription
scorenumbernumber

wantedStars(heat: number) → number

Stars (0-5) for a heat value.

argtypedescription
heatnumbernumber

memoryShape( ) →

The stored shape of one memory. Documented here so every slice

rankName(total: number) → string

The player's rank name for an experience total.

argtypedescription
totalnumbernumber

busOn(event: string, fn: (any) →

Subscribe to a named event. Returns the subscription, for `off`.

argtypedescription
eventstringstring
fn(anyfunction

busOff(sub: { fn: (any) → void

Drop a subscription handed back by `busOn`.

argtypedescription
sub{ fn: (anytable

busEmit(event: string, payload: any) → void

Announce something. `payload` is whatever the event means.

argtypedescription
eventstringstring
payloadanyany

Sub-parts

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

3items
This part has no composite children. See the Files segment for its leaf payloads.
backing path · game/core.module

Problems

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

0problems
No problems reported. This asset, its contents, and its direct deps are clean as of the latest commit.
⌬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.