Why is FPS so wrong in Atlas animation preview?

Why is FPS so wrong in Atlas animation in the editor? Changing an animations FPS makes a difference, but the result is far from expected in the editor. They work correctly when the project is launched.

The idle and run animations are crazy fast at 5fps, too slow at 1fps and too quick at 2fps (but it’s the closest).

I’m following the https://www.youtube.com/watch?v=VFh2mfqmiRU Defold Game Engine Crash Course tutorial.

I have vsync off, and framecap set to 0 in game.project

1 Like

What kind of OS and hardware (graphics card) do you have? @mats.gisselson and @Erik_Angelin: Is this something you’ve heard of before?

vsync and framecap only matters when you run your game, not while previewing in the editor.

1 Like

I’m on Windows 10, using NVidia 417.71 drivers on a GTX 1080

Here is something interesting…

The FPS is SUPER fast if I run it on my 240hz screen. It is VERY fast if I run it on my 144hz screen.

I just changed my monitor refresh rate to 60hz and it runs properly.

So the editor FPS is tied to the monitors refresh rate. (Perhaps loosely related to a bug I posted the other day regarding Gsync - although I have that disabled now so I can use the editor).

1 Like

Aha! @vlaaad and @Erik_Angelin might know more about this.

1 Like

It looks like we use a fixed 1/60 timestep when updating animations. It appears this change was made on purpose a long time ago, possibly to achieve deterministic behavior in particle simulations.

I think it makes sense to revisit it now that high refresh-rate monitors are more common. I created an issue for it here: https://github.com/defold/editor2-issues/issues/2408

10 Likes

I faced exactly the same issue as described in the topic head.
My specs:

  • Defold: v1.2.161
  • OS: Fedora 30 (Wayland)
  • Graphics card: Sapphire RX480 Nitro+
  • Graphics driver: amdgpu
  • Screen: 3 x FullHD 60Hz

Any updates on this issue? Was just getting started learning Defold and ran into this. I’m not even sure which one is playing at the right FPS between the editor and in-game but I’m guessing it’s the editor.

Also, I’m getting what seems like 1 FPS on my animation in-game with Vsync on while I have it set to 5 in the editor.

Is this just an edge case on some machines? I can provide the specs if it’ll help. Also the screen I’m using is 144Hz.

1 Like

I haven’t faced this particular issue, but it sounds like in-game should be right, whilst the editor might not be. @britzl are you able to say if this situation has changed?

Looks like this issue may still persist?

Edit: I linked an old Defold repository originally.

1 Like