PaperMC / Paper

The most widely used, high performance Minecraft server that aims to fix gameplay and mechanics inconsistencies
https://papermc.io/
Other
9.99k stars 2.32k forks source link

Entity tracking range is not limited by simulation distance #8451

Open Malfrador opened 2 years ago

Malfrador commented 2 years ago

Expected behavior

Entities outside of the simulation distance should automatically be outside of tracking range as well. The client should not crash.

Observed/Actual behavior

If entity-tracking-range is set to a value that is higher than the simulation-distance (in blocks), entities will stop ticking while still being tracked. This leads to a client crash, because they will end up in an invalid position as they are still being ticked on the client and not removed.

This issue only happens on Paper, not on Spigot or Vanilla servers. It also happens on Paper builds before the chunk system rewrite. Client crash report https://pastebin.com/ypqTDvWY. The error indicates that the coordinates were out of bounds for the client. Also see the discord convo here: https://discord.com/channels/289587909051416579/289587909051416579/1028836007547777165

Steps/models to reproduce

  1. Set entity-tracking-range.others to 256
  2. Give yourself a bunch of firework rockets with a long flight duration using /minecraft:give @p firework_rocket{Fireworks:{Flight:15}} 64
  3. Use the fireworks rockets.
  4. Wait about 2-3 minutes
  5. The client will start lagging and then crash

Plugin and Datapack List

Not relevant

Paper version

Happens on both 112 (first 1.19.2 build) and 202 (currently latest 1.19.2 build)

Other

See discord convo around here: https://discord.com/channels/289587909051416579/289587909051416579/1028836007547777165

galacticwarrior9 commented 2 years ago

I run a medium-sized server (50-100 players) which necessarily has a low simulation-distance (3 chunks) but also an entity tracking distance greater than that (96 for players, 48 for everything else). My server's combat system relies on the fact that entity tracking distance is constrained by the view-distance (7) and not simulation-distance (3). It would be extremely unfortunate and gamebreaking if this behaviour were to change.

Forgive me as I am not familiar with the technical background here. From what I understand, this is an unavoidable issue. However — to my knowledge — my players have not reported client crashes in spite of our set-up. Is that a meaningful observation, or does this only indicate that some players are experiencing crashes and not reporting this to us? Some insight would be appreciated.

electronicboy commented 2 years ago

Yea, I dont think that the tracking range being limited by the sim distance is much of an issue as much as this one singular case, which may honestly be best to just see if it's viable to apply limits there rather than to add artificial constraints around stuff.

Does anybody know if this is reproducible on a vanilla server? if so, we can report it to mojang as maybe this makes sense for them to resolve, I don't wanna go stupidly analytical over the issue on this tracker as it's a doozy to say the least. This is probs something we've made more likely to occur through other changes

Malfrador commented 2 years ago

I am unable to reproduce it on vanilla with entity-broadcast-range-percentage=1000, which is the max value according to the wiki, and simulation-distance=5.

Additionally, the fireworks seem to correctly despawn, which is not the case on Paper. I verified that using the profiler report from the /perf command.

R411gun commented 2 years ago

This only happens on Paper and any of its forks. Spigot does not have this bug.