Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chunks disappear on death resulting in longer loading terrain screen #2584

Closed
MrKinau opened this issue Jul 1, 2024 · 3 comments
Closed
Labels
E-external Closed: External issue T-bug Type: Bug
Milestone

Comments

@MrKinau
Copy link

MrKinau commented Jul 1, 2024

Bug Description

When dying on a Paper server, the chunks immediately disappear, so you can't see them in the death screen. Additionally, since the chunks are no longer rendered, the loading terrain screen that appears after clicking the Respawn button takes much longer.

Video: https://youtu.be/eYxW55Ov5tg
In the video you can see: First part is played with Sodium 0.5.11 1.21 on a Paper 1.21 server, second part is played without Sodium on the same server.

Reproduction Steps

  1. Join a Paper server (tested with 1.21, but it should be the same with older versions)
  2. Kill yourself (e.g. /damage @s 100 minecraft:generic_kill)
  3. You are not able to see the world in death screen and respawning takes much longer than without sodium

Log File

https://mclo.gs/7fgwszG

Crash Report

https://mclo.gs/go98XWm

@MrKinau MrKinau added the S-needs-triage Status: Needs triage label Jul 1, 2024
@jellysquid3 jellysquid3 added S-needs-bisect Status: Needs a bisect T-bug Type: Bug and removed S-needs-triage Status: Needs triage labels Jul 7, 2024
@jellysquid3
Copy link
Member

This bug appears to be a regression in Sodium for Minecraft 1.21. The chunk tracking code might need to be updated to account for other changes in the game.

@jellysquid3
Copy link
Member

This is potentially related to #2586.

@jellysquid3
Copy link
Member

This is a bug with Paper. They are sending chunk unload packets immediately after the player dies, which causes Sodium to unload them. This is why the chunks disappear behind the death screen, and why the loading screen is shown after respawning (as it is waiting for chunks to be sent back to the client.)

Fundamentally, there is no good way to fix this on our side. The only reason it works correctly in Minecraft is because the renderer isn't even aware of when chunks get unloaded. So it just never does so until new chunks overwrite the existing chunks (or they are too far away from the camera). This behavior is frankly terrible, and is responsible for many graphical bugs and memory leaks, hence why Sodium does not (and will not) mimic it.

The best thing we can do here is at least try to workaround Paper sending the chunk unload packets too early, so they don't disappear on the death screen. But this will not prevent the player from seeing a (short) loading screen when they spawn in the world again.

@jellysquid3 jellysquid3 added E-external Closed: External issue and removed S-needs-bisect Status: Needs a bisect labels Aug 2, 2024
@jellysquid3 jellysquid3 closed this as not planned Won't fix, can't repro, duplicate, stale Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-external Closed: External issue T-bug Type: Bug
Projects
None yet
Development

No branches or pull requests

2 participants