#1, by dos4gwSunday, 10. January 2016, 03:09 9 years ago
There is a sequence in my game where the characters sing a song. Unlike the rest of my game, I felt it necessary to lip sync the lines; random mouth flapping doesn't work too well when characters are holding single notes for a length of time.
We made a system in Lua tied to system time to call actions based on specified millisecond marks. These actions include displaying the caption for the line and triggering a character animation. We've made character animations for each line in the song, using timed frames via the "set pause for each frame" option.
As far as I can tell, calling the actions through our script works well and accurately. The trouble, though, is relying on the time it takes for the action parts to run, and for the animation to play through, which seems to be tied to system performance. Depending on the power of the PC you run it on, action parts or frames may be delayed, which can throw off the lip syncing. Also, if an animation runs too long, it can prevent the animation for the next line in the song from appearing.
It's very important to me that this game be able to run on a large variety of hardware. Everything else in the game would at least work on a system that is performing poorly. But in the case of this song sequence, things are likely not to work at all if there is performance trouble.
I was hoping that I could still use actions and action parts for each line, but it looks as though I may need to do everything in Lua. It seems like I cannot rely on the animation system to display frames at such accurate times, so will I need to code every frame change in order to make this work?
Any ideas or comments would be much appreciated.