Put a radar in the corner of the HUD — the map around you, your team, the sites and the bomb, rotated so your view is up — so a player who has never seen de_forge can navigate it instead of wandering into a wall.
The map is already one piece of data (map.grid, map.sites, map.walkable, map.worldOf) and the HUD already draws everything else the round is telling you. There is no minimap anywhere in the repository.
Done looks like
[ ] A new module — src/client/radar.ts — turns (world, view, radius) into plain data and draws nothing: a list of blips, each with a position in radar space (−1..1 on both axes), a kind (self, mate, bomb, site) and, for self, a facing. Rotated so the view's yaw points up.
[ ] src/client/radar.test.ts: a teammate due north of a player facing north sits above the centre; the same teammate with the player facing east sits to the left; a teammate beyond the radius is dropped or clamped to the edge — pick one, say which, and test it; the person themself is always at the centre.
[ ] Enemies are not on it. A radar that shows the other team is a wallhack; the bomb, the sites and your own side are the information you are owed.
[ ] The map behind the blips is drawn once at boot into an offscreen canvas from map.ts's walkable cells and blitted each frame. Re-walking 1,936 cells sixty times a second is work nobody asked for; the cached vignette in hud.ts is the pattern to copy, including what happens when the canvas size changes.
[ ] hud.ts places it where it collides with nothing it already draws (the money line is top-left, the kill feed top-right, the clock top-centre), scaled off the existing scale, and at 360px wide it takes no more than about 28% of the width.
[ ] It belongs to view, not world.me: a spectated teammate's radar is theirs, like the rest of the HUD.
[ ] The planted bomb blips, and the sites are marked A and B so "rotate to A" means something.
[ ] The fps counter is on screen — say what the frame time read before and after, on the same machine.
[ ] bun test passes; the README's HUD sentence says the radar is there and that it does not show enemies.
The HUD canvas is cleared and redrawn every frame at the full device ratio — the scene gives up pixels under load and the HUD never does. Nothing in the radar may allocate per frame.
The offscreen canvas must be rebuilt when the HUD canvas size changes and not once per frame in the process; hurtVignette's size key is the existing answer to that.
hud.ts reads the world and changes nothing. Keep it that way — the blip list comes from radar.ts.
A phone is a first-class client here: whatever corner it takes has to survive the touch buttons that will be laid out around it (#D below waits on this one for that reason).
Crew
vesper — canvas, a camera you can trust, and the frame time measured.
Put a radar in the corner of the HUD — the map around you, your team, the sites and the bomb, rotated so your view is up — so a player who has never seen de_forge can navigate it instead of wandering into a wall.
The map is already one piece of data (
map.grid,map.sites,map.walkable,map.worldOf) and the HUD already draws everything else the round is telling you. There is no minimap anywhere in the repository.Done looks like
src/client/radar.ts— turns(world, view, radius)into plain data and draws nothing: a list of blips, each with a position in radar space (−1..1 on both axes), a kind (self,mate,bomb,site) and, forself, a facing. Rotated so the view's yaw points up.src/client/radar.test.ts: a teammate due north of a player facing north sits above the centre; the same teammate with the player facing east sits to the left; a teammate beyond the radius is dropped or clamped to the edge — pick one, say which, and test it; the person themself is always at the centre.map.ts's walkable cells and blitted each frame. Re-walking 1,936 cells sixty times a second is work nobody asked for; the cached vignette inhud.tsis the pattern to copy, including what happens when the canvas size changes.hud.tsplaces it where it collides with nothing it already draws (the money line is top-left, the kill feed top-right, the clock top-centre), scaled off the existingscale, and at 360px wide it takes no more than about 28% of the width.view, notworld.me: a spectated teammate's radar is theirs, like the rest of the HUD.bun testpasses; the README's HUD sentence says the radar is there and that it does not show enemies.Files I expect to change
src/client/radar.ts(new),src/client/radar.test.ts(new),src/client/hud.ts,src/client/hud.test.ts,README.md.Risks
hurtVignette's size key is the existing answer to that.hud.tsreads the world and changes nothing. Keep it that way — the blip list comes fromradar.ts.Crew
vesper — canvas, a camera you can trust, and the frame time measured.