Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sync support to more properties of objects #4

Open
12 of 13 tasks
arthuro555 opened this issue Aug 3, 2022 · 7 comments
Open
12 of 13 tasks

Add sync support to more properties of objects #4

arthuro555 opened this issue Aug 3, 2022 · 7 comments
Labels
👂 Community feedback requested This issue is actively looking for and listening to feedback from the community 📈 Improvement Further work to make an existing feature even better
Milestone

Comments

@arthuro555
Copy link
Owner

arthuro555 commented Aug 3, 2022

We need to ensure that all of the fields one may want to use are available to be synchronized.

Fields

  • Position
  • Width & Height
  • Angle
  • zOrder
  • Layer
  • Scale
  • Visibility
  • Opacity
  • Current animation
  • String of a text/text entry/text input object
  • State variable
  • Flipping
  • Tint
Please comment any other properties you wish to be synchronized
@arthuro555 arthuro555 added this to the THNK Beta milestone Aug 3, 2022
@arthuro555 arthuro555 added 📈 Improvement Further work to make an existing feature even better 👂 Community feedback requested This issue is actively looking for and listening to feedback from the community labels Aug 6, 2022
@Keevle
Copy link

Keevle commented Aug 9, 2022

This should not just be a "send all and done",I think the Sync should only sync variables if changes occurLike if a users moving constantly only Position and angle are more likely to change so no sense in also syncing opacity and scale etc

@arthuro555
Copy link
Owner Author

arthuro555 commented Aug 9, 2022

That's already the case :) A full snapshot is only being sent to a client when it first connects, but afterwards only diffs are sent which only contain values that have changed.

See: https://github.com/arthuro555/THNK/blob/master/code/server/ObjectDiffer.ts#L28-L83

@Keevle
Copy link

Keevle commented Aug 9, 2022

amazing

@MyNameIsRinax
Copy link

You forgor to add object flip horizontally and vertically!!!

@Entr0py404
Copy link
Contributor

Object tint please ;)

@Yggddrassill
Copy link

Yggddrassill commented May 5, 2023

The Player Behaviors (not really) but the "Is Jumping" "Is Falling" and such, it doesn't need to sync the action because the position is already on sync, but the notion of the action taking place, that would make it easier to animate using the spritesheet animation.

@arthuro555
Copy link
Owner Author

Quite true! It is already planned to add a special behavior that synchronizes the platformer/top down movement behavior, in a way that:

  • These conditions function
  • The client can make accurate movement predictions in frames where it does not get a server update
  • You can just use "simulate key press" on the client and it'll automatically send messages to the server to simulate these inputs correctly there, without writing any events on your side
  • Automatically restore the object to the position & configuration it was in the moment the player did a key press (to not cause an unfair behavior if e.g. a jump that was done just in time before falling in a hole is only received by the server after it is too late due to network latency) (this one is quite complex and might require some additional time before being implemented)

:)

Track progress for this at #6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👂 Community feedback requested This issue is actively looking for and listening to feedback from the community 📈 Improvement Further work to make an existing feature even better
Projects
Status: 🔖 About to do
Development

No branches or pull requests

5 participants