Ren'Py Animated sex scene problem. Help, please!

mickydoo

Fudged it again.
Game Developer
Jan 5, 2018
2,446
3,542
Hi all, I have just made my first sex animation, I'm quite chuffed with myself. Its 18 frames and made into an avi in premier pro, I cut it back to about 5mb and it's 5 seconds long. I tried looping it in renpy with $ renpy.movie_cutscene("sex_2.avi", loops=5) whick works but there is a slight delay between loops, which ruins the whole thing. Is there another way in renpy to keep the file playing until the user clicks?
 

Papa Ernie

Squirrel!?
Uploader
Donor
Dec 4, 2016
12,327
47,047
Hi all, I have just made my first sex animation, I'm quite chuffed with myself. Its 18 frames and made into an avi in premier pro, I cut it back to about 5mb and it's 5 seconds long. I tried looping it in renpy with $ renpy.movie_cutscene("sex_2.avi", loops=5) whick works but there is a slight delay between loops, which ruins the whole thing. Is there another way in renpy to keep the file playing until the user clicks?
You will probably have more luck posting this question in the Programming & Development forum. Would you like me to move this thread to there?
 

OhWee

Forum Fanatic
Modder
Game Developer
Jun 17, 2017
5,609
28,211
Not sure if it'll help with your 'pause' issue, but just for giggles, in options.rpy, what is your image cache set to?

This will be the line you'll be looking for:
config.image_cache_size = 128
(or some other number)

In another thread (Brothel King), we've had people set this as high as 1024, and they have seen significant improvements in performance. Depending on how many images and videos you have in your game, it might help. That game doesn't use full animations though, at least not very often.

This probably won't help with the 'renpy video loop' issue, but it might. You can at least give it a whirl and see if it helps.

Other than that, hopefully others will have a suggestion r.e. how to improve the Renpy looping experience. This seems to be a common problem with Renpy, however. This thread discusses a workaround, but the guy didn't get an answer on how to apply the 'fix' to all builds.


From what I read in a few lemmasoft threads, though, this is an ongoing issue that PyTom hasn't quite fully resolved as of yet. In one thread it was mentioned that having Multiple Nvidia cards in your system had an associated memory leak, and eventual out of memory errors. PyTom mentioned that he'd look into getting a second card for his system to see if he could recreate the issue, and then maybe see if Nvidia would look into 'fixing' the issue in their OpenGL drivers, but I didn't notice a followup to that in my Google search.
 
  • Like
Reactions: Papa Ernie

f95zoneuser463

Member
Game Developer
Aug 14, 2017
219
1,016
"sex_2.avi"
Instead of AVI use a modern container format like MP4, WEBM or MKV (supported by Ren'Py?). Why? Time codes have always been an issues with the AVI container format and could potentially be the cause for the delay problem. But even if it's not the problem it would be 'best practice'. AVI is a 27 years old standard with many for modern digital videos.

From older tests with short videos in Ren'Py I know that the engine doesn't like high framerates. Stick to 30 fps max. High fps videos play but drop frames a lot (that's not a *your computer is to slow*-issue, because I know some smart-ass will think/comment that).

As always I recommend WEBM with VP9 encoded video and Opus encoded audio. This is the best compression supported by Ren'Py. Every other format will result in bigger files or worse quality. Avoid .

Is there another way in renpy to keep the file playing until the user clicks?
Put it in a screen and use a button to continue. Here is a quick copy-paste from my project with a re-usable screen for that:
Python:
image v_dream_classroom_tracy_cowgirl = Movie(play="videos/v_dream_classroom_tracy_cowgirl.webm")

screen sm_movie_anim(movie, lbl, text="continue"):
    layer "master"
    add movie

    textbutton text:
        xalign 0.5
        yalign 0.98
        action Jump(lbl)
        hover_sound audio.hover

call screen sm_movie_anim(movie="v_dream_classroom_tracy_cowgirl", lbl="t_dream_classroom_player_tracy_long_cum", text="cum") with dissolve

label t_dream_classroom_player_tracy_long_cum():
    "story continues ..."
If you want no visible textbutton replace it with an invisible fullscreen imagebutton to catch the click to continue.
 

mickydoo

Fudged it again.
Game Developer
Jan 5, 2018
2,446
3,542
The AVI thing was just me getting excited, I converted it from the massive file premier pro spits out with Aimersoft video converter and it was the first thing I tried and it worked, so yeah, it never occurred to me to use another format. its a MKV now which is a bit smaller but the same quality. I'm mucking about with the screen suggestion, I keep getting an error "parameter movie has no value" but I understand your screen and should be able to work out the error. Im in Australia, its summer, its a fucking heatwave with no end in site, its hard to think lol.

Update - I couldn't get the screen to work as in the example, but using the the idea I called a screen at the end of the animation with two textbuttons, keep going and cum, which is working fine, thanks a lot all who posted.
 

wurg

Active Member
Modder
Apr 19, 2018
705
1,623
The AVI thing was just me getting excited, I converted it from the massive file premier pro spits out with Aimersoft video converter and it was the first thing I tried and it worked, so yeah, it never occurred to me to use another format. its a MKV now which is a bit smaller but the same quality. I'm mucking about with the screen suggestion, I keep getting an error "parameter movie has no value" but I understand your screen and should be able to work out the error. Im in Australia, its summer, its a fucking heatwave with no end in site, its hard to think lol.

Update - I couldn't get the screen to work as in the example, but using the the idea I called a screen at the end of the animation with two textbuttons, keep going and cum, which is working fine, thanks a lot all who posted.
You probably got that error because you didn't define movie first, when I was combining the game Two Weeks into one file I ran across how he did it, he defined movie once and the used that definition to play the various .webm files to the definition of what movie was. Please see the images below, it may help you understand what went wrong and another way of displaying animations in your game.
 

The Coder

Active Member
Game Developer
Jun 17, 2017
879
1,296
Hi all, I have just made my first sex animation, I'm quite chuffed with myself. Its 18 frames and made into an avi in premier pro, I cut it back to about 5mb and it's 5 seconds long. I tried looping it in renpy with $ renpy.movie_cutscene("sex_2.avi", loops=5) whick works but there is a slight delay between loops, which ruins the whole thing. Is there another way in renpy to keep the file playing until the user clicks?
Did you try show image instead

image movieimage= Movie(play="movies/moviefile.webm")
show movieimage
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
9,948
14,548
Did you try show image instead
Since there's almost one and half year since this thread haven't had new reply, and that mickydoo regularly update his game, a fair guess is that he solved his problem.
 

mickydoo

Fudged it again.
Game Developer
Jan 5, 2018
2,446
3,542
Since there's almost one and half year since this thread haven't had new reply, and that mickydoo regularly update his game, a fair guess is that he solved his problem.
Yeah my noob days at such things lol
 

rayminator

Engaged Member
Respected User
Sep 26, 2018
3,040
3,109
image movieimage= Movie(play="movies/moviefile.webm")
show movieimage

like that. loops seamlessly by default
this will help even more by putting a start and a end image to it, it will take the gray&white away

Code:
image movieimage= Movie(play="movies/moviefile.webm", start_image="images/your_image.png", image="images/other/your_image.png", loop=True)