Split The code is public; the app answers only to the crew.
Getting shot tells you: a directional damage indicator, a hurt vignette and a pain sound #10
Sign in to join this conversation.
Split The code is public; the app answers only to the crew.
Close the other half of hit feedback — right now you can hit a bot and see it, but being hit yourself is silent and invisible.
shootinsrc/client/world.tspushes ahitmarkeffect only when the shooter isworld.me, andapplyHitinsrc/client/combat.tschanges numbers and nothing else. The victim gets no sound, no flinch and no hint of direction: the health number in the corner drops and that is the whole story. On de_forge, where the shot usually comes from a corridor you are not looking at, this is the single biggest reason a round feels unfair. The bomb detonation inupdatekills people with the same silence.The simulation is the tested part, so the event belongs there: add a
hurteffect to theEffectunion carryingat, the victim, the world position the damage came from and the amount, push it fromshootand from thebomb_timeoutbranch, and lethud.tsandaudio.tsread it. The effects list is already trimmed to two seconds inupdate, so the indicator's lifetime has to fit inside that or the trim window has to move — say which you chose.Done looks like
world.tsemits ahurteffect for every point of damage a player takes, from bullets and from the bomb, with the source position and the amount.punchalready does, so a burst to the chest is felt and does not make the player uncontrollable.hud.tsdraws a directional wedge around the crosshair pointing at where the damage came from, in the yaw frame of the player being drawn, fading over about a second and stacking when several hits land.drawHud.audio.tsplays a short pain tone on taking damage, distinct from the hit beep the shooter hears, and it does not stack into noise when a full rifle burst lands.bun testcovers the headless half: a bullet that hits the player pushes exactly onehurtwith the shooter's position and the damage actually dealt, a bullet that hits a wall pushes none, and the bomb going off hurts everyone inside the radius.bun run scripts/build.tsrun and the rebuilt bundle committed.Files I expect to change
src/client/world.ts,src/client/world.test.ts,src/client/hud.ts,src/client/audio.ts,src/client/main.ts(playing the new sound alongsideplaySounds),static/app.<hash>.js, and a line in the README's "What is real" list.Risks
The bots observe the world through
src/client/observe.tsand the arena insrc/rl/steps the sameupdate; adding to theEffectunion must not change what a bot sees or the shipped policy's numbers stop matching the card on the page. Keep the effect out ofobserve. A view punch on the victim is a real change to the fight, so keep it small and make surebun testinsrc/rl/arena.test.tsstill passes.Who
A builder comfortable in the simulation and the HUD canvas. Worth doing before the spectator and match-summary work, since both land in the same two files.