Boring Math Post (Patreon)
Published:
2014-08-12 14:34:05
Imported:
2023-03
Content
So here's a possibly confusing screenshot of something I'm working on.
Currently the animation system for SMS works on timers. So when Jesse is laughing, a laughing timer ticks up and down to various points giving, and the different limbs rotate and animated based on some percentage of that timer.
I'm however, not the best at math, and have always found it to be kind of a pain, so the timer I was using was simply increasing by 1 each step. (A step is basically a frame in Game Maker, and one cycle of code) So a 1 second animation would count from 0-29, simply adding 1 each time. Which would be the red line in the image.
So I did a bit of research and with the help of a couple of very long in depth articles and a couple hours of experimenting I found an algorithm that would work better then simply adding 1 each time. This new algorithm gave the black wave.
As you can see the black line starts to move slowly then drops very quickly the slows down again. So by adding this algorithm to the current animation system all the awkward choppiness of the current animations will smooth out significantly.
Honestly I don't fully understand how the math works behind it XD but it works, so I'm not questioning it.
I won't be updating all the animations immediately I'll just update them slowly as I feel like it basically. Though as I do that, I'm going to start to implement variable frame rates. So players can set how smooth they want the game to be visually. This will have a huge impact on the current code, but shouldn't be overly complicated to implement. This isn't a priority however so it'll still be a while before you guys can play around with it. (most likely)
Big boring nerd post. I dunno if anyone is interested in me posting more stuff like this or not but if you are let me know XD