FPS Gameloop, game vs flutter #1584
Replies: 5 comments 5 replies
-
I think I want them both |
Beta Was this translation helpful? Give feedback.
-
So interesting that this conversation is occurring at the same time we are discussing the opacity issue. @ufrshubham may have to chime in on the dt issue vs fps. Either way, because there is rounding involved based on dt, that's where I think the issue is in opacity bug. I think these are connected but I could be off. Sorry having trouble putting the thought together concisely. |
Beta Was this translation helpful? Give feedback.
-
Sorry, I didn't explain what I meant well. I didn't mean related in code but more related in the aspect of dt is variable, i.e. not constant, where other engines have a fixedUpdate method or such. Opacity is varying because of rounding based on dt / progress which is coming from the loop. I guess I meant like very roughly related, 😆 |
Beta Was this translation helpful? Give feedback.
-
Ok, no more github comments from me at 0200. |
Beta Was this translation helpful? Give feedback.
-
My gut feeling is that the Flame FPS is the more important one: if I can only redraw and update the canvas 10 times a second, then it doesn't matter that the Flame goes at 100 fps -- there won't be any visible difference during those extra frames. But maybe my gut feeling is wrong, so I'd be really interested in hearing how to reason about this. I guess one thing that's outside the main game loop is the events system. So maybe if I can track finger movement or key presses at 100 fps, even though I can only update the game state at 10fps, maybe that makes all the difference? |
Beta Was this translation helpful? Give feedback.
-
Based on the discussion in #1582 I am opening this discussion here to report any findings we have or ideas related to the above given title.
The current problem that we are having is that if you would do the following code:
The fps would not be reported correctly compared to the Flutter performance view. To be more exact, from my own testing, it always reports in sort of increments (60, 30, 20, 10) but never any precise number.
For context: the internal gameloop uses a Timer (which is backed by
scheduleFrameCallback
) to ensure our loop works. On each callback we callgame.update
with the new delta and after that we set the painter to repaint.Beta Was this translation helpful? Give feedback.
All reactions