twig33 / orbs

BSD 2-Clause "Simplified" License
12 stars 6 forks source link

Add facing to user position #5

Open JeDaYoshi opened 2 years ago

JeDaYoshi commented 2 years ago

This PR, alongside twig33/ynoclient#1, adds support for sending the user facing position for each player.

Fixes #2

twig33 commented 2 years ago

This is a good idea, but there's a few problems:

  1. Moving now results in 2 messages being sent to server -- first one is for facing, second one is the actual movement. This probably isn't significant.
  2. When you go (for example) up until you hit a wall and keep holding the "up" key, every frame a message will be sent to the server. Could maybe lag the server if enough people are doing it? image ^ That's from doing it for about 5 seconds (252 messages)

So i guess ideally a facing change message would be sent only when it's actually changed and not sent if the movement isn't blocked by a wall, though not sure how to implement that

JeDaYoshi commented 2 years ago

Oh hm, I didn't notice it was sending the event twice. That can explain something else I noticed (other players became slower to move after that).

I can take a look at tackling them. Will follow up later.