Snake - Cut-scene synchronization

Published October 27, 2019
Advertisement

Since my last entry, I've worked through a rough cut of the opening cut-scene for story mode in the Garden of Eating.  I still have to work some details on the way the maps look, but I'm otherwise happy with the way things are going.

I had thought that cut-scene playback was working without issue, but it turned out there was a rather awful bug related to synchronizing the audio and video.  After about 20 seconds, the audio and video were going out of sync by about a full second!  When you're trying to precisely sync up dialog and sound effects to the visuals, this is quite the deal breaker. ?

In my main game loop, I was updating and rendering the game for the current frame, and then telling the thread to sleep for the remaining time (1/60th of a second, minus the time spent).  This doesn't at all guarantee that the system will return control back to the thread when you actually want it to.  I didn't realize it would be going out by quite *that* much, though...  This wasn't something I'd particularly noticed during regular game play.

For my cut-scene playback, each call to the "update" method was originally assuming it should process exactly one frames' worth of the cut-scene.  The fix was to start a clock when the cut-scene starts, and figure out what frame its on based on the time elapsed since the last "update" call.

 

Also related to cut-scenes...  The JSON file format I chose for listing cut-scene events is definitely proving to be rather verbose, causing the campaign file to balloon if you want to do anything with a little complexity to it.  I'm not sure I want to do anything about it for this game at this point in its development.  But it's something I'll be keeping in mind.  Making the snake move around the screen with individual movement instructions is kinda like programming Turtle graphics?  It gave me full control over what I wanted to do, but it took a bit more effort than I would've liked.

At any rate, as I inch closer to a finished version of the opening cut-scene, I'm thinking I'll be posting an intro video for Garden of Eating on Youtube sometime in the next week or two.  Advertising definitely isn't my strong point, but I figure I should try to get my name and my work out there at least a little bit. ;)

0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement