The basic gameplay is that you watch a series of video clips, make a decision, and then watch a different series of video clip. More and more I'm noticing a lag in the way the video clips are displayed. As in, the subtitle for the next clip appears first, and then half a second later, the actual clip starts playing. Ideally, the subtitle and clip would appear simultaneously.
This is what it looks like:
Here's how it works ("works") so far. First, I need the video to appear in a specific part of the screen, so this line defines that under an init:
Code: Select all
image movie = Movie(size=(985,560), xpos=262, ypos=29, xanchor=0, yanchor=0)
Code: Select all
show case 4 - defending 1 # Backdrop for the video.
show movie with None # Adds the video displayable if it's not already there.
show subtitle 1-defending # Adds a generic header, in case you have subtitles turned off
play movie "videos/case 4/case 4 - 16.webm" noloop
if persistent.captions == "true":
show subtitle case 4-36 # Shows the actual subtitle, if you have subtitles turned on
$ narrator.add_history(kind="adv", who="Don't Stop Defending", what="Don't Stop Defending: Why?\n") # Adds the text of the subtitle to the history screen
$ renpy.pause(1.1, hard=True)
I know that looks like a lot of lines—a lot of it likely superfluous, esp. if I were a better coder/designer—and the obvious solution would be to try to trim it down. I already tried that. As a test, I trimmed it all the way down to the two problematic elements:
Code: Select all
show subtitle 1-defending
play movie "videos/case 4/case 4 - 16.webm" noloop
I don't know if it's gotten worse over the course of development, or if it's always been like this and I'm just noticing it now. It's not even that you necessarily notice the subtitle issue specifically, but the transition from clip-to-clip is extremely un-smooth and annoying to look at.
Things I have tried to fix it:
- Reducing video file size
- Converting video files to different file types
- Deleting most of the video files, to see if it's an overall file size issue
- Disabling the custom cursor (since that was causing other, separate lag issues in older versions of Ren'py)
- Removing every single line of code for when we're playing videos except "show subtitle" and "play movie"
- Rearranging all the lines of code for when we're playing videos, in every order I could think of
- Changing the Renderer
- Disabling Powersave
- Changing the Framerate
- Enabling/Disabling Tearing
- Switching to an older version of Ren'py
- Updating to the latest experimental build of Ren'py
- Limiting use of the "show movie" command
- Adding "with None" to the "show movie" command so that it doesn't look for a transition
- Breaking the script files into "Case 1", "Case 2", "Case 3" and "Case 4" files (previously, I had everything in one gigantic file, because I am bad at this)
- Changing various parameters of the "image movie" code
- Restarting my computer
- Generating a fresh build of the game, to see if it's only an issue when I'm playing it from the Ren'py launcher. (It's not.)
- Complaining to my spouse
- Switching all the pauses in the game between "hard=True" and "hard=False"
- Attempting to preload all the videos when the game initializes (not sure if I ever actually got this to work)
- Taking a screenshot of the initial frame of the video, then displaying THAT simultaneously with the subtitle
That last solution actually kind of works, but since there are over 1,000 video clips it's untenable, unless anybody knows of a command that can automatically display the first frame of a video, so it doesn't have to be done by hand. Also it's the world's clunkiest workaround.
In the future (i.e., if we make a sequel, or a similar FMV game) I think the solution would be to hard-code the subtitles directly into the videos, but I think it's too late at this point to do that. (There are over 1,000 video clips and 1,500 subtitle images. Plus, then, if I want the player to be able to enable/disable subtitles, I'd have to have two full sets of videos—one with subtitles and one without—which makes me a little concerned about the potential file size of the game.)
So...does anyone have any thoughts?