hump.timer Library is Imprecise, so Beware!

I have been using hump libraries for LÖVE (Lua game engine) including gamestate and timer and they worked quite well.

However once I needed precise timing, hump.timer failed most of the time. Sometimes the tweening transitions were not finished, other times they went further than requested. It has some bugs that you might encounter when you need exact timings for your animations or you are building a script of tightly connected tweenings.

The docs for Timer.after function mention:

There is no guarantee that the delay will not be exceeded, it is only guaranteed that the function will not be executed before the delay has passed.

But also tweening function didn’t work right.

And that’s why I had to switch to Knife instead, which I recommend:
https://github.com/airstruck/knife

Since it has similar function signature, it was easy to convert tweening parts into Knife. Fortunately, timings work well and I have encountered no imprecision.

I am still keeping hump’s gamestate around as I am pretty content with that.

I searched for hump’s timer having these bugs, but it’s not been mentioned. So there is this blog post for other developers of Love2D using hump.timer library for their tweening.

Maybe someone else will find this and not pull their hair on why some exact timings don’t work for their animations.


Have a comment? Join discussion on Mastodon as a reply to: @dusoft@fosstodon.org