FlixelCommunity / flixel

Community fork of Adam “Atomic” Saltsman's popular game engine Flixel. Distilled from a variety of Flash games he worked on over the last couple years, including Gravity Hook, Fathom and Canabalt, its primary function is to provide some useful base classes that you can extend to make your own game objects.
http://flixelcommunity.org/
Other
84 stars 17 forks source link

Removing equality sign from _accumulator in FlxGame #202

Open winterismute opened 10 years ago

winterismute commented 10 years ago

Hi! As far as I know, this is a known fix for the FlxGame class. Removing the equality sign prevents some frames from being erroneously skipped, and could result in smoother games. I was wondering: why is it not in the updated community version? Also, I know that what I am going to do is extremely but practice, but: I have also issues this pool requests for the power tools, which are also maintained by this account: https://github.com/FlixelCommunity/Flixel-Power-Tools/pull/22 Although probably the FPT are not so used anymore, those bugs are pretty big, so it would be cool if someone could merge them and prevent characters from moving at huge speeds with no reason :D Thank you in advance, I promise I will work on some scheduled issue next time!

WingEraser commented 10 years ago

https://github.com/FlixelCommunity/flixel/issues/32

Dovyski commented 10 years ago

Hi there! First of all every contribution is always welcome, no need to work on a scheduled issue :)

About your pull request, as @WingEraser mentioned, you didn't include that in that last release because there was not enough testing. You could just change the <= part, but we must check everything first.

Regarding your Flixel Power Tools pull, that's awesome! We haven't decided quite yet how to work and maintain FPT. For now your pull request will remain the waiting queue until we discuss and plan the next steps.

winterismute commented 10 years ago

Hi again! Well, it's really a minority anyway... I have read the issue referenced but it does not really say much, in general the idea is that you don't want to "step" twice or more unless is very necessary (you need the simulation to catch-up with the real time), and suppose that updating and drawing take the exact time, you can end up calling an extra step often while instead you would like to call immediately a draw to "push" immediately a frame.

For the FPT, I think they are pretty useful. If you decide to maintain them, I think that commit (or an improved version of it :D) should be in - those bugs are just crazy. Hope I can help with something more in the future.

DigiEggz commented 8 years ago

I can confirm that a frame-by-frame analysis shows big improvements to scrolling smoothness just by removing that pesky equality sign.

Even before I tested each frame, there was a very visible sort of jerking or heaving motion that background sprites make about every second when moving left/right at a constant speed. After removing the equality sign, the problem goes away immediately.

I've also been testing this fix for over a year now and I haven't experienced any negative effects from this change.