ethanmoffat / EndlessClient

An open source client for Endless Online written in C#
MIT License
34 stars 16 forks source link

Walk/Attack animation timings still need work #299

Closed ethanmoffat closed 1 year ago

ethanmoffat commented 1 year ago

When comparing walk speed of EndlessClient to the vanilla client, it is significantly slower. There are a few things at play here:

  1. Game updates are limited to 60FPS - this change was made since VSync is disabled, and the update rate is tied to the draw rate. Re-enabling vsync causes slow loading issues where controls "pop in" when transitioning to in-game state and generally just looks terrible.

  2. Animation timing (CharacterAnimator class) is just wrong. The frame times are approximations. Because of points 1 and 3 in this list, they have a weird interaction with the rest of the game.

  3. The concept of fixed time step updates. There is a fixed interval at which re-renders or frame changes will be attempted in CharacterAnimator and MapRenderer. There is a less frequent interval for "walk updates" (every 4 regular updates), which was introduced to prevent glitchy tearing issues when walking while an NPC was moving.

The vanilla client sends attack timestamps with an increasing timestamp value exactly 60 units apart (meaning: 600ms). There needs to be a background packet dispatcher component that operates on this same interval so the animator isn't tied to the rate at which packets are being sent.

More testing needs to be done with the vanilla client and record the timestamp diffs for walking as well.