BananiumLabs / AtomBlast.io

Multiplayer arena game which takes place at the molecular level.
MIT License
1 stars 0 forks source link

Ghost Atoms #62

Closed 64bitpandas closed 5 years ago

64bitpandas commented 5 years ago

Expected Behavior

Atoms are supposed to delete themselves when collected.

Actual Behavior

Occasionally, an atom or two will not delete as normal and become 'ghost' atoms, which move in a straight line, cannot collide with anything, and do not delete when they reach the edge of the map.

Steps to Reproduce the Problem

  1. Stand right on top of a vent
  2. Wait

Specifications

Screenshots

screenshot

The two atoms on the left of the player are ghost atoms.

EnumC commented 5 years ago

I believe this has to do with the console warnings from the sanity checks. The object being removed is undefined or null but it is still rendered? sanitycheck

EnumC commented 5 years ago

update: the issue only occurs if the player picks up molecule the moment they spawn in.

EnumC commented 5 years ago

debug

64bitpandas commented 5 years ago

This is caused by the fact that objects are synced once per frame. So if an atom is removed by the server BEFORE the initial frame is completed, then the atom will be null since it has not been created clientside yet.

A possible solution will be to create a serverside queue that populates every time serverSendObjectRemoval() is called, and is popped at the same time as the regular object sync.

64bitpandas commented 5 years ago

Mostly fixed (with @EnumC 's hacky setTimeout() fix). Set to low priority, we can revisit this later when we have time.