Repository navigation
Kill feed: an even layout where every weapon icon has the same height and nothing is cut off (#1022) - #1023
Conversation
Option b for the MP44 beside cut_part's option a: the barrel stays on its row and the gun shrinks until what hangs below ends inside the rect. No icon sets it yet; output stays VERSION 13. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
render_icon takes an optional Layout: a rect height and width other than hud.txt's, a shared barrel row, and a size rule (Valve's width, the table's natural size, or a fixed pixels-per-model-unit scale), with a gun that doesn't fit shrunk, moved or cut. The table's own placement stays the reference, and the hand-set places of v_part, skin_art and cut_part are moved with the gun (remap_table). build() never passes a layout, so the painted sheets are unchanged; renders without one are byte-identical. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…#1022) ds_hud_deathmsg layout even draws every kill-feed icon in a box 26 stock rows tall from an atlas of our own, so every line steps the same and full magazines and bipods show; layout default (the default) is the game's own boxes and spacing with today's HD icons. - killfeed_icons.py --even renders R2 (the user's pick on #1022) into sprites/dodstudio_killfeed.spr + .txt (dod_addon) and the HD frames dodstudio_killfeed_<n>_<hash>.tga. The sprite's own pixels are a placeholder from the boxes alone, so every style shares it. build() and the sheets are untouched: 35 of 35 table renders byte-identical. - deathmsg/even.rs loads and bounds-checks both files, maps sprite indices to boxes by gHUD.m_rgszSpriteNames (gHUD+0x190), and draws only while every atlas frame went up with its HD file and ds_hd_enabled is 1. - scale.rs: the line-start stub also stores the sprite index, the copy holds the boxes (at scale 1 too), and the icon draw draws the box of the atlas through hud_sprites::draw_holes_instead. - verify_killfeed_scale_offsets.py checks the names field. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It takes under a minute (36 s for POST's 42 icons), and without it layout even only works after a hand run of killfeed_icons.py --even. A failure there leaves the game's layout and never fails the sprites step. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…1022) The engine keeps a sprite's first upload, HD frames included, until it exits, so `layout even` typed again after a rebuild laid the old pixels out by the new table's boxes. The hook now remembers the files it first handed the engine and refuses others until a restart, saying why. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review and in-game smoke test (agent)ReviewI read the whole diff: Fixed, 7e1bbea: typing Checked, no change needed:
Tests: In game (Brain account,
|
…out-1022 # Conflicts: # docs/dodstudio_commands.md # goldsrc-hooks/src/deathmsg.rs # goldsrc-hooks/ui/Commands.txt
|
Merged dev (after #1026 and #1034) in; head
|
Release note: New: ds_hud_deathmsg layout even draws every kill-feed weapon in the same height box, full magazines and bipods shown; the default stays the game's own layout.
Closes #1022
Supersedes #995 (cutting the MP44's magazine): the user picked R2 instead. This branch is built on #995's, which changed no output, so #995 can be closed.
What it does
ds_hud_deathmsg layout even: every kill-feed icon in a box 26 stock rows tall (timesscale), every long gun's barrel top on row 8, nothing cut. So every line steps the same (65 px atscale 2.5, 26 atscale 1) and the names are centred on it.ds_hud_deathmsg layout defaultis the default: the game's own boxes and spacing with today's HD icons, exactly as now.scaleandfont, and works atscale 1with no font.layoutsays. The bareds_hud_deathmsgstatus says whyevenisn't drawing.How
The atlas. The engine samples the texture from the same rect the layout reads, and Valve's sheets are packed too tight for 26-row boxes. So
killfeed_icons.py --evenrenders the icons into an atlas of our own:sprites\dodstudio_killfeed.sprand.txt(name frame x y w h), indod_addon;dodstudio_killfeed_<n>_<hash>.tga, in the style's sprites folder.sprites_hd.pynow runs it after the sheets' icons. It took 36 s for POST's 42 icons.The hook (
deathmsg/even.rs, new):SPR_Loadonce per level load;gHUD.m_rgszSpriteNames(gHUD+0x190).scale.rs:scale 1too;hud_sprites::draw_holes_instead: atlas set with the game's colour, the engine'sSPR_DrawHoles, blended like a soft sheet, then the game's sprite set back.ds_map_hide_assetstill hides a hidden icon.Both engine builds. Nothing in
hw.dllis touched, and the sprite calls go throughgEngfuncs.client.dllis byte-identical on PRE and POST. The one new client.dll address (the names field) is checked bytools/verify_killfeed_scale_offsets.py(ALL OK, both installs).Hot path. Per frame: atomics only. The files are read once per level load, and the per-index box table is rebuilt only when the names array or the table changes. Everything runs on the engine thread.
Decisions you may want to know
.spr's own pixels are grey placeholder boxes, made from the boxes alone. So the sprite, and its HD key, are the same for every style. The even layout only draws when every frame of the atlas went up with its HD file andds_hd_enabledis 1; otherwise it keeps the game's layout.ds_hd_enabled 0mid-session gives the game's layout from the next frame. The engine keeps an uploaded sprite until the game exits, so Valve's sheets keep whatever icons they loaded with until a restart: stock icons need a restart with HD off.d_skull/d_world, the bayonet close-ups and the mortars keep their HD HUD sprite atlases through the texture hook, uploaded with mipmaps (part of #728) #733 upscale, centred;layout evencounts as "our layout", so the 1/160 right margin and centred names apply atscale 1with no font too.LocalRustDevcertificate in this user's store, and every otherlocal\test-*DLL is unsigned too.Tests done
cargo test -p goldsrc-hooks --target i686-pc-windows-msvc: 800 passed. New tests cover:.sprparsing, with bad files refused;cargo fmt --all --check: clean.python -m unittest test_killfeed_icons: 68 OK (7 new: rules per class, packing, sprite round trip, placeholder, table, fit).build()paints) are byte-identical to the pre-branch ones.tools/verify_killfeed_scale_offsets.py: ALL OK, including the new names check.local\test-1022\hd-output\. The review sheets inlocal\review-images\1022\build\lay the feed out from those files:atlas.png;feeds_scale2.5.png: default steps 33–85 px, even steps 65 px on every line;feeds_scale1.png.In-game test (PRE and POST)
DLL:
local\test-1022\dodstudio_goldsrc_hooks.dll. Pick1022in Configuration → Paths → GoldSrc Hooks DLL.Install the atlas (the same files on both installs; on PRE the icons then show POST's skins). Copy:
local\test-1022\hd-output\dod_addon\sprites\dodstudio_killfeed.spranddodstudio_killfeed.txt→<install>\dod_addon\sprites\local\test-1022\hd-output\dod_addon\dodstudio_hd\sprites\ultrasharp\dodstudio_killfeed_0_b1149160.tgaanddodstudio_killfeed_1_b5d83aa0.tga→<install>\dod_addon\dodstudio_hd\sprites\ultrasharp\Don't copy
killfeed_icons.jsonfrom there: it would replace the install's record.Or build straight into an install with the tool (writes the same files and the record):
set HD_GAME=<install>thenpython goldsrc-hooks\tools\hd\killfeed_icons.py "<install>\dod_addon\dodstudio_hd\sprites\ultrasharp" --evenLaunch from Studio (it passes
-addons), withds_hd_style ultrasharp. Steps for POST, then the same on PRE:viewdemo solifotw-greetz1, thends_demo_seek_to 466.hud_deathnotice_time 60keeps the notices up.ds_hud_deathmsg max 8; ds_hud_deathmsg fake 1 2 mp44; ds_hud_deathmsg fake 2 1 30cal; ds_hud_deathmsg fake 1 2 colt; ds_hud_deathmsg fake 2 1 bren; ds_hud_deathmsg fake 1 2 grenade; ds_hud_deathmsg fake 2 1 garandbuttds_hud_deathmsg layout even. The reply should saylayout = even: every kill-feed icon in a box of one height (42 icons).ds_hud_deathmsg scale 2.5. Expect:ds_hud_deathmsg layout default: today's uneven look, from the next frame.ds_hud_deathmsg layout even, thends_hud_deathmsg scale 1: 26 px lines, names centred on each.ds_hd_enabled 0: the game's layout from the next frame.ds_hud_deathmsgshould saylayout = even, waiting: HD is off. Thends_hd_enabled 1: even again.ds_demo_reload(a level load): still even after it.Log lines (
dodstudio_goldsrc_hooks_<date>.log):deathmsg layout: sprites/dodstudio_killfeed.spr loaded as handle N: 42 box(es) in 2 frame(s)deathmsg layout: 42 of the HUD's N sprites draw from the atlasIf step 3 says waiting: the reply names why. For example, the atlas went up without its HD files: a wrong style folder, or HD was off at the first load, which needs a restart.
🤖 Generated with Claude Code