python-airmash icon indicating copy to clipboard operation
python-airmash copied to clipboard

Projectiles and players not despawning properly

Open will-emmerson opened this issue 7 years ago • 3 comments

There is something a bit wrong with despawning - projectiles and players aren't being cleaned up properly. I made a really simple gui using pygame which draws all players and projectiles with online=True, and you can see lots of stationary objects. I tried changing the code to just remove them which helps a bit but it's still a problem. Is there some reason for keeping projectile and players around with online=False, why not just delete them? See PR #7

will-emmerson avatar Jan 14 '18 10:01 will-emmerson

Actually I've just realised that Mob is using active and online while Player is using online - I've tried changing them both to use .active but there's still problems. Perhaps mob despawn isn't being recieved because it's being done on the backup websocket or something.

will-emmerson avatar Jan 14 '18 11:01 will-emmerson

I think mob despawns for missiles are implicit; ie the speed, range, max speed, direction, etc for missiles are all known to the client. What remains is for the client to plot the missile trajectory and despawn it when it has run its course.

I think mob despawns are only sent for "unexpected" events, ie: if a missile hits another player. (although in that case I think that's sent as a hit anyway)

Gadgetoid avatar Jan 24 '18 11:01 Gadgetoid

That makes sense, it explains why some missiles get deleted and some don't. A workaround for now would be to do it on missile age.

will-emmerson avatar Jan 25 '18 09:01 will-emmerson