Armies
The two armies of the Kessrel Line as they are seen. Ten hardware-instanced populations — six castes and four effect channels — stand over the `kessrel.units` GPU table the sim writes, and two compute passes a frame turn that table into world matrices and per-copy shader lanes. T…
game.crowd.Armies
The two armies of the Kessrel Line as they are seen. Ten hardware-instanced
populations — six castes and four effect channels — stand over the
kessrel.units GPU table the sim writes, and two compute passes a frame turn
that table into world matrices and per-copy shader lanes. Twenty-five thousand
drawn copies, no entities, and the values never touch the CPU.
Mounted by the scene entrypoint on mount_crowd. status() reports which
castes are on their generated body and which fell back to a proxy, and what
each was scaled to; rebuild() stands the populations up again after a body is
regenerated; retune() re-sends the per-population config after a field
changes.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2game.crowd.Armies — the two armies of the Kessrel Line, as they are seen. Three thousand troopers and seven and a half thousand Vesh are drawn here, and not one of them is an entity. The sim writes every unit's position, heading and state into one GPU buffer (`kessrel.units`); this component stands ten hardware-instanced populations over that buffer and dispatches two compute shaders a frame that turn it into world matrices and per-copy shader lanes. The values never touch the CPU, which is the only reason ten thousand bodies and twenty thousand pieces of tracer fire cost a handful of draw calls. unit_pose one dispatch per caste: the body's transform and its lanes unit_fx four dispatches: tracers, muzzle bloom, ichor, dust Everything that differs between those ten dispatches travels in a per- population CONFIG BUFFER, not in the shader's `params:`. A shader's params are one uniform shared by every dispatch of that shader within a frame, so ten setParam-then-dispatch pairs all read whichever setParam ran last: the first attempt at this posed all six castes as titans and left every other slot parked, while every dispatch reported success. `t` is the one value they genuinely share, so it is the one thing left in params. The bodies are generated from the reference images under /zero/source/design/refs/ and scaled here to `K.UNIT_HEIGHT` off their own bounds, so a caste's real size comes from the spec rather than from whatever the generator happened to produce. Every caste also has a proxy built from boxes in `game.crowd.geom`, and the population draws the proxy wherever the generated mesh is not resolvable — an army of slightly blockier skitters beats an empty canyon.
popFor(id: string, kind: string, alien: boolean) → Pop
| arg | type | description |
|---|---|---|
| id | string | |
| kind | string | |
| alien | boolean |
materialFor(id: string) → any
An asset reference has to be a STATIC identity literal — a computed one cannot be statically pinned, so content using it cannot be published. That is why these are ten branches rather than one interpolated string.
| arg | type | description |
|---|---|---|
| id | string |
generatedFor(kind: string) → any
| arg | type | description |
|---|---|---|
| kind | string |
proxyFor(kind: string) → any
| arg | type | description |
|---|---|---|
| kind | string |
buf(name: string, elem: string, len: number, readback: boolean) → any
| arg | type | description |
|---|---|---|
| name | string | |
| elem | string | |
| len | number | |
| readback | boolean |
parked(n: number) → void
A population's slots all parked under the floor, so a frame drawn between the registration and the first dispatch is an empty canyon rather than ten thousand bodies stacked on the origin.
| arg | type | description |
|---|---|---|
| n | number |
writePoseCfg(p: Pop) → void
| arg | type | description |
|---|---|---|
| p | Pop |
writeFxCfg(f: Fx) → void
| arg | type | description |
|---|---|---|
| f | Fx |
fitFromBounds(p: Pop, minY: number, maxY: number) → void
| arg | type | description |
|---|---|---|
| p | Pop | |
| minY | number | |
| maxY | number |
runtimeMesh(geo: any) → any
| arg | type | description |
|---|---|---|
| geo | any |
fitFromGeometry(p: Pop, geo: any) → void
| arg | type | description |
|---|---|---|
| p | Pop | |
| geo | any |
buildMeshes( ) → void
dropDraws( ) → void
register(id: string, count: number, mesh: any, shadows: boolean, layer: string?) → boolean
| arg | type | description |
|---|---|---|
| id | string | |
| count | number | |
| mesh | any | |
| shadows | boolean | |
| layer | string? |
registerAll( ) → boolean
drawingCount( ) → number
A population the renderer REFUSED still answers `instanceInfo`, so the only surface that tells the truth is the material identity table: it lists a population when it is actually drawing one.
stepBuild( ) → void
dispatchAll( ) → void
attachUnits( ) → void
The unit table is the sim's to create. Asking for it under the SAME shape hands back the one that is already there, contents and all, so the two slices agree on one buffer whichever of them reaches it first.
start( ) → void
awake( ) → void
step(dt: number) → void
| arg | type | description |
|---|---|---|
| dt | number |
editorUpdate(dt: number) → void
| arg | type | description |
|---|---|---|
| dt | number |
update(dt: number) → void
| arg | type | description |
|---|---|---|
| dt | number |
onDestroy( ) → void
status( ) → any
What the crowd slice is doing right now: which castes are drawing their generated body and which fell back to a proxy, how many populations the renderer reports, and the scale and lift each caste was fitted to.
rebuild( ) → void
Stand the populations up again from the top — re-measure every body, re-upload it, and re-register the draws. Use it after regenerating a caste's mesh or changing a tuning field.
retune( ) → void
Re-send every population's config block without rebuilding the draws — the call to make after changing gait, fireRate or the tracer fields.
Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Showing up to 3 levels deep. Open a part to see what it holds further down.
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.