Ren'Py Is it doable making a VN entirely with webms?

Adyenus

New Member
Dec 1, 2023
11
7
Good morning.

I have someone wanting me to make 2 second loop webms instead of webps for a VN because he wanted it to look more natural (characters blinking, breathing). The files have more or less the same size as webp (around 500kb). Would it cause any performance issues, like the game freezing while skipping text? Thank you in advance.
View attachment testmov.webm
 

Insomnimaniac Games

Engaged Member
Game Developer
May 25, 2017
2,567
4,565
It's doable, but I would say it's extremely unnecessary. Kinda brings out a little uncanny valley to me. To have all this character motion, but not have their mouths move seems a little weird. At least to my eyes.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,130
14,809
Would it cause any performance issues, like the game freezing while skipping text?
Unlike pictures, movies aren't predicted and cached prior to their needs, so yes it will cause performance issues. If effectively the movies smalls, it will probably be none sensible in regular use, but I wouldn't say the same for skipping.
Ren'Py already stutter time to time when you skip for a long time, because it display the images faster than it cache them, and therefore sometime needs to catch up. So, with none cached movies, I guess that skipping would be way slower.
 
  • Like
Reactions: Adyenus

Adyenus

New Member
Dec 1, 2023
11
7
Unlike pictures, movies aren't predicted and cached prior to their needs, so yes it will cause performance issues. If effectively the movies smalls, it will probably be none sensible in regular use, but I wouldn't say the same for skipping.
Ren'Py already stutter time to time when you skip for a long time, because it display the images faster than it cache them, and therefore sometime needs to catch up. So, with none cached movies, I guess that skipping would be way slower.
I feared that. Most vns i played had a little stutter when loading webms. Skipping though dozens and dozens of them seems like a terrible idea. And as Insomnimaniac Games mentioned, they don't add anything to the experience unless they're actual animations. I'll try to dissuade him from this idea. Thank you.
 

no_more_name

Newbie
Mar 3, 2024
53
14
Unlike pictures, movies aren't predicted and cached prior to their needs, so yes it will cause performance issues.
Oh I see, so that's why. I use small alpha videos (around ~5Mo each, total around ~30Mo) and there is like, a miliseconde glitch when these are shown. It's not that awful but is there some way to force cache thoses?
 

Turning Tricks

Rendering Fantasies
Game Developer
Apr 9, 2022
811
1,804
Good morning.

I have someone wanting me to make 2 second loop webms instead of webps for a VN because he wanted it to look more natural (characters blinking, breathing). The files have more or less the same size as webp (around 500kb). Would it cause any performance issues, like the game freezing while skipping text? Thank you in advance.

Honestly, for simple loops of blinking and fake breath motions, just use the ATL features already built into Ren'py to display loops of webp's. You don't need 24 fps for these effects. I've done sequences and loops with up to 30-40 webp's in a declared image and they work fine, with no stutter. I've also made layered scenes with a background and multiple animation loops playing on top, for things like random blinking on two characters. BTW, that's one of the things that makes your webm example above look unreal.. the blink timing is set. If you did this with ATL using static webp's, you can randomize the blinking.

For example, a random blink code could look like this. Takes only two images and yet looks surpringingly lifelike when it's running...

Python:
image protag_blinking:
    "images/protag_eyes_open.webp"
    choice:
        4.5
    choice:
        3.5
    choice:
        1.5
    "images/protag_blinking.webp"
    .25
    repeat

I use the following code to do scenes where multiple characters are having dialogue. In this example, two characters are sitting at a table. The s1_background is the main full frame background image of the scene (in this example, it would be the kitchen). The talk_listen_bg image is the 'middle' layer, with both characters, in their pose of one talking and one listening. Finally, the two images s1_toon1_talking and s1_toon2_listening are the top layers showing only the heads of these characters with their blinking animations.

Breaking scenes up like this allows you to render base images and then cut them up and layer them to make all sorts of transitions and effects, with very little effort. You can reuse a lot of the images as well. For example, your images for the faces doing different things like talking, listening, laughing .. all with rendom blinking, can easily be layered on different 'middle' layers of the characters doing different poses and with different outfits one. Then you only need to spot render those new parts, instead of doing the whole scene over.

Python:
image s1_background = "images/paperdolls/scene1/scene1_BG.webp"

image s1_toon1_talking:
    "images/paperdolls/scene1/toon1_talking_eo.webp"
    choice:
        4.5
    choice:
        3.5
    choice:
        1.5
    "images/paperdolls/scene1/toon1_talking_bl.webp"
    .25
    repeat

image s1_toon2_listening:
    "images/paperdolls/scene1/toon2_listening_eo.webp"
    choice:
        4.5
    choice:
        3.5
    choice:
        1.5
    "images/paperdolls/scene1/toon2_listening_bl.webp"
    .25
    repeat

image s1_talk_listen = Composite(
        (1920, 1080),
        (0, 0), "s1_background",
        (0, 0), "images/paperdolls/scene1/talk_listen_bg.webp",
        (0, 0), "s1_toon1_talking",
        (0, 0), "s1_toon2_listening")

So when you use this code, it would be something like this...

Python:
scene s1_talk_listen with dissolve
t1 "I'm doing the talking on the right here.... blah blah"
t2 "I'm listening on the left here."
The final result looks something like this...



View attachment blink3.mp4
 

no_more_name

Newbie
Mar 3, 2024
53
14
Most games seem to just use a small fade to black to hide it. I don't know much about renpy, that's just been my experience.
I can't really use this and they already start at alpha 0, but transparency wanna glitch anyway. It's not that a huge deal and sometimes barely noticable, more like an annoyance. But yeah if I could cache them that would be cool.

Glitch in question, happen also when resizing window ->

View attachment pythonw_hIQnK15k2V.mp4
 
Last edited:
  • Thinking Face
Reactions: Insomnimaniac Games

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,130
14,809
It's not that awful but is there some way to force cache thoses?
Not really, at least not without reworking the whole cache.

But there's a way that can possibly speed up all this:
Python:
screen fakedCache( what ):
    add what pos( config.screen_width + 10, config.screen_high + 10 )

label whatever:
    show screen fakedCache( "videos/myvideo.webm" )
    [few blabla lines]
    hide screen fakedCache
    # play the movie
The video will be played outside of the display zone, so invisible to the player.
And it's displayed from a screen, therefore the loading time should be transparent, because done while the following statement is processed.
In the end, when few statements later you'll play the video normally, it should still be in the drive or OS cache, what should speed up the loading time.

It's purely experimental, so I don't guaranty the result, but it probably worth a try.
 
  • Like
Reactions: no_more_name

Turning Tricks

Rendering Fantasies
Game Developer
Apr 9, 2022
811
1,804
Not really, at least not without reworking the whole cache.

But there's a way that can possibly speed up all this:
Python:
screen fakedCache( what ):
    add what pos( config.screen_width + 10, config.screen_high + 10 )

label whatever:
    show screen fakedCache( "videos/myvideo.webm" )
    [few blabla lines]
    hide screen fakedCache
    # play the movie
The video will be played outside of the display zone, so invisible to the player.
And it's displayed from a screen, therefore the loading time should be transparent, because done while the following statement is processed.
In the end, when few statements later you'll play the video normally, it should still be in the drive or OS cache, what should speed up the loading time.

It's purely experimental, so I don't guaranty the result, but it probably worth a try.
Interesting.

I was wondering about things like renpy.start_predict_screen() and caching and I just did a little surfing right now to read up on it, and ironically, renpytom was talking about this just the other day...

prediction.JPG
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,130
14,809
I was wondering about things like renpy.start_predict_screen() and caching and I just did a little surfing right now to read up on it, and ironically, renpytom was talking about this just the other day...
There's probably a way to also deal with this.

You don't need to play the whole video, just to have it in the drive/OS cache, so I guess that if you've something like this should also works:
Python:
screen fakedCache( what ):
    timer 2 action Hide( "fakedCache" )
    add what pos( config.screen_width + 10, config.screen_high + 10 )
Ren'Py will still ask for the video, what will load it in the drive/OS cache, but the screen will be automatically hidden after 2 seconds, therefore the impact for the player should be near to null.