How to sync things consistently?

Started by Scavenger, Wed 20/11/2013 11:11:07

Previous topic - Next topic

Scavenger

I'm trying to polish up my game, and in order to sync some animation to music, I count game frames (I increment an integer every frame when the music starts and count what number it is). I have VSync on (turning it off sometimes makes the cutscene skip way far ahead), and have set my game's speed to 60, but I'm having some really spotty syncing issues.

Sometimes the music will get a second ahead of the action, and that feels awful and clunky, and all the action gets the life sucked out of it. And sometimes it'll go TOO fast.

Is there a way to consistently know how much time has passed since the song has begun in smaller increments than a second? I don't want some people getting the outro cutscene how it should be, and some people getting a desynced mess. I know 3.3.0 has PositionMs for tracker music, but I'm wary of using a beta for a final release.

monkey0506

Short of PositionMs I don't think there's really a way to be more precise than a whole second (DateTime doesn't support millisecond timing; relying on game frames can be inconsistent if the player's system causes a drop in FPS).

I will point out that the Windows build of 3.3.0 is very stable right now, and it is designed such that if a bug was later discovered you could patch your game release with a copy of the new engine executable only without invalidating existing save game files.

Beyond that you could generate the whole thing as a static video rather than using actual runtime animations and such. Probably not your ideal option, but it should prevent desyncing issues.

Scavenger

That's good news! I'll finish off everything that needs doing apart from the syncing in 3.2.1, and make a copy to try out 3.3.0 and finish it off there.

Hopefully if I can quickly resync the cutscenes, the game should be ready for release this week!

SMF spam blocked by CleanTalk