TOSIOS icon indicating copy to clipboard operation
TOSIOS copied to clipboard

The other player can't see the bullet

Open a7210232 opened this issue 3 years ago • 8 comments

why The other player can't see the bullet self can

a7210232 avatar Jul 16 '21 07:07 a7210232

Hi! I'm also running into this issue. I'd like to try to fix it. Any ideas what may be causing this? @halftheopposite @LukeWood Great boilerplate btw!!

tabakd avatar Mar 09 '22 01:03 tabakd

Really not sure honestly. maybe a colyseus API changed with a major version?

LukeWood avatar Mar 09 '22 06:03 LukeWood

Ah I found it. Issue with the bullet re-use on server side. I’ll PR a fix when I can :)

On Mar 9, 2022, at 1:26 AM, Luke Wood @.***> wrote:

 Really not sure honestly. maybe a colyseus API changed with a major version?

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you commented.

tabakd avatar Mar 09 '22 13:03 tabakd

@tabakd That'd be great if you can fix it and submit a PR 👍

halftheopposite avatar Mar 12 '22 22:03 halftheopposite

@tabakd Could you post a quick fix here in the meantime? I'm able to get it working if I comment out the bullet recycling code on the server-side so it only pushes new bullets, and also if I just push the recycled bullet onto the existing bullets array. But if I delete the bullet from the array and re-push, no go. My guess is Colyseus isn't detecting the array change because it thinks it is the same item, and could probably fix it by adding a new ID like this monsters array does for new entries

wheresthebeefy avatar Mar 15 '22 22:03 wheresthebeefy

So ?

Yacine-YA avatar Mar 21 '22 12:03 Yacine-YA

@tabakd Could you post a quick fix here in the meantime? I'm able to get it working if I comment out the bullet recycling code on the server-side so it only pushes new bullets, and also if I just push the recycled bullet onto the existing bullets array. But if I delete the bullet from the array and re-push, no go. My guess is Colyseus isn't detecting the array change because it thinks it is the same item, and could probably fix it by adding a new ID like this monsters array does for new entries

That sounds like a plausible fix. I simply disabled the bullet re-use logic for my purposes but can look into fixing it.

tabakd avatar Mar 21 '22 15:03 tabakd

It is actually happening since Bullet.reset can trigger neither onAdd, onRemove nor onChange event from Colyseus server. I don't know why Bullet instance has to be remain inactive without destroying them. But #62 fixes it without too much hassle.

colus001 avatar Jan 04 '23 02:01 colus001