From 27c9ad766e1b1333922b4c14cbde9d9b77c8dab0 Mon Sep 17 00:00:00 2001 From: salmonik Date: Tue, 27 Oct 2026 15:22:19 +0100 Subject: Spread control: client-seed no-spread HL2's CBaseEntity::FireBullets seeds its RNG from the usercmd random_seed (m_bUseServerRandomSeed is false for HL2 weapons), so the client can select the 8-bit seed that puts CShotManipulator::ApplySpread closest to the center. - New feature Spread control -> Active / No spread (both default on). - Precompute the best seed for a single shot and for the shotgun's 8-shot primary (first pellet accurate) and 12-shot secondary windows using the engine's own RandomSeed/RandomFloat from libvstdlib. - Set cmd->random_seed on attack commands; note_modified repairs the CRC. - The random cone offset is neutralized, but the cone size, the pistol accuracy penalty, server view punch and any damage falloff remain server-side; stock HL2 has no distance damage falloff. --- CONTEXT.md | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'CONTEXT.md') diff --git a/CONTEXT.md b/CONTEXT.md index 8fb2197..861fbf8 100644 --- a/CONTEXT.md +++ b/CONTEXT.md @@ -111,6 +111,9 @@ HL2hake Assist timing Melee killbot Active + Spread control + Active + No spread ESP Active Show neutral / healthbar / healthnum / name / skeleton / box / speed graph @@ -186,6 +189,27 @@ Binds use SDL scancodes; mouse buttons are pseudo-scancodes 600..604. - Vischeck uses the shared `MASK_VISIBLE`/world-only path (static props are ignored). +## Spread control + +- HL2's `CBaseEntity::FireBullets` seeds its RNG from + `CBaseEntity::GetPredictionRandomSeed(info.m_bUseServerRandomSeed)`; HL2 + weapons leave `m_bUseServerRandomSeed` false, so the server uses the + client usercmd's `random_seed` (masked to 8 bits). This is the TF2-style + client-side seed hook. +- `Spread control -> No spread` precomputes, with the engine's own + `RandomSeed`/`RandomFloat`, the 8-bit seed whose + `CShotManipulator::ApplySpread` offset is smallest. It sets + `cmd->random_seed` on attack commands; `note_modified` repairs the CRC. +- Shotguns use consecutive seeds per pellet. The primary's first pellet is + `FIRE_BULLETS_FIRST_SHOT_ACCURATE`, so the table excludes it; the secondary + uses all 12. Separate best starting seeds are precomputed for 1, 8 and 12 + pellets. +- This attacks the random cone offset only. The cone size, the pistol's + `m_flAccuracyPenalty` growth, the server view punch added to + `GetAutoaimVector`, and any damage falloff are server-side state. In + single-player those can be written/hooked locally; stock HL2 has no + distance damage falloff. + ## Jumpbug - Automatic while falling when the predicted landing speed @@ -237,6 +261,8 @@ Binds use SDL scancodes; mouse buttons are pseudo-scancodes 600..604. - **GUI**: replace/augment the VGUI ISurface menu with an immediate-mode GUI (Dear ImGui or a custom implementation); needs a design grill first. -- **Distance weapon spread thesis**: TBD — user will explain. Likely models - weapon spread as a function of distance for aim/trigger decisions or visuals. +- **Server-side spread/recoil control**: optional single-player writes to the + pistol accuracy penalty and view punch, and a true zero-cone hook if wanted. +- **Distance weapon spread thesis**: addressed by Spread control; stock HL2 + hitscan damage is range-independent, so distance efficiency is the cone. -- cgit v1.2.3