Skip to content

five-on-it / apps/client/src/renderer/remotes

apps/client/src/renderer/remotes ​

Everything the player does not control, drawn from the snapshots: one node and one interpolation buffer per server entity. Cars and people are the low-poly models of their class (createActor: the body tinted by owner, a wreck scorched in its own paint; grey for a bystander, orange for an enemy NPC, navy for a police officer, a pedestrian in its role's shirt, cyan for a contact to talk to, the dead in their own colours; a car of a livery in its paint: the police car's black and white, the taxi's yellow, the ambulance's white, the fire truck's red), wireframe boxes until the models are loaded; projectiles are boxes. A person's figure is animated every frame (figure.ts, its clips picked by anim-state.ts from its snapshot: its speed and footing, its status, its cover, its weapon, its act byte, its role and a guard's alert), a new act starting its one-shot (a recoil, a punch, a pickup), getting in at a car's door (the whole of the clip, before the simulation seats it) and out of it, an officer near a wanted player gesturing an arrest, an emote of the chat played over its player's character; with its back to a tall wall it hides behind. Going down, it goes limp (ragdoll.ts: flung as the capsule was, drifting toward it, getting up from where it lies). Far from the player a figure is posed every other frame. A seated character's node is hidden: riders.ts draws it at its seat. A glyph floats over a head (stealth-view.ts): a guard's "?" or "!", a sleeper's "z". A player back from lying dead is drawn see-through while a ghost (ghostLook). A dog (a character of the role dog, @foi/sim's dogs.ts) is no person: it is the dog model, posed by its own look (dog-view.ts: its gait by its speed, its head down to sniff, sitting, lying on its side when dead) and turned no faster than a dog turns, with no figure, ragdoll, cover, cone, glyph or weapon, and no dot on the minimap; its lead is drawn from its walker's hand to its collar while its snapshot says it is on it, and a new bark act of its is told to the game (Remotes.bark). Entities that stop appearing in snapshots are removed. The gunfire's effects ask who fired a shot (Remotes.shooter) and where a person is drawn (Remotes.nodeOf): a tracer leaves the shooter's gun, blood follows the person it came from.

A modelled actor is an ActorNode drawn by the models' batches (models.ts): it holds no mesh, so a change of colour, owner, class or a wreck needs nothing rebuilt, only the next frame's draw. A car is drawn with its doors as they swing (car-doors.ts) and the cracks in its glass (cracks.ts), which the game hands in as its CarDress. Every frame every remote is placed (the minimap and the sirens read where they are), but only those in the camera's view (view-rect.ts) are posed, drawn, given a glyph and handed to the tyres' effects.

Classes ​

Interfaces ​

Variables ​

Functions ​