#[Solved] High-speed projectiles cause screen synchronization issues

17 messages · Page 1 of 1 (latest)

burnt glade
#

I made an item that shoots arrows several times faster than a normal bow, but the arrow appears to fly at a slightly different angle on the render screen, that is, only when viewed from the client. The server seems to treat it as flying correctly, and the arrow flies to the expected position.

Is there a way to solve this?

agile kindle
#

my guess is that theres probably some arbitrary offset or smth wrong in ur trig logic

if u send the code we can get a better idea why ur getting the arrow visual issues

burnt glade
#

I just increased the speed multiplier for the vanilla bow firing process... Also, there was no rendering lag on the arrow body prior to 1.21.3.

agile kindle
#

and what class is that?
sorry

burnt glade
#

If you're talking about a class that has the ShootAll method, then it's "RangedWeaponItem".

#

It's vanilla code, should I attach it here?

agile kindle
#

yea sure
would help me out

burnt glade
agile kindle
#

hmmm thats weird
i just did something similar to you and the arrow is being rendered in the correct position

burnt glade
#

What MC version did you try and how fast did you make the arrows go?

agile kindle
#

1.21.1

#

and im doing f * 6 for the speed

burnt glade
#

I see... I'll try various things here too. Thank you for taking the time to check!

burnt glade
#

By the way, this misalignment doesn't occur when you shoot when the Y axis is 0 or 90. Maybe it's misaligned when you shoot at an angle?

gaunt locust
#

velocity is muliplied by 8000 and truncated when sending to clients. it is also truncated at -3.9 to 3.9. any velocity outside of this is clamped before sending to client

#

basically, this means the limit is roughly 4 in any individual direction before you see errors. a workaround is to send a custom packet to set the velocity as a float or double

burnt glade
#

I'm still not very familiar with packets, so for now I'll just slow down the arrows as much as possible (it's not like I need a super fast projectile like hitscan...) Thanks!