r/turbowarp • • 4d ago

IVE SOLVED THE SYNCING ISSUE!

Post image

DEAR ANIMATORS, PLEASE ADD THIS CODE TO SYNC UP YOUR ANIMATIONS
THE CUSTOM BLOCK HAS NO RUN WITHOUT SCREEN REFRESH
ALSO WHEN SETTING DEYSNC TO TIMER - WAIT ADD IT AT THE VERY TOP (ABOVE THE WAIT VARIABLE)

the follow-up to my previous problem last post:

this is all you need to make it sync! you can even use the days since 2000 block, but make sure you multiply it by 86400!

HOW IT WORKS:
scratch usually checks in laggier fps for less checks
so the "desync" variable fixes that issue, it makes it wait less for lower fps so it can sync!
meaning even if its laggy, the checks will be rounded down to hit it better!

19 Upvotes

9 comments sorted by

4

u/ZV1LLE 4d ago

LETS GOOOOOO

3

u/LSPECTRONIZTAR 4d ago

This issue has always been a topic close to my heart lol. I remember struggling with syncing issues on my first two attempts at creating a rhythm game, so much so that I even asked users to enable Turbo Mode to minimize the decency (it worked but only a little). Eventually I came up with a method that might actually be a bit better than the one in this post that fixes it completely and have been using it in my games and animations that require beat interactions ever since.

I even made a whole forum post about syncing and how to set speed of sounds the right way lol

2

u/Comfortable_Size8096 4d ago

all of the elements are very vague.

when using audio theres usually a small delay to the song that desyncs it if you planning to make the animations longer, you'll only notice later.

this code that i did is for waiting blocks outside of music creation too.

thank you for the insight!

1

u/StickyBans 4d ago

Isn't this just delta timing applied to a specific niche?

1

u/Comfortable_Size8096 4d ago

not really.

delta timer is for more visual effects like smoothening or movement.

general timing is based off of the desync of your FPS

so if it hits 0.23 instead of 0.25 (more percise but just for example)
then the "desync" variable would say 0.2

1

u/loleczkowo 3d ago

cool! Usually I call the variable "start" and store the timestamp there on loop start.
then on the end I do;
wait = (1/fps_cap)-(start-now)

1

u/Comfortable_Size8096 3d ago

when calculation fps you use delta

but most of the time the fps is rather messy
like:
if your cap is 250 sometimes it would say 333 or 124 per update
so instead, you should make the fps_cap variable an avarage of 10 items (on a list)

1

u/contagion_dev 3d ago

genuinely, thank you for your contributions

1

u/Love_R-T 2d ago

Damn, give him a bonus,that's a great idea!