Skip to content

UI improvements: grounding and shadows, two-weapon swings, water falls, bottom panel, XP bar - #104

Merged
kafuji merged 7 commits into
mainfrom
claude/ui-improvements-279a86
Nov 26, 2026
Merged

kafuji merged 7 commits into
mainfrom
claude/ui-improvements-279a86

Conversation

@kafuji

@kafuji kafuji commented Nov 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • Grounding and shadows. Every sprite is anchored on the floor for the current camera pitch: feet land a quarter square towards the viewer from the square's centre, a lying object's middle on the centre, and the shadow goes on that floor point. In high-resolution tile mode each kind of sprite casts its own shadow (grounding-profiles.ts): a contact shadow at the feet, a small soft shadow under floating monsters (which hover and bob), an object's own outline dropped slightly down-right, or none for things that shine. Other tile modes keep the round blob, now under the feet.
  • Hero poses. The hero floats while levitating or flying, sinks behind a waterline mask into pits, lava and water, and sits on its steed while riding.
  • Two-weapon swings. Swings come from the core's per-blow report (shim_hero_blow: hand and hit), so both hands swing; a hit stops at the impact, a miss carries through and the hero stumbles.
  • Falling into water. The core reports the fall (shim_water_fall); a stand-in goes under where the hero fell in while the hero waits hidden on the bank, then hops up there dripping. Seen monsters drowning splash too. The hero's move animation no longer strands a copy on a square the hero never reached.
  • Clicking into water. A map click onto known water next to the hero asks "Really step into the water?" instead of refusing (a click cannot carry the m prefix); identified water walking needs no question.
  • Bottom panel. The player position (without "- Polypiled") shares one bottom-centre panel with the terrain and trap here; an engraving and the objects here stack above it.
  • XP bar. Experience shows as a number and a bar towards the next level (curve mirrored from exper.c, checked by a test). HP, Pw and Exp bars mark losses, flash gains and roll over on a level up.

Core artifacts are the CI builds (runs 45856537672 and 45898256277); saves load both ways between this core and main's.

Test plan

  • npx tsc --noEmit, npx vitest run (2163 passed), vite build
  • Core smoke test and two-way save compatibility against main's core
  • Played in the browser by the user (shadows, water fall, swings)

🤖 Generated with Claude Code

kafuji and others added 7 commits November 27, 2026 01:09
Two new shim notifications for the interface's animations:

- shim_hero_blow (known_hitum): every melee blow the hero strikes, with
  the square struck, the hand it came from (the second blow of two-weapon
  combat or a double punch is the off hand) and whether it connected.
- shim_water_fall: the hero falling into water (drown()) or a monster the
  hero sees drowning (minliquid_core()).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tom panel; add an XP bar

- Grounding: each frame, sprites are posed by moving their anchor (never
  their position, so movement transitions are unaffected). The hero floats
  and bobs while levitating or flying, sinks into pits, lava and water,
  dips under and climbs out after a fall into water, and sits on a steed
  while riding. In high-resolution tile mode each kind of sprite casts its
  own shadow (feet, hover, silhouette or none, from grounding-profiles.ts),
  shaped from the alpha of its picture; floating monsters hover above it.
- Water splashes where the hero or a seen monster falls in, and drips where
  the hero climbs out.
- Weapon swings come from the core's per-blow reports instead of combat
  messages, so both hands of a two-weapon attack swing. A landed blow stops
  at the impact; a miss carries through and the hero stumbles. Only a
  swing at thin air still comes from its message.
- The player position (without "- Polypiled") shares one bottom-center
  panel with the terrain and trap here; an engraving and the objects here
  stack above it.
- The status bar shows experience as a number and a progress bar towards
  the next level (curve mirrored from exper.c and checked by a test). HP,
  Pw and Exp bars mark losses, flash gains, and roll over on a level up.
- docs: shadows in hires-tiles.md, the new core reports in
  rule-candidates.md, and the kept bottom-panel click idea in
  ui-candidates.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
public/nethack-5.js and public/nethack-5.wasm are the game-core-wasm
artifact of Build game core (WASM) run 45856537672 for 715fdfb. The
glyph catalog changes only in the recorded hashes. Saves load in both
directions between this core and the one on main
(scripts/wasm/save-compat-core.mjs).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A click cannot carry the 'm' prefix that lets a keyboard player step into
water the hero has seen, so a click on adjacent water was always refused
("You avoid stepping into the water."). A step chosen by a map click now
asks "Really step into the water?" and wades in on yes. Identified water
walking still needs no question, and lava and water walls are refused as
before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The animation of the hero's step waited at its destination until the game
confirmed the hero there. When the hero ended up elsewhere (fell into water
and crawled out onto the bank) or the step was refused, that confirmation
never came and a copy of the hero stayed on the square for good.

A confirmed square next to where the animation ends now becomes its next
stop, so the walk carries on there; a hold that is not confirmed within
1.2 s goes to the hero's real square or ends.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Sprites face the camera and lean back as it looks down, so their feet
  showed on the floor away from the square and the shadows came loose.
  Each frame every sprite now slides (by its anchor) so that its feet land
  a quarter square towards the viewer from the square's centre, or a lying
  object's middle on the centre, at any camera pitch, and the shadow goes
  on that floor point. A lying object's shadow is its own outline dropped
  a little down and to the right.
- A fall into water goes under where the hero fell in: a stand-in sinks
  there while the hero waits hidden on the bank it crawled out onto, then
  hops up there, dripping. No copy walks from the water to the bank.
- Sinking masks the picture below the floor line (a clipping plane), for
  the water fall and for a pit, lava and being underwater.

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

public/nethack-5.js and public/nethack-5.wasm are the game-core-wasm
artifact of Build game core (WASM) run 45898256277 for 8709cde. The
glyph catalog changes only in the recorded hashes. Saves load in both
directions between this core and the one on main
(scripts/wasm/save-compat-core.mjs).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kafuji
kafuji merged commit 57a570a into main Nov 26, 2026
2 checks 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.

1 participant