[testserver] y_bows: arrows get stuck in the air #5972

Open
opened 2024-01-14 01:13:52 +00:00 by whosit · 26 comments
Member

Sometimes a single shot arrow gets stuck in the air soon after shooting.

I don't hear a ding like when I hit myself.
It happens when I don't rapid-fire, so does seem like arrows collide with other arrows.

Kinda looks like it gets stuck after a single timestep or maybe even on the first one?

Could this be related to "critical shot" mechanic?

Sometimes a single shot arrow gets stuck in the air soon after shooting. I don't hear a ding like when I hit myself. It happens when I don't rapid-fire, so does seem like arrows collide with other arrows. Kinda looks like it gets stuck after a single timestep or maybe even on the first one? Could this be related to "critical shot" mechanic?
whosit added the
1. kind/bug
label 2024-01-14 01:13:52 +00:00
flux was assigned by whosit 2024-01-14 01:13:52 +00:00
Member

It happens when I don't rapid-fire, so does seem like arrows collide with other arrows.

unfortunately there's no way to make arrows collide with objects and not have them collide with other arrows. what's supposed to happen in that case, is that both arrows drop as items. i'll have to see what's up with them "getting stuck"

> It happens when I don't rapid-fire, so does seem like arrows collide with other arrows. unfortunately there's no way to make arrows collide with objects and not have them collide with other arrows. what's *supposed* to happen in that case, is that both arrows drop as items. i'll have to see what's up with them "getting stuck"
flux added the
3. source/mod upstream
4. step/at work
labels 2024-01-14 16:58:36 +00:00
flux added this to the flux's TODO list project 2024-01-14 16:58:39 +00:00
Author
Member

Sorry, I meant "does not seem like they collide with each other" - it sometimes happens when I shoot a single arrow.

That first one that you saw was literally the first one I shot after joining the server.
All the rest were my attempts to shoot arrow in the same direction (maybe there was a service acc there or something else invisible I thought? - but no, I was alone on the test and block is just air).

I can't actually make them hit each other by rapid firing. Random stuck arrows happen randomly on single shots. And it's not too rare even (had it happen 2 more times at least)

Sorry, I meant "does _not_ seem like they collide with each other" - it sometimes happens when I shoot a single arrow. That first one that you saw was literally the first one I shot after joining the server. All the rest were my attempts to shoot arrow in the same direction (maybe there was a service acc there or something else invisible I thought? - but no, I was alone on the test and block is just air). I _can't_ actually make them hit each other by rapid firing. Random stuck arrows happen randomly on single shots. And it's not too rare even (had it happen 2 more times at least)
Member

i can't replicate this locally. the test server seems to be up-to-date, and i can replicate it there though...

image

ok, this is very weird - according to the server, the arrow doesn't exist! it seems to be a client-side artifact?!

i can't replicate this locally. the test server seems to be up-to-date, and i can replicate it there though... ![image](/attachments/7b3ef73c-d264-4ed1-ba4b-182ea4ba7632) ok, this is *very* weird - according to the server, the arrow doesn't exist! it seems to be a client-side artifact?!
168 KiB
Member

or possibly they exist, but the server seems to think their position is something very different from where they are?! and these "broken" arrows don't seem to get unloaded. and the inspection tool doesn't register them when you punch them, and you can't pick them up by punching them... and they don't unload when there's no-one at the area?

or possibly they exist, but the server seems to think their position is something very different from where they are?! and these "broken" arrows don't seem to get unloaded. and the inspection tool doesn't register them when you punch them, and you can't pick them up by punching them... and they don't unload when there's no-one at the area?
Member

the test server is also doing very weird things with the y_bows HUD too, it's showing up sometimes when i'm not even wielding a bow. and other things sometimes feel laggy, even though the server reports there's no issue. maybe a network issue somehow?

the test server is also doing very weird things with the y_bows HUD too, it's showing up sometimes when i'm not even wielding a bow. and other things sometimes feel laggy, even though the server reports there's no issue. maybe a network issue somehow?
Member

yeah, definitely some sort of client/server network SNAFU - the arrows appear in the correct spot after i log off and log back in...

yeah, definitely some sort of client/server network SNAFU - the arrows appear in the correct spot after i log off and log back in...
flux added
3. source/unknown
and removed
3. source/mod upstream
4. step/at work
labels 2024-01-14 19:19:39 +00:00
Author
Member

I think Sokomine mentioned seeing "many floating arrows", while I saw only one. Sokomine also has trouble with "getting connection overloaded" with too many Voice mobs. This may be a clue.

I think I was able to pick up floating arrow into my inventory. But this is still consistent with client/server position desync.

Also, I saw same stuck arrow on 2 clients, does that mean that server just didn't send any velocity updates for that arrow?

Could it be that arrow "hits" something on the server before clients get the arrow's speed and it just spawned as static?

Maybe it's two similar but different problems (arrows stuck because server didn't send any updates, and arrows stuck because client lost some packets?)

This is only semi-related:
I had massive desync problems when I was trying to move a mob using only set_velocity and set_acceleration - server considered them static, but didn't send the velocity/acceleration update packet to client because the delta was too small. This caused client to continue slowly moving my mob away in one direction. Position was reset on join...

I think Sokomine mentioned seeing "many floating arrows", while I saw only one. Sokomine also has trouble with "getting connection overloaded" with too many Voice mobs. This may be a clue. I think I was able to pick up floating arrow into my inventory. But this is still consistent with client/server position desync. Also, I saw same stuck arrow on 2 clients, does that mean that server just didn't send any velocity updates for that arrow? Could it be that arrow "hits" something on the server before clients get the arrow's speed and it just spawned as static? Maybe it's two similar but different problems (arrows stuck because server didn't send any updates, and arrows stuck because client lost some packets?) This is only semi-related: I had massive desync problems when I was trying to move a mob using only `set_velocity` and `set_acceleration` - server considered them static, but didn't send the velocity/acceleration update packet to client because the delta was too small. This caused client to continue slowly moving my mob away in one direction. Position was reset on join...
Member

image

perhaps not a networking thing.

note how all the dtimes are normal, but only one is being executed every second.... but this might easily lead to queues being overfilled and thus packets being "dropped" before they're created.

![image](/attachments/0b543fd5-cf46-4022-bca1-43443934a470) perhaps not a networking thing. ~~note how all the dtimes are normal, but only one is being executed every second.... but this might easily lead to queues being overfilled and thus packets being "dropped" before they're created.~~
349 KiB
Member

disregard the above, dtime reports were being consumed by my chat de-dupe CSM

disregard the above, dtime reports were being consumed by my chat de-dupe CSM
Member

but something weird is definitely affecting all entities. right-click on Amanda or a default:chest, sometimes it'll take several seconds for the UI to show

but something weird is definitely affecting all entities. right-click on Amanda or a default:chest, sometimes it'll take several seconds for the UI to show
Member

i'm noticing that this happens in the haven plaza, but not at other locations.

i'm noticing that this happens in the haven plaza, but *not* at other locations.
Member

finally able to replicate this locally, though it's not as easy to do as on the test server:

image

it does seem to be highly correlated with the number of other nearby entities (in this case, signs).

finally able to replicate this locally, though it's not as easy to do as on the test server: ![image](/attachments/e3f125e3-4268-4d5a-81a5-616465911f89) it *does* seem to be highly correlated with the number of other nearby entities (in this case, signs).
290 KiB
Member

unfortunately i still can't replicate it reliably even if i add way more entities...

unfortunately i still can't replicate it reliably even if i add way more entities...
flux added the
4. step/at work
label 2024-01-15 19:51:52 +00:00
Author
Member

Now I wonder if it could be related to this: # 5994 (Haven/spawn lag)

Now I wonder if it could be related to this: # 5994 (Haven/spawn lag)
Author
Member

Happens more often if I do for example:
/create_lag 1000000 3 (command from mesecons_debug)
And when lag is constant arrows just end up "somewhere", sometimes stuck in air too.

Happens more often if I do for example: `/create_lag 1000000 3` (command from `mesecons_debug`) And when lag is constant arrows just end up "somewhere", sometimes stuck in air too.
Member

i haven't been able to reproduce this more than the once locally, but i've reduced the HUD update rate da3c3ddb93 and arrow pitch update d1d7c5187c, hopefully that'll reduce the number of packets sent to clients

i haven't been able to reproduce this more than the once locally, but i've reduced the HUD update rate https://github.com/fluxionary/minetest-y_bows/commit/da3c3ddb93fd4e27ce5e3cf1f0782362eb20e361 and arrow pitch update https://github.com/fluxionary/minetest-y_bows/commit/d1d7c5187c563a9e1335c881db3ca4b4a2b1601a, hopefully that'll reduce the number of packets sent to clients
Member

not sure if the last couple days code is installed on the test server, but arrows still "freeze in mid-air" when fired around the post-office, so i don't think spurious HUD updates are responsible for that. i still haven't replicated this locally except that once.

not sure if the last couple days code is installed on the test server, but arrows still "freeze in mid-air" when fired around the post-office, so i don't think spurious HUD updates are responsible for that. i still haven't replicated this locally except [that once](https://gitea.your-land.de/your-land/bugtracker/issues/5972#issuecomment-71272).

Latest updates are now on the testserver :)

Latest updates are now on the testserver :)
Author
Member

If both clients are near the arrow when it gets stuck, they both see it:

screenshot_20240205_150826
screenshot_20240205_150834

But when I rejoin, for that client arrow is in it's normal position stuck in the ground:

screenshot_20240205_151509
screenshot_20240205_151500

This is a client/server desync issue.

My guess is that it's a race condition of sorts. I even hear the arrow "hitting" something.
Probably you're never setting arrow position explicitly, only setting it's velocity, so it's left to clients to calculate it's position.
And in this case maybe packets that spawn the arrow and set it's velocity to zero arrive on the same timestep for the client, so the arrow just never starts moving client-side.

If both clients are near the arrow when it gets stuck, they both see it: ![screenshot_20240205_150826](/attachments/5b5a5961-183c-48b1-aa8b-7b984a04f24d) ![screenshot_20240205_150834](/attachments/113bdb49-14a3-4976-933a-27e7497e72d0) But when I rejoin, for that client arrow is in it's normal position stuck in the ground: ![screenshot_20240205_151509](/attachments/a7d49fc3-4fbc-4bb1-bfff-7851d39c52af) ![screenshot_20240205_151500](/attachments/27da3d60-e331-4ea7-a92b-2fbad6385357) This is a client/server desync issue. My guess is that it's a race condition of sorts. I even hear the arrow "hitting" something. Probably you're never setting arrow position explicitly, only setting it's velocity, so it's left to clients to calculate it's position. And in this case maybe packets that spawn the arrow and set it's velocity to zero arrive on the same timestep for the client, so the arrow just never starts moving client-side.
Member

If both clients are near the arrow when it gets stuck, they both see it:

in my tests, this is not the case. sometimes one player will see the arrow "stuck", sometimes the other.

But when I rejoin, for that client arrow is in it's normal position stuck in the ground:

they'll appear in the correct position if you even leave the area and come back again - no need to relog.

Probably you're never setting arrow position explicitly, only setting it's velocity, so it's left to clients to calculate it's position.

position is only set when the arrow is e.g. "stuck in the ground". velocity is only set (actually, i use add_velocity instead of set_velocity) when applying drag. x_bows uses set_velocity. i wonder if that could be part of the problem?

> If both clients are near the arrow when it gets stuck, they both see it: in my tests, this is not the case. sometimes one player will see the arrow "stuck", sometimes the other. > But when I rejoin, for that client arrow is in it's normal position stuck in the ground: they'll appear in the correct position if you even leave the area and come back again - no need to relog. > Probably you're never setting arrow position explicitly, only setting it's velocity, so it's left to clients to calculate it's position. position is only set when the arrow is e.g. "stuck in the ground". velocity is only set (actually, i use `add_velocity` instead of `set_velocity`) when applying drag. x_bows uses set_velocity. i wonder if that could be part of the problem?
Author
Member

I feel this happens immediately after arrow is shot - maybe on a step when dtime is high. I release the arrow, hear "node is hit" sound and arrow is stuck. Could this be the clue? Shooting and hitting happening on the same server step?

I feel this happens immediately after arrow is shot - maybe on a step when dtime is high. I release the arrow, hear "node is hit" sound and arrow is stuck. Could this be the clue? Shooting and hitting happening on the same server step?
Member

Shooting and hitting happening on the same server step?

that's not it. it's not totally independent of dtime, but it happens regularly enough on the test server which generally has near-zero lag, and i can't get it to happen locally even with very high artificial lag. also, you can hear it moving around and hitting the ground/ceiling on different steps from when you shoot it.

i kinda want to do a full analysis of all incoming packets for one "normal" and one "suck in air" bow shot. i've wished the minetest wireshark plugin parsed the packets more thoroughly. i wonder if i could instead make use of that minetest proxy server. hm.

> Shooting and hitting happening on the same server step? that's not it. it's not totally independent of dtime, but it happens regularly enough on the test server which generally has near-zero lag, and i can't get it to happen locally even with very high artificial lag. also, you can *hear* it moving around and hitting the ground/ceiling on different steps from when you shoot it. i kinda want to do a full analysis of all incoming packets for one "normal" and one "suck in air" bow shot. i've wished the minetest wireshark plugin parsed the packets more thoroughly. i wonder if i could instead make use of that minetest proxy server. hm.
Author
Member

I hacked together a version of minetest.lua that assembles "split message" packets back, but didn't figure out yet how to properly parse active object messages further, but it should be easier...

Here's the version that assembles split packets and puts the result of running the dissector again into the last split packet:

9f502de..c6867aad

For active object messages I also add CMD:

image

I hacked together a version of minetest.lua that assembles "split message" packets back, but didn't figure out yet how to properly parse active object messages further, but it should be easier... Here's the version that assembles split packets and puts the result of running the dissector again into the last split packet: https://gitea.your-land.de/whosit/minetest_wireshark/compare/9f502de..c6867aad For active object messages I also add CMD: ![image](/attachments/4ef9b32c-b96f-49a0-999f-c4fc9b15f0e4)
Author
Member

I had bad wifi connection or something, and almost each arrow I shot got stuck mid-air:
image

I had bad wifi connection or something, and almost each arrow I shot got stuck mid-air: ![image](/attachments/da90eca9-d240-42c9-bca1-7ea5f51fddb5)
Author
Member

Although, this is what tree chopping aftermath looks like:
image

So, maybe it's not specific to arrows...

Although, this is what tree chopping aftermath looks like: ![image](/attachments/1180102c-8046-46e1-b55b-6f70175c320a) So, maybe it's not specific to arrows...
167 KiB
Member

So, maybe it's not specific to arrows...

it's not.

anticheat prevents you from interacting with client-side displaced arrows currently. it's mostly an aesthetic problem. we should try to fix it if we can, but i'm not convinced it's a major gameplay issue. it can keep you from picking up your arrows that have landed in the ground, but that's not meant to be a reliable mechanic anyway.

> So, maybe it's not specific to arrows... it's not. anticheat prevents you from interacting with client-side displaced arrows currently. it's mostly an aesthetic problem. we should try to fix it if we can, but i'm not convinced it's a major gameplay issue. it can keep you from picking up your arrows that have landed in the ground, but that's not meant to be a reliable mechanic anyway.
flux removed the
4. step/at work
label 2024-04-03 20:51:00 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
3 Participants
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: your-land/bugtracker#5972
No description provided.