transhumandesign / kag-base

King Arthur's Gold base folder.
257 stars 120 forks source link

Invisible catapult rocks #1572

Open Gingerbeard5773 opened 1 year ago

Gingerbeard5773 commented 1 year ago

Description

Catapult rocks will not render when the catapult is very far away.

Reproduction

Launch stone from a catapult from very high up on a dedicated server. Use a second client to view the invisible rocks at the bottom.

Expected Behavior

The rocks should be visible no matter where the player is.

Video

https://user-images.githubusercontent.com/68350259/214327692-dfa44510-5457-42ee-b375-d208aebadaf0.mp4

ParaLogia commented 1 year ago

If I remember correctly, this can also happen with arrows.

asumagic commented 1 year ago

Invisible arrows happen because of desync (usually desynced doors), not because of being spawned far away, AFAIK.

ParaLogia commented 1 year ago

Door desync is a common cause of invisible arrows, but not the only cause.

There are no doors in this video:

https://user-images.githubusercontent.com/22576116/214382659-ca309d3a-2f7c-4a9a-a023-97355aa84eee.mp4

ParaLogia commented 1 year ago

Also confirmed that this happens with special arrows and ballista bolts/shells. Bolts example:

https://user-images.githubusercontent.com/22576116/214396292-1e6af91e-5993-421c-964e-5130355b4545.mp4

asumagic commented 1 year ago

Both arrows and catapult rocks use consts.net_threshold_multiplier = 4.0f; so that could be related. Ballista bolts also use that value. IIRC >= 4.0 essentially means no resync against the server, as it sometimes causes choppiness on fast moving entities. So it may be that out-of-screen blobs, being basically put in an inactive netcode state, don't sync at all when they appear on screen. Maybe you would see them pop at (0, 0) (i.e. top-left corner)?...

I recall messing around with that value for cata rocks because they looked choppy on servers when set lower than 4.0 (in which case, IIRC, it defines the max position difference between client and server before resyncing), despite looking correctly synced. I am not quite sure why that was necessary in retrospect. It would need digging a bit more into engine code to be sure...