/tg/ Station 13 - Modules - Types — Var Details - Proc Details

dirt

Vars

human_templateThe plain human template, kept for the round once built: underclothes coverage is judged on it (dirt_underclothes_on()). Admins can't edit it (vv_edit_var()).
mask_jobsMask jobs waiting, by request key: kept apart from masks, so newer asks can't drop one while it waits. Admins can't edit it (vv_edit_var()).
masksMasks by request key: /datum/dirt_masks, or FALSE when they can't be made. The newest DIRT_MASK_CACHE_SIZE are kept. Admins can't edit it (vv_edit_var()).
max_fire_costThe longest a fire has taken this round, in ms: one piece can't be split.
metric_jobThe job building human_template and measuring metrics, while it waits.
metricsWhat dirt_metric() returns, once measured. Admins can't edit it (vv_edit_var()).
queueJobs waiting, oldest first. The first may be part made.
rastersEach splat's rasters on a template and surface, by "template key|surface kind|zone:level:variant": one text of its /datum/dirt_pixels/proc/drawn() in each direction (fetch_direction()). Masks asked for again with one more splat rasterise only that one. Admins can't edit it (vv_edit_var()).
redrawsBodies to draw again for finished masks, by weak reference -> DIRT_REDRAW_* flags.
serialThe last serial next_serial() gave.
sprite_facingsThe directions sprites have pixels in (dirt_sprite_facings()), the newest DIRT_SPRITE_FACINGS. Admins can't edit it (vv_edit_var()).
sprite_readsWhole sprite directions read (dirt_sprite_pixels()), the DIRT_SPRITE_READS read most lately. Admins can't edit it (vv_edit_var()).
template_jobsTemplate jobs waiting, by template key. Admins can't edit it (vv_edit_var()).
templatesBuilt templates by key, or FALSE when one can't be. About 220 KB each, so only the DIRT_TEMPLATE_CACHE_SIZE asked for most lately are kept; one dropped is built again when masks on it are next asked for. A job holds its own template, so one dropped while the job waits is still drawn on, and taken back from the job when asked for meanwhile (held_template()). Admins can't edit it (vv_edit_var()).

Procs

InitializeBuilds the plain human template in the background from the start, so the first landing never waits for it.
RecoverTakes over the queue, the bodies waiting to be drawn again and the caches from the subsystem it replaces, and fires while any wait.
ShutdownDrops the jobs still waiting, so nothing waits on them forever.
addQueues a job.
finish_allMakes every queued job now and draws the bodies waiting for them again, as masks made as they're asked for would have: for tests, and anything else that has to see mess drawn at once. In a round the queue's own pace keeps ticks short instead.
fireDraws again the bodies left waiting by the last fire, then makes queued jobs in order while the tick has room, then draws again the bodies waiting for those. Each loop goes round at most once for each entry its list had when it began, so none can go round forever; what is added meanwhile waits for a later fire. Stops firing while there's nothing to do (add()).
held_templateReturns a built template a queued mask job holds, or null.
human_surfaceReturns one direction of the plain human template, or null until that direction is built.
make_pieceMakes the next piece of a job. A piece that runtimes fails its job, so it can't hold up the jobs queued after it.
masks_forReturns a request's masks, or null while they're made or when they can't be. Masks not made yet are queued, behind their template and the measure if those aren't made either, and redraw_body is drawn again once they are; without DIRT_MASKS_DEFERRED they're made now.
next_serialReturns the next splat serial: the order splats landed in, across every body and item.
note_costNotes what a fire took, for max_fire_cost.
queue_human_templateQueues the plain human template, which metrics is measured from and human_template keeps, in the directions read: south and east for the measure (dirt_metric_directions()), north and south for underclothes (dirt_zone_facing()).
redraw_laterDraws again on a body at the next fire, once whatever changed it this tick is done: several changes draw it once.
redraw_nextDraws again the body that has waited longest for its masks, if it's still around.
redraw_waitingDraws again the bodies waiting for finished masks, longest waiting first, until the tick runs short.
run_nowMakes a job now, start to end, as finish_all() does.
stat_entryShows how many jobs wait, how many bodies wait to be drawn again, and the longest fire this round.
template_forReturns the template built from a body's sprites, queueing it if it isn't built or queued yet; without DIRT_MASKS_DEFERRED it's built now. One the cache dropped that a queued job still holds goes back in the cache rather than being built a second time.
vv_edit_varRefuses admin edits of the caches and the jobs waiting: a mask, template or measure edited by hand would be drawn for the rest of the round, and a list of jobs replaced would break masks_for() for the round.
work_onMakes pieces of a job until it's done or, when yielding, until the tick runs short. A job that runs past its most_pieces(), counted across every fire, is dropped as failed.

Var Details

human_template

The plain human template, kept for the round once built: underclothes coverage is judged on it (dirt_underclothes_on()). Admins can't edit it (vv_edit_var()).

mask_jobs

Mask jobs waiting, by request key: kept apart from masks, so newer asks can't drop one while it waits. Admins can't edit it (vv_edit_var()).

masks

Masks by request key: /datum/dirt_masks, or FALSE when they can't be made. The newest DIRT_MASK_CACHE_SIZE are kept. Admins can't edit it (vv_edit_var()).

max_fire_cost

The longest a fire has taken this round, in ms: one piece can't be split.

metric_job

The job building human_template and measuring metrics, while it waits.

metrics

What dirt_metric() returns, once measured. Admins can't edit it (vv_edit_var()).

queue

Jobs waiting, oldest first. The first may be part made.

rasters

Each splat's rasters on a template and surface, by "template key|surface kind|zone:level:variant": one text of its /datum/dirt_pixels/proc/drawn() in each direction (fetch_direction()). Masks asked for again with one more splat rasterise only that one. Admins can't edit it (vv_edit_var()).

redraws

Bodies to draw again for finished masks, by weak reference -> DIRT_REDRAW_* flags.

serial

The last serial next_serial() gave.

sprite_facings

The directions sprites have pixels in (dirt_sprite_facings()), the newest DIRT_SPRITE_FACINGS. Admins can't edit it (vv_edit_var()).

sprite_reads

Whole sprite directions read (dirt_sprite_pixels()), the DIRT_SPRITE_READS read most lately. Admins can't edit it (vv_edit_var()).

template_jobs

Template jobs waiting, by template key. Admins can't edit it (vv_edit_var()).

templates

Built templates by key, or FALSE when one can't be. About 220 KB each, so only the DIRT_TEMPLATE_CACHE_SIZE asked for most lately are kept; one dropped is built again when masks on it are next asked for. A job holds its own template, so one dropped while the job waits is still drawn on, and taken back from the job when asked for meanwhile (held_template()). Admins can't edit it (vv_edit_var()).

Proc Details

Initialize

Builds the plain human template in the background from the start, so the first landing never waits for it.

Recover

Takes over the queue, the bodies waiting to be drawn again and the caches from the subsystem it replaces, and fires while any wait.

Shutdown

Drops the jobs still waiting, so nothing waits on them forever.

add

Queues a job.

Arguments:

finish_all

Makes every queued job now and draws the bodies waiting for them again, as masks made as they're asked for would have: for tests, and anything else that has to see mess drawn at once. In a round the queue's own pace keeps ticks short instead.

fire

Draws again the bodies left waiting by the last fire, then makes queued jobs in order while the tick has room, then draws again the bodies waiting for those. Each loop goes round at most once for each entry its list had when it began, so none can go round forever; what is added meanwhile waits for a later fire. Stops firing while there's nothing to do (add()).

held_template

Returns a built template a queued mask job holds, or null.

Arguments:

human_surface

Returns one direction of the plain human template, or null until that direction is built.

Arguments:

make_piece

Makes the next piece of a job. A piece that runtimes fails its job, so it can't hold up the jobs queued after it.

Arguments:

Returns whether the job is done.

masks_for

Returns a request's masks, or null while they're made or when they can't be. Masks not made yet are queued, behind their template and the measure if those aren't made either, and redraw_body is drawn again once they are; without DIRT_MASKS_DEFERRED they're made now.

Arguments:

next_serial

Returns the next splat serial: the order splats landed in, across every body and item.

note_cost

Notes what a fire took, for max_fire_cost.

Arguments:

queue_human_template

Queues the plain human template, which metrics is measured from and human_template keeps, in the directions read: south and east for the measure (dirt_metric_directions()), north and south for underclothes (dirt_zone_facing()).

redraw_later

Draws again on a body at the next fire, once whatever changed it this tick is done: several changes draw it once.

Arguments:

redraw_next

Draws again the body that has waited longest for its masks, if it's still around.

redraw_waiting

Draws again the bodies waiting for finished masks, longest waiting first, until the tick runs short.

Returns TRUE if the tick ran short.

run_now

Makes a job now, start to end, as finish_all() does.

Arguments:

stat_entry

Shows how many jobs wait, how many bodies wait to be drawn again, and the longest fire this round.

template_for

Returns the template built from a body's sprites, queueing it if it isn't built or queued yet; without DIRT_MASKS_DEFERRED it's built now. One the cache dropped that a queued job still holds goes back in the cache rather than being built a second time.

Arguments:

Returns:

vv_edit_var

Refuses admin edits of the caches and the jobs waiting: a mask, template or measure edited by hand would be drawn for the rest of the round, and a list of jobs replaced would break masks_for() for the round.

Arguments:

Returns:

work_on

Makes pieces of a job until it's done or, when yielding, until the tick runs short. A job that runs past its most_pieces(), counted across every fire, is dropped as failed.

Arguments:

Returns whether the job is done.