[PR #474] [MERGED] Name tags show through walls #2593

Closed
opened 2026-11-02 15:57:27 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/474
Author: @ludovic111
Created: 10/16/2026
Status: ✅ Merged
Merged: 10/16/2026
Merged by: @ludovic111

Base: main ← Head: fix/lan-name-tags-through-walls


📝 Commits (10+)

  • dac18e8 LAN: mobs target and attack guests
  • 327aa5a tools/lan_e2e.py: a world with commands, so the guest's commands run again
  • 600bae5 LAN guest: hurt by lava, fire, drowning, suffocation and the void; hungry from moving
  • 2e12123 tools/lan_e2e.py: hazards counts the food spent from full health
  • 36d7f02 LAN: PvP between the host and guests
  • e289980 LAN guest: their own ender chest, and double chests as 9x6
  • 64f7ecd tools/lan_e2e.py: containers takes its chests away
  • 257b5e9 tools/lan_e2e.py: containers waits for the server's menu before reading or taking
  • bc0cd9c LAN guest: a use packet uses the item alone
  • 11130e6 LAN guest: command feedback names the guest and shows its numbers

📊 Changes

25 files changed (+1546 additions, -228 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+85 -44)
📝 crates/horizon-client/src/game/agent.rs (+1 -1)
📝 crates/horizon-client/src/game/commands.rs (+9 -5)
📝 crates/horizon-client/src/game/control.rs (+12 -0)
📝 crates/horizon-client/src/game/creatures.rs (+74 -9)
📝 crates/horizon-client/src/game/hand.rs (+1 -0)
📝 crates/horizon-client/src/game/lan.rs (+11 -0)
📝 crates/horizon-client/src/game/lan_actions.rs (+136 -28)
➕ crates/horizon-client/src/game/lan_mobs.rs (+305 -0)
➕ crates/horizon-client/src/game/lan_pvp.rs (+110 -0)
📝 crates/horizon-client/src/game/names.rs (+133 -80)
📝 crates/horizon-client/src/game/remote.rs (+47 -1)
📝 crates/horizon-client/src/game/storage.rs (+7 -1)
📝 crates/horizon-client/src/game/trial_spawner.rs (+17 -4)
📝 crates/horizon-client/src/game/vault.rs (+10 -5)
📝 crates/horizon-client/src/gfx.rs (+45 -9)
📝 crates/horizon-client/src/gfx/entity_batch.rs (+7 -4)
📝 crates/horizon-client/src/lan/containers.rs (+26 -27)
📝 crates/horizon-client/src/lan/guest.rs (+6 -0)
📝 crates/horizon-client/src/lan/hub.rs (+3 -0)

...and 5 more files

📄 Description

Part of #435 ("Name tags aren't drawn through walls"). Stacked on #473: merge #466 → #467 → #470 → #471 → #472 → #473 first.

This isn't LAN-specific: no name tag (players, named mobs) was drawn through blocks.

What vanilla does

SubmitNodeCollection.submitNameTag, called with seeThrough = !isDiscrete:

  • Not discrete: the name is drawn twice.
    • In full in the normal pass: opaque text, no background, light with emission 2.
    • Again in the see-through phase (RenderPipelines.TEXT_SEE_THROUGH: translucent, no depth test): faded text (alpha 127) on its background. LevelRenderer.executeSeeThrough draws this phase after the rest of the world.
  • Discrete (a crouching player): drawn once, in the normal pass, faded, on its background, so a wall hides it.
  • The background is ARGB.color(getBackgroundOpacity(0.25), black) = alpha 0x3F. Before, we used 0x40.

What changes

  • names.rs builds a NameTag (position, lines, light, discrete) and emits each tag as vanilla does. The see-through copy goes into a new see_through vertex list.
  • gfx.rs gets a see_through frame slice and a "See-through text" entity pipeline (CompareFunction::Always, no depth writes, alpha blend). It is drawn at the end of the world pass, after clouds.

How it was verified

New two-client check in tools/lan_e2e.py, walls, with a host and a guest on this Mac (two offscreen clients via the control socket):

  • Steps:
    • A stone wall is put between the host and the guest.
    • The host looks at where the guest's tag hangs.
    • The host takes three screenshots: the guest standing, crouching, then standing again. The check waits 210 ticks first, so chat has faded.
    • It counts the pixels that differ between the shots.
  • Result: walls: PASS {'standing_vs_crouching': 1158, 'standing_twice': 0}. The standing shot shows the faded "Guest" tag through the stone; the crouching shot shows plain stone.
  • Control: without the Rust change, the same check fails with no name tag through the wall: 0 pixels differ standing vs crouching.
  • nametags (the tags in the open) still passes. In the guest's screenshot the background box covers the whole name; over the sky it darkens by about 25%.

Follow-up (after a full 14-check run on the combined stack)

  • lan status lists each guest's sneaking.
  • walls now:
    • waits until the host sees the guest crouch and stand;
    • puts the wall halfway between the players;
    • respawns a dead guest first;
    • runs right after nametags.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/474 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/16/2026 **Status:** ✅ Merged **Merged:** 10/16/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/lan-name-tags-through-walls` --- ### 📝 Commits (10+) - [`dac18e8`](https://github.com/horizon-rust/horizon/commit/dac18e8350600d38c4c6b95d987d4738b802185f) LAN: mobs target and attack guests - [`327aa5a`](https://github.com/horizon-rust/horizon/commit/327aa5af6e710b1aa0e3e10652ce0453943b6710) tools/lan_e2e.py: a world with commands, so the guest's commands run again - [`600bae5`](https://github.com/horizon-rust/horizon/commit/600bae5703d222c7b1bd3c51ee8e72b3be12557e) LAN guest: hurt by lava, fire, drowning, suffocation and the void; hungry from moving - [`2e12123`](https://github.com/horizon-rust/horizon/commit/2e1212346f411c06657dec6a68b35ea853430502) tools/lan_e2e.py: hazards counts the food spent from full health - [`36d7f02`](https://github.com/horizon-rust/horizon/commit/36d7f02802889397f0d3c1d71fffbd15a2025f54) LAN: PvP between the host and guests - [`e289980`](https://github.com/horizon-rust/horizon/commit/e289980c1ea486228c73d1b007f522c387cf4c28) LAN guest: their own ender chest, and double chests as 9x6 - [`64f7ecd`](https://github.com/horizon-rust/horizon/commit/64f7ecd3671cfa13a044f68c048885c02a34f021) tools/lan_e2e.py: containers takes its chests away - [`257b5e9`](https://github.com/horizon-rust/horizon/commit/257b5e9f2d76c3d39e84a13754b2363d846cb8e9) tools/lan_e2e.py: containers waits for the server's menu before reading or taking - [`bc0cd9c`](https://github.com/horizon-rust/horizon/commit/bc0cd9cc844853472e83c780e07ec3db2cbde7ad) LAN guest: a use packet uses the item alone - [`11130e6`](https://github.com/horizon-rust/horizon/commit/11130e6ef7bf8d75ed006d3b7c63a81a9110422a) LAN guest: command feedback names the guest and shows its numbers ### 📊 Changes **25 files changed** (+1546 additions, -228 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+85 -44) 📝 `crates/horizon-client/src/game/agent.rs` (+1 -1) 📝 `crates/horizon-client/src/game/commands.rs` (+9 -5) 📝 `crates/horizon-client/src/game/control.rs` (+12 -0) 📝 `crates/horizon-client/src/game/creatures.rs` (+74 -9) 📝 `crates/horizon-client/src/game/hand.rs` (+1 -0) 📝 `crates/horizon-client/src/game/lan.rs` (+11 -0) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+136 -28) ➕ `crates/horizon-client/src/game/lan_mobs.rs` (+305 -0) ➕ `crates/horizon-client/src/game/lan_pvp.rs` (+110 -0) 📝 `crates/horizon-client/src/game/names.rs` (+133 -80) 📝 `crates/horizon-client/src/game/remote.rs` (+47 -1) 📝 `crates/horizon-client/src/game/storage.rs` (+7 -1) 📝 `crates/horizon-client/src/game/trial_spawner.rs` (+17 -4) 📝 `crates/horizon-client/src/game/vault.rs` (+10 -5) 📝 `crates/horizon-client/src/gfx.rs` (+45 -9) 📝 `crates/horizon-client/src/gfx/entity_batch.rs` (+7 -4) 📝 `crates/horizon-client/src/lan/containers.rs` (+26 -27) 📝 `crates/horizon-client/src/lan/guest.rs` (+6 -0) 📝 `crates/horizon-client/src/lan/hub.rs` (+3 -0) _...and 5 more files_ </details> ### 📄 Description Part of #435 ("Name tags aren't drawn through walls"). Stacked on #473: merge #466 → #467 → #470 → #471 → #472 → #473 first. This isn't LAN-specific: no name tag (players, named mobs) was drawn through blocks. ## What vanilla does `SubmitNodeCollection.submitNameTag`, called with `seeThrough = !isDiscrete`: - **Not discrete:** the name is drawn twice. - In full in the normal pass: opaque text, no background, light with emission 2. - Again in the see-through phase (`RenderPipelines.TEXT_SEE_THROUGH`: translucent, no depth test): faded text (alpha 127) on its background. `LevelRenderer.executeSeeThrough` draws this phase after the rest of the world. - **Discrete** (a crouching player): drawn once, in the normal pass, faded, on its background, so a wall hides it. - The background is `ARGB.color(getBackgroundOpacity(0.25), black)` = alpha 0x3F. Before, we used 0x40. ## What changes - `names.rs` builds a `NameTag` (position, lines, light, discrete) and emits each tag as vanilla does. The see-through copy goes into a new `see_through` vertex list. - `gfx.rs` gets a `see_through` frame slice and a "See-through text" entity pipeline (`CompareFunction::Always`, no depth writes, alpha blend). It is drawn at the end of the world pass, after clouds. ## How it was verified New two-client check in `tools/lan_e2e.py`, `walls`, with a host and a guest on this Mac (two offscreen clients via the control socket): - Steps: - A stone wall is put between the host and the guest. - The host looks at where the guest's tag hangs. - The host takes three screenshots: the guest standing, crouching, then standing again. The check waits 210 ticks first, so chat has faded. - It counts the pixels that differ between the shots. - Result: `walls: PASS {'standing_vs_crouching': 1158, 'standing_twice': 0}`. The standing shot shows the faded "Guest" tag through the stone; the crouching shot shows plain stone. - Control: without the Rust change, the same check fails with `no name tag through the wall: 0 pixels differ standing vs crouching`. - `nametags` (the tags in the open) still passes. In the guest's screenshot the background box covers the whole name; over the sky it darkens by about 25%. ## Follow-up (after a full 14-check run on the combined stack) - `lan status` lists each guest's `sneaking`. - `walls` now: - waits until the host sees the guest crouch and stand; - puts the wall halfway between the players; - respawns a dead guest first; - runs right after `nametags`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 15:57:27 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#2593
No description provided.