Skip to content

Add facing to user position#5

Open
jeda wants to merge 2 commits intotwig33:mainfrom
jeda:main
Open

Add facing to user position#5
jeda wants to merge 2 commits intotwig33:mainfrom
jeda:main

Conversation

@jeda
Copy link

@jeda jeda commented Nov 19, 2021

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

Fixes #2

@twig33
Copy link
Owner

twig33 commented Nov 20, 2021

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

@jeda
Copy link
Author

jeda commented Nov 20, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Player turning without movement not being updated on other clients

2 participants