Skip to content

notes: spread a kill's drops instead of stacking them on one tile - #167

Merged
mcdope merged 1 commit into
masterfrom
notes/spread-kill-drops
Aug 27, 2026
Merged

mcdope merged 1 commit into
masterfrom
notes/spread-kill-drops

Conversation

@mcdope

@mcdope mcdope commented Aug 27, 2026

Copy link
Copy Markdown
Owner

Backlog item only — one file, no code.

Spread kill drops on tile, right now N drops can stack and visually it's only one.

Verified before writing it down

N is 3. Every drop from a kill is pushed at exactly enemy.x, enemy.y:

Drop Site
guaranteed health pack engine.ts:6125
ammo/swap roll, or its Toolchain consolation engine.ts:6152 / :6159
bonus-weapon roll engine.ts:6164
Elite guaranteed drop + bonus weapon lootApply.ts:156/:158, :167

So a regular kill can leave three drops on identical coordinates and an Elite two. The renderer applies no offset — sprites.ts:778 projects raw drop.x/drop.y — so they draw as perfectly overlapping billboards and the player sees one pickup.

Two things the observation alone doesn't carry

It is cosmetic, which is why it went unnoticed. collectLoot walks every drop within AMMO_PICKUP_RADIUS, so the whole stack is picked up and nothing is lost. The bug is that you can't tell there was anything to notice.

The fix has a trap worth recording now rather than rediscovering. Jittering the position off the shared PRNG stream shifts every subsequent draw, re-rolling the layout of every level ever generated and invalidating stored replays — the same constraint that keeps the styleset on its own salted stream and planAcidOverflows at zero draws.

The drops are pushed in a fixed order and already carry a per-enemy sequence number (pushLootDrop's dropSeq), so an index-derived offset spreads them deterministically, costs no rng draw, and changes no existing map.

Verification

notes only — nothing to build or test. Diff is purely additive (4 added, 0 removed), checked because that file is edited concurrently.

🤖 Generated with Claude Code

https://claude.ai/code/session_017ncJfux8GDacSTeLDcqrhr

Backlog item only, no code. Verified before writing it down rather than
recording the observation as-is:

Every drop from a kill is pushed at exactly `enemy.x, enemy.y` — the guaranteed
health pack (engine.ts:6125), the ammo/swap roll or its Toolchain consolation
(:6152/:6159), the bonus-weapon roll (:6164), and both Elite pushes
(lootApply.ts:156/:158/:167). A regular kill can therefore leave three drops on
identical coordinates and an Elite two. The renderer applies no offset —
sprites.ts:778 projects raw drop.x/drop.y — so they draw as perfectly
overlapping billboards.

Recorded two things the observation alone does not carry. It is cosmetic:
collectLoot walks every drop within AMMO_PICKUP_RADIUS, so the whole stack is
collected and nothing is lost, which is why nobody noticed. And the fix has a
trap — jittering the position off the shared PRNG stream would shift every
subsequent draw, re-rolling every level and invalidating stored replays. The
drops already carry a per-enemy `dropSeq`, so an index-derived offset spreads
them deterministically at no cost.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@mcdope
mcdope merged commit 8f159de into master Aug 27, 2026
21 checks passed
@mcdope
mcdope deleted the notes/spread-kill-drops branch August 27, 2026 00:22
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.

1 participant