Open a7210232 opened 3 years ago
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!!
Really not sure honestly. maybe a colyseus API changed with a major version?
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 That'd be great if you can fix it and submit a PR 👍
@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
So ?
@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.
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.
why The other player can't see the bullet self can