Home Creators Posts Import Register Favorites Logout
haven't archived this post yet. have a subscription? use the importer!

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

Files

Previews only

Comments

Serph Bravin

I want to hear more stuff like this. Preferably with a bit more explanation as to how the thing works, but seeing as you didn't know in this case, I can't expect an explanation. Hopefully next time.

draite

t = Time (the current time) b = Beginning (starting position) c = Change (end position) d = Duration (the length of time) if(t == d) return c; t = t/(d/2); if(t < 1) return (c/2*t*t) + b; else{ t -= 1; return -c/2 * (t*(t-2) -1) + b;} This is the script XD basically my understanding is that if the time is less then half the final duration it's just a matter of squaring the time and multiplying that by the change. But it has to half the change value since it's only calculating for the first half of the timer. The second half ends up sorta inverted, though I don't full understand how the -2 and -1 are altering it to work, but it does XD'

Serph Bravin

I got an A in GCSE Maths, which was a whole bunch of algebra. I have no idea what this post was about. Still, interesting to see the coding side of things.

Elmotus

Nerd stuff is a big part of making the game sooo keep em coming! :3

draite

Good to know ^ ^ I'll try to do a post like this as often as I can.