Ren'Py Displaying movie in renpy creates background issue

Kalloway

New Member
Game Developer
Aug 24, 2018
12
143
Hello, I am having trouble trying to display a movie in Ren'py.

I am using the exact code from the Ren'Py documentation, but here is my exact script:

image dbj1 = Movie(play="dbj1.webm", mask="dbj1.webm")

scene dbj1

Now, when I use the show function, which the documentation also uses, it kind of inherits the previous scene and merges with the webm (which created some real horrors).

If I use the scene function, it does clear the previous scene, but the movie becomes kind of transparent and leaves a checkerboard pattern in the background. I have tried it with fade and dissolve and without any transition at all. The issue persists regardless.

I saw one suggestion that said create to create a black scene and then show the movie on top of that, but the black background makes the entire animation too dark.

I haven't found anyone else asking about this specifically, which makes me think the answer is probably obvious and I'm just too dense to see it, but I am out of ideas. I can't use the cutscene function, because I want dialogue over the top of it that the player will click through.

If you have any ideas, please let me know, I appreciate it!
 

mickydoo

Fudged it again.
Game Developer
Jan 5, 2018
2,446
3,557
Hello, I am having trouble trying to display a movie in Ren'py.

I am using the exact code from the Ren'Py documentation, but here is my exact script:

image dbj1 = Movie(play="dbj1.webm", mask="dbj1.webm")

scene dbj1

Now, when I use the show function, which the documentation also uses, it kind of inherits the previous scene and merges with the webm (which created some real horrors).

If I use the scene function, it does clear the previous scene, but the movie becomes kind of transparent and leaves a checkerboard pattern in the background. I have tried it with fade and dissolve and without any transition at all. The issue persists regardless.

I saw one suggestion that said create to create a black scene and then show the movie on top of that, but the black background makes the entire animation too dark.

I haven't found anyone else asking about this specifically, which makes me think the answer is probably obvious and I'm just too dense to see it, but I am out of ideas. I can't use the cutscene function, because I want dialogue over the top of it that the player will click through.

If you have any ideas, please let me know, I appreciate it!
I have no idea why "scene" does that, its plagued me from the onset. My work around is thus -

From my code

image chf1 = Movie(play="video/Ch_Sex_1.webm")
show chf1

BUT -

I use the first frame of the video first as a scene to wipe and previous scenes. So -

amy "Hey lets fuck"
micky "Ok"
scene "fuck_frame"
call screen fuck_movie

screen fuck_movie:
show chf1
pause (I call another screen)

Probably a better way, we will find out lol
 

MissFortune

I Was Once, Possibly, Maybe, Perhaps… A Harem King
Respected User
Game Developer
Aug 17, 2019
5,374
8,642
image dbj1 = Movie(play="dbj1.webm", mask="dbj1.webm")
Are you using a standard, 1-2 second looping animation? If so, try including the first and last frame of the animation. Like so:

Code:
image dbj1 = Movie(play="images/anim/dbj1.webm", loop=True, start_image="images/ani/dbj1_060.png", image="images/ani/dbj1_119")
Change the directories/names as necessary, and turn "loop = True" to False if you don't want it to loop. The just add the scene as you normally would. Again, like so:

scene db_intro with dissolve
mc "blah blah blah"
m "nah nah nah"
window hide (if you use a dialogue box)
scene dbj1 with disssolve/Dissolve (or your choice of transition.)
pause
(use window show if you use a dialogue box and want to talk over the animation/etc.)

Then throw in a second animation if you have one or move on to the next scene or still render. Hope that'll work for you.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,957
16,191
image dbj1 = Movie(play="dbj1.webm", mask="dbj1.webm")

scene dbj1

Now, when I use the show function, which the documentation also uses, it kind of inherits the previous scene and merges with the webm (which created some real horrors).
And what is surprising in this ?

The :
mask
A string giving the name of a movie file to use as an alpha mask.
You are explicitly asking Ren'Py to merge your movie with the previous scene, and Ren'Py is doing it, period.


The mask property is here for people who want to integrate their animation in the background. Generally they do this by having a movie with a black background and using it as mask, what will lead to everything not being "the action" be fully transparent and permit to see the said background.

Remove the , mask="dbj1.webm" part, and your movie should play fine, like you want it.
 

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,607
2,256
The way I've always thought about this is that normally RenPy's background is transparent (or black). It represents it as a pale checkerboard pattern.

clears the display area and then replaces it with the displayable/image you've asked it to show.
just adds the specified displayable/image to the existing scene. But show leaves the image on the screen until it is removed with either or the next scene statement.

It's fine to use show as long as something (ideally a scene statement) tidies up after it. Where people have had problems in the past is when they only use show and you end up with RenPy trying to keep track of the 400+ displayables all stacked one on top of each other.

Sometimes, particularly with movies, your scene {movie} doesn't start showing fast enough - and so you see the checkerboard background briefly before the movie starts playing.

A number of solutions have been recommended in the past, mainly revolving around the displayable parameters of Movie [...],image= and Movie [...],start_image= parameters.

Some people have said one or both of those have worked for them. Some say neither have. I strongly suspect they do work, but personally I have never tried them, beyond brief tests.

My suggested solution has always been something else though... which is to do it like this...

Python:
image dbj1 = Movie(play="dbj1.webm")

scene dbj1 with dissolve

Again, when I've suggested this to people in the past... some say it works and some say it doesn't. All I can say is that it works for me when I've tried it with other people's code and movie files.

As far as I know, the with dissolve dissolves the new scene with the previously shown scene. The "scene cleanup" I've described still happens, but the previous image remains on screen while the transition is happening. The end result being that while there is still a brief period of transparency as the movie starts playing, it instead overlaps with the image the player was previously looking at rather than an entirely empty screen - so they don't notice it.

Maybe you don't want the with dissolve briefly slowing things down. Maybe the people who've said it doesn't work are right and I'm just being lucky that it works on my machine and for my version(s) of RenPy. Maybe your movie is less than 0.5 seconds long. All I can suggest is that if you don't have a solution you are happy with yet... maybe try this one.

Obviously, this isn't a solution if your scene {movie} with dissolve is the very first line of code within your game - as there won't be a previous image to transition from. But in that case, you can just add a scene black before it.
 
Last edited:

Kalloway

New Member
Game Developer
Aug 24, 2018
12
143
Thank you all, peveryone's solution worked, I appreciate the help!
And what is surprising in this ?

The mask property is here for people who want to integrate their animation in the background. Generally they do this by having a movie with a black background and using it as mask, what will lead to everything not being "the action" be fully transparent and permit to see the said background.

Remove the , mask="dbj1.webm" part, and your movie should play fine, like you want it.
There was nothing really surprising about it, I knew what the show function did, I was just listing all of the steps I took so nothing would get suggested that I'd already tried. I did not know what the mask did, though, my understanding of programming terminology is clearly lackluster, the documentation had the mask function in its code, so I assumed it needed to be there. Figured the answer would be something obvious I didn't understand since the question wasn't really asked before. I appreciate the help, this is what I'm going to end up going with, since it is the simplest. I appreciate it!
 
  • Like
Reactions: AlexaSky

Doorknob22

Super Moderator
Moderator
Game Developer
Nov 3, 2017
2,390
5,809
My suggested solution has always been something else though... which is to do it like this...

Python:
image dbj1 = Movie(play="dbj1.webm")

scene dbj1 with dissolve
I'm stupid. And lazy. I don't know how stuff works and usually don't want to know, I just want to write stories.

Your solution works for me, thanks!
 
  • Like
Reactions: 79flavors

AlisaB

Member
Jun 19, 2018
267
618
This was driving me crazy, when player was clicking quickly then that damn checkered screen appeared for a split second and it looked awful.
The dissolve method didn't work for me.
An easy and fairly elegant way which worked was using something like this:

scene black
show your_animation

At worst, the player will see a black screen for a brief moment which isn't bad as a transition.
Then I suppose I have to hide the your_animation somewhere down the line so it doesn't clutter the code.