Skip to content

2.0.09: skip ESP labels and boxes outside the view; time overlay passes apart - #23

Merged
MrHakan merged 4 commits into
mainfrom
esp-frame-cost
Oct 10, 2026
Merged

MrHakan merged 4 commits into
mainfrom
esp-frame-cost

Conversation

@MrHakan

@MrHakan MrHakan commented Oct 10, 2026

Copy link
Copy Markdown
Owner

First render item after C1-C2 in the 2.1.00 plan (docs/MAJOR_GELISTIRME_PLANI.md): measure ESP's frame cost, then cut the larger half.

Four commits:

  1. LF for docs/MODULES.md: a Windows checkout with core.autocrlf=true failed ModuleDocsTest on a clean clone.
  2. Time each overlay's labels and lines apart. OverlayTimings.slowestParts records "ESP labels" / "ESP lines" next to the totals; the widget is unchanged. First split reading: ESP labels 746 us, ESP lines 381 us.
  3. Skip ESP labels and boxes outside the view; format labels without a Formatter. Labels skip a target whose label space (box grown 2 blocks sideways, 1 up) is out of view; boxes use the same ViewCulling StorageESP and ItemESP use; tracers are never culled. Distance and health go through OverlayDraw.appendTenths, which defers to String.format near a rounding tie, so label text is identical (unit test against String.format over 160,000 values).
  4. Release 2.0.09 docs.

Measured locally, same 300-stand scene, five 120-frame windows each, before -> after:

View ESP total labels lines
facing the stands 354 -> 290 us 201 -> 161 152 -> 129
facing away 361 -> 52 us 214 -> 41 147 -> 10

A box writer computing normals once per axis instead of per edge was tried and dropped: bit-identical output but no measurable gain, since the cost is the vertex writes.

The shared-walk game test now faces the stands before measuring (the figure used to depend on where the previous scenario left the camera), logs both passes, and checks the culling: facing the targets ESP draws labels and boxes (control: 256 labels, 246 boxes); turned away it draws none and still draws all 256 tracers.

Local validation on 73bf591 (Windows, JDK 25): ./gradlew build (945 tests), runClientGameTest (all client game tests; dedicated-server scenarios skipped without the EULA), the real-Baritone acceptance run and productionAddonInstallationTest passed.

🤖 Generated with Claude Code

MrHakan and others added 4 commits October 10, 2026 11:37
ModuleDocsTest renders the page and compares it with the file on disk byte for byte, rewriting it
when they differ. On a Windows checkout with core.autocrlf=true the file arrives with CRLF, so a fresh
clone failed the build with a "MODULES.md was out of date" message although nothing had changed.
Pinning the generated page to LF keeps the test strict about content without making it depend on how
the repository was checked out. No other test compares a checked-in file byte for byte.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
OverlayTimings added an overlay's two passes into one per-frame sample, which is the right figure for
the HUD but cannot say where the time goes. ESP submits a name tag and writes a box for every target,
and the 2.0.05 measurement (ESP 1.2-3.7 ms a frame with 256 targets) could not tell which of the two
an optimisation should cut.

The frame now keeps the two passes apart and the store records them a second time, as "ESP labels"
and "ESP lines", behind slowestParts(). The totals and the Module Timings widget are unchanged. The
overlay frame cost scenario logs both. On the first run here, with 300 armor stands in view:
ESP labels 746 us, ESP lines 381 us, Nametags labels 94 us (64 tags), Tracers lines 33 us.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…a Formatter

With the two passes timed apart, ESP's labels were the larger half: about 200 us a frame against
150 us for the boxes with 256 armor stands in view, and the same again with every one of them behind
the player, because neither pass looked at the view.

Labels now skip a target whose label space is outside the frame's view volume: the entity's box
grown two blocks sideways and one upwards, more than vanilla allows its own name tags. Boxes use the
ViewCulling test StorageESP and ItemESP already use. Tracers are never culled, since a tracer to a
target behind the player is what one is for. The distance and health in a label are formatted by
OverlayDraw.appendTenths instead of String.format; it falls back to String.format near a rounding
tie, so the text is identical, which a unit test checks against String.format over 160,000 values.
Entity.distanceTo stays: it works in float, so sqrt(distanceToSqr) would not give the same numbers.

Measured locally over five 120-frame windows each, same scene, before and after:
facing the stands, ESP 354 -> 290 us (labels 201 -> 161, lines 152 -> 129);
facing away, ESP 361 -> 52 us.
A rewritten box writer that worked out normals once per axis was tried and dropped: identical
output, but no measurable gain, because the cost is in writing the vertices.

The shared-walk scenario now faces the stands explicitly before measuring, so its figure no longer
depends on where the previous scenario left the camera, waits for up to 60 frames where the renderer
allows, and checks the culling: facing the targets ESP draws labels and boxes (the control); turned
away it draws none, and still draws a tracer to each of the 256. WorldOverlays.lastEspDrawn exposes
the counts for that.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Raises mod_version to 2.0.09 and records the ESP measurement in the changelog, the 2.1.00 plan
(C3's ESP note is done; the release table moves C3, E4, E2 and D5 to 2.0.10 onwards) and the
handover notes, including how to measure overlays locally without waiting for the whole suite.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 10, 2026 09:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@MrHakan
MrHakan merged commit 3a1ef4b into main Oct 10, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants