Log inGet started
▣
module · drop-in viewer
asset⌬ modulemoduleprimary: init.luau·originates fromworld 0a0b119f-a…

game

The game assembled: the WORLD every player shares (clock, districts' colour and

byzero-proxy @ DESKTOP-DB3UJOJ·posted 11d ago
What it does

game

The game assembled: the WORLD every player shares (clock, districts' colour and

vigilance, murals and the crews that scrub them, paint in the air, cover, marks) and one SESSION per player
(logic.session: her paint, colour, money, crew, vehicles, heat and record, missions, activities, chronicle).

It owns no entity and reads no device. Each tick the host (logic.driver, or a test) hands it one frame per
player; it returns one view per player and emits every moment on its hub. The same code runs one player or
several: heat, saves and progress are each player's own; walls are everyone's.

  local Game = require("metropolisGame.logic.game")
  local game = Game.new({
      city = city,                -- interfaces: city (districtAt, walls, place, roadGraph ...)
      query = physicsQuery,       -- interfaces: physics (raycast, overlap) for paint in the air
      hasLine = function(observer, suspect) return true end,   -- line of sight for observers
      light = nil,                -- function(x, z) -> 0..1; default follows the game clock
      clock = nil,                -- interfaces: clock, when it offers `shared` and `anchor` (several players: the
                                  --   game clock then follows the synced anchor instead of ticking)
      seed = 20261122,
  })
  local session = game:session("p1")        -- makes it on first use (a new game for that player)
  local views = game:frame(dt, { p1 = {
      actor = "actor:p1",                    -- the id her body has in physics hits (so solvent finds her)
      pose = { x, y, z, fx, fz, speed, vx, vz, onGround },
      roadClass = "street",                  -- the class of road she is on (nil off the road)
      hidden = false, concealment = {}, jacket = "ochre", stand = 0, mounted = false,
      aim = { origin = { x, y, z }, dir = { x, y, z }, site = "old_quay:piece:1", u, v, distance, target = id },
      input = { paint, fire, sign, breakHeld, skip },
      observers = { [id] = { kind, x, y, z, fx, fz, relay, atRelay, knows, active } },
      van = { x, z },                        -- where her van stands (for the bill), or nil
      route = function(unit, x, z) ... end,  -- the host's router for response units (optional)
      facts = {}, audience = nil,
  } })
  views.p1                                  -- everything her HUD and map draw: data and ids, no text
  game:view("p1")                           -- the same again
  game.hub                                  -- every event of every session (e.player says whose) and the world's
  game:save() -> { v, world = {...}, players = { [id] = {...} } }      game:load(data) -> ok, why
  game:saveWorld()   game:savePlayer(id)    -- the two halves on their own (logic.save writes them)

World parts, all public: clock, districts (districtState), sites, places, murals, gunplay, party, graph.
World hub events: "hour", "dayPassed", "colour", "threshold", "vigilance", "districtPainted", the murals'
("scrubComing" ...), the gunplay's ("shotsFired", "paintedOut", "washed" ...), "relayJammed" { id }, "lensOut" { id }.

The interface is documented in the header of init.luau; this file repeats it for the asset browser.

Interface

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

conforms to

zero/source-extract/v2

metropolisGame.logic.game — the game assembled: the WORLD every player shares (clock, districts' colour and vigilance, murals and the crews that scrub them, paint in the air, cover, marks) and one SESSION per player (logic.session: her paint, colour, money, crew, vehicles, heat and record, missions, activities, chronicle). It owns no entity and reads no device. Each tick the host (logic.driver, or a test) hands it one frame per player; it returns one view per player and emits every moment on its hub. The same code runs one player or several: heat, saves and progress are each player's own; walls are everyone's. local Game = require("metropolisGame.logic.game") local game = Game.new({ city = city, -- interfaces: city (districtAt, walls, place, roadGraph ...) query = physicsQuery, -- interfaces: physics (raycast, overlap) for paint in the air hasLine = function(observer, suspect) return true end, -- line of sight for observers light = nil, -- function(x, z) -> 0..1; default follows the game clock clock = nil, -- interfaces: clock, when it offers `shared` and `anchor` (several players: the -- game clock then follows the synced anchor instead of ticking) seed = 20261122, }) local session = game:session("p1") -- makes it on first use (a new game for that player) local views = game:frame(dt, { p1 = { actor = "actor:p1", -- the id her body has in physics hits (so solvent finds her) pose = { x, y, z, fx, fz, speed, vx, vz, onGround }, roadClass = "street", -- the class of road she is on (nil off the road) hidden = false, concealment = {}, jacket = "ochre", stand = 0, mounted = false, aim = { origin = { x, y, z }, dir = { x, y, z }, site = "old_quay:piece:1", u, v, distance, target = id }, input = { paint, fire, sign, breakHeld, skip }, observers = { [id] = { kind, x, y, z, fx, fz, relay, atRelay, knows, active } }, van = { x, z }, -- where her van stands (for the bill), or nil route = function(unit, x, z) ... end, -- the host's router for response units (optional) facts = {}, audience = nil, } }) views.p1 -- everything her HUD and map draw: data and ids, no text game:view("p1") -- the same again game.hub -- every event of every session (e.player says whose) and the world's game:save() -> { v, world = {...}, players = { [id] = {...} } } game:load(data) -> ok, why game:saveWorld() game:savePlayer(id) -- the two halves on their own (logic.save writes them) World parts, all public: clock, districts (districtState), sites, places, murals, gunplay, party, graph. World hub events: "hour", "dayPassed", "colour", "threshold", "vigilance", "districtPainted", the murals' ("scrubComing" ...), the gunplay's ("shotsFired", "paintedOut", "washed" ...), "relayJammed" { id }, "lensOut" { id }.

new(opts: any) → any

Assemble the game. See the header for `opts`.

argtypedescription
optsany

light(_x: number, _z: number) → void

argtypedescription
_xnumber
_znumber

each(fn: (any) → void

Call fn(session) for every player, in id order.

argtypedescription
fn(any

session(id: string) → any

The session of a player (made on first use: a new game for that player).

argtypedescription
idstring

leave(id: string) → void

A player left the world. Her session is dropped (save it first).

argtypedescription
idstring

spread(session: any, kind: string, e: any) → void

One player's doing reaches the players acting with her (pursuitKit party).

argtypedescription
sessionany
kindstring
eany

scheduleScrubs( ) → void

Six o'clock: every district's crews set out for the walls districtState names.

frame(dt: number, frames: any) → any

One tick. `frames` = { [playerId] = frame } (see the header). Returns { [playerId] = view }.

argtypedescription
dtnumber
framesany

charge(report: any) → void

argtypedescription
reportany

view(id: string) → any

Everything one player's HUD and map need: plain data and ids, never text (the UI resolves text).

argtypedescription
idstring

saveWorld( ) → any

The shared world as plain data.

savePlayer(id: string) → any

One player as plain data.

argtypedescription
idstring

save( ) → any

The whole save: the world and every player in it.

loadWorld(w: any) → void

Restore the world from saveWorld()'s data.

argtypedescription
wany

loadPlayer(id: string, data: any) → void

Restore one player from savePlayer()'s data (makes her session if it is new).

argtypedescription
idstring
dataany

load(data: any) → void

Restore from a save made by save() (any version logic.save can migrate). Returns false, why when it cannot be read.

argtypedescription
dataany

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.