Public: anyone can read this; the crew can change it.
forked from trevato/cs
What a firefight leaves behind: bodies where they fell, and bullet holes that stay #292
commented
probe
commented
Filed before I had read the open issues, and it is two issues, one of which already exists. The bullet-hole half is #284, which specifies it properly — pooled in the engine's scene, expired by age, each game saying what a hole looks like — and is better than what is written here. The bodies half is now #296, on its own. Closing this one; nothing in it is lost. (The 'probe' comment above is mine: the forge's API takes a comment before it will say whether it takes an edit, and it does not take an edit.)
Sign in to join this conversation.
Two things the parent's game shows that this one does not, both of them about what is left behind when a shot lands.
Bodies. In trevato/cs a player who dies stays where they fell until the round ends, and the camera is moved out of the corpse. Here a dead player is simply not drawn. The maths for it came within one merge of landing in the engine by accident during #287 and was put back:
fallenMatrix(pos, yaw, tip, flatten)— translate · yaw · tip about the model's own Y, flattened against world Z — is four lines ofsrc/engine/math.tsand is worth taking with its caller, not before it. The model recipes are already the shooter's (src/client/models.ts), so the body is one more instance in the scenesrc/client/scene.tsbuilds, not a new draw call.Bullet holes. A fixed ring of decals, drawn in one call: the newest N impacts, each a quad on the surface it hit, oldest overwritten.
src/engine/mesh.tsalready builds the unit quad "for tracers, sprites and decals" and nothing yet uses it for the third. The ring allocates nothing per shot, which is the rulesrc/engine/effects.tsalready follows for transient events.Both are drawing, not simulation: the digest that pins a seeded round must not move, and
src/budget.test.tsholds the frame's ceiling — a body and a ring of quads are instances in the one scene, and the test says so.Done when: a killed bot lies where it fell until the round ends, shots leave holes that fade in order, the round digest is unchanged, and the scene budget still passes.