summaryrefslogtreecommitdiffstats
path: root/CONTEXT.md
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-10-27 13:48:27 +0100
committersalmonik <salmonik@tuta.io>2026-10-27 13:48:27 +0100
commit471f022f449a18766fedb1ff0a4204a933b95b9c (patch)
tree499fcd29f1c9f7933aade3f8ffad88b3ef10f377 /CONTEXT.md
parentscript: change the map for tests (diff)
downloadhl2h-471f022f449a18766fedb1ff0a4204a933b95b9c.tar.gz
hl2h-471f022f449a18766fedb1ff0a4204a933b95b9c.zip
Jumpbug: optional velocity-timed assist
The unduck window is only 2 units, while a 625-ups fall moves ~9.3 units per 66.7 Hz movement command, so pure jumpbug is ~20% reliable at that speed. - Add Jumpbug -> Assist timing (default off). When the natural next command would skip [36,38], pin the post-command ducked distance to 37 by writing the vertical velocity for that command. Pure jumpbug remains available with the option off. - Resolve the client local m_vecAbsVelocity (0x11C) via the client datamap and the server m_vecAbsVelocity (0x228) via the server datamap. - Write both the authoritative server velocity (what SetupMove reads through GetAbsVelocity) and the local prediction fields, so the next CreateMove sees the assisted origin on both sides. - Do not write the server m_vecVelocity directly: the datamap scan finds two same-named entries (0x1C and 0x29C); SetAbsVelocity syncs it after movement.
Diffstat (limited to '')
-rw-r--r--CONTEXT.md17
1 files changed, 17 insertions, 0 deletions
diff --git a/CONTEXT.md b/CONTEXT.md
index b1ec4e7..38d9373 100644
--- a/CONTEXT.md
+++ b/CONTEXT.md
@@ -80,6 +80,7 @@ Relevant vtable slots (this build):
80| `m_vecMins` / `m_vecMaxs` | `0x1A8` / `0x1B4` | 80| `m_vecMins` / `m_vecMaxs` | `0x1A8` / `0x1B4` |
81| `m_lifeState` | `0x7F` | 81| `m_lifeState` | `0x7F` |
82| `m_nModelIndex` | `0x7C` | 82| `m_nModelIndex` | `0x7C` |
83| `m_vecAbsVelocity` (client local, not netvar) | `0x11C` |
83 84
84- Eye position = `m_vecOrigin + m_vecViewOffset` on **all three axes**. 85- Eye position = `m_vecOrigin + m_vecViewOffset` on **all three axes**.
85 (The old code added the X component to Z, which left the eye ~64 units low.) 86 (The old code added the X component to Z, which left the eye ~64 units low.)
@@ -106,6 +107,7 @@ HL2hake
106 Active 107 Active
107 Jumpbug 108 Jumpbug
108 Active 109 Active
110 Assist timing
109 ESP 111 ESP
110 Active 112 Active
111 Show neutral / healthbar / healthnum / name / skeleton / box / speed graph 113 Show neutral / healthbar / healthnum / name / skeleton / box / speed graph
@@ -181,6 +183,21 @@ Binds use SDL scancodes; mouse buttons are pseudo-scancodes 600..604.
181- `drop` is measured from consecutive predicted origins (not a hard-coded tick 183- `drop` is measured from consecutive predicted origins (not a hard-coded tick
182 interval). At high fall speeds the 2-unit band can be skipped between 184 interval). At high fall speeds the 2-unit band can be skipped between
183 commands; a higher frame rate improves reliability. Best-effort by design. 185 commands; a higher frame rate improves reliability. Best-effort by design.
186- **Assist timing** (off by default): when the natural next command would jump
187 over the 2-unit window, force the post-command distance to 37 by writing the
188 vertical velocity. It needs both the authoritative server velocity and the
189 client prediction velocity:
190 - server `CBaseEntity::m_vecAbsVelocity` (datamap offset 0x228), read by
191 `SetupMove` via `GetAbsVelocity`;
192 - client `C_BaseEntity::m_vecAbsVelocity` (datamap offset 0x11C) and the
193 networked `m_vecVelocity` (0xE0 + 8).
194 The velocity is `dz / 0.015 + 0.5 * 600 * 0.015` where `dz` is the required
195 displacement for this command. This turns the ~20% timing success at 625 ups
196 into a repeatable setup, at the cost of one command with a nudged vertical
197 speed. Pure jumpbug remains available with Assist off.
198- The server datamap has two `m_vecVelocity` entries (0x1C and 0x29C), so the
199 assist deliberately writes only `m_vecAbsVelocity`; `SetAbsVelocity` syncs
200 `m_vecVelocity` after the command.
184 201
185## Gotchas / lessons 202## Gotchas / lessons
186 203