- Sep 10, 2017
- 17
- 86
When I put in an animation I recorded on a loop in my game, it always keeps stuttering. It is just a 100-120 frames loop that's smooth when I preview it in vegas and stutters in renpy. Any way around this?
How did you create the animation? As a video? Or is it a series of images that Ren'py animates using ATL?
If it's the latter, you're probably running into issues with Ren'py's image cache - Ren'py's image loading system isn't designed for this kind of thing (animations made with a very large number of large frames).
renpy uses ffplayer which can be scripted to loop frames of a video. loop starting at frame 20 - 59. You can actually play video forwards and backwards, and write in some interactivity for the player, if you wanted to. For example, moving the mouse can make the player fuck faster, or slower adjusting the frame rate, etc. I posted some scripts previously, but you can google the docs if you're interested.It's actually a video, rendered in vegas as a 1080p 30fps mp4 and converted to webm and ogv using vp8 and vp9 encoding. Both had the same results. I kind of resolved the issue where I put on around 4 loops of recorded video and then the stutters on the actual ren'py loop are much less noticable. Although still kind of noticable and it will make the game bigger in the end, which is kind of not ideal. Still looking for a fix though.
That sounds really interesting, I will definitely look into the docs or try to stalk out the scripts from your history. I had no idea it could do something like that. Thank you for the helprenpy uses ffplayer which can be scripted to loop frames of a video. loop starting at frame 20 - 59. You can actually play video forwards and backwards, and write in some interactivity for the player, if you wanted to. For example, moving the mouse can make the player fuck faster, or slower adjusting the frame rate, etc. I posted some scripts previously, but you can google the docs if you're interested.
Hmmm. What kind of bitrate is the video using? If it's quite high, perhaps Ren'py is having trouble keeping up with the required decode rate. I don't have this kind of problem, but the videos I tend to create are probably substantially smaller than yours, being both 720p instead of 1080p, and also running at 24fps instead of 30fps. It might be an interesting experiment to re-code the video at a lower bitrate to see if that makes a difference. (Not that you may want to use the lower bitrate, since it'll be lower quality, but it might indicate where the problem potentially lies.)It's actually a video, rendered in vegas as a 1080p 30fps mp4 and converted to webm and ogv using vp8 and vp9 encoding. Both had the same results. I kind of resolved the issue where I put on around 4 loops of recorded video and then the stutters on the actual ren'py loop are much less noticable. Although still kind of noticable and it will make the game bigger in the end, which is kind of not ideal. Still looking for a fix though.
I tried re-encoding them with HandBrake, so I don't think that's the problem, but I don't think I ever touched the bitrate settings, it's an interesting thing to take a look at. I thought that the problem might be that it could run better when you compile a build, but that didn't seem to be the case. I'll try to experiment with fps and the bitrate.Hmmm. What kind of bitrate is the video using? If it's quite high, perhaps Ren'py is having trouble keeping up with the required decode rate. I don't have this kind of problem, but the videos I tend to create are probably substantially smaller than yours, being both 720p instead of 1080p, and also running at 24fps instead of 30fps. It might be an interesting experiment to re-code the video at a lower bitrate to see if that makes a difference. (Not that you may want to use the lower bitrate, since it'll be lower quality, but it might indicate where the problem potentially lies.)
Other speculation (and it's just guesswork) is that it might have something to do with the process via which you create the video - things like "how many p- and b-frames vegas generates" that cause the video to be harder for Ren'py to work with.
If I read the documentation correctly "scene" should clear the current cache if I am not wrong, so cache hopefully isn't a problem in this case.You can also clear the Ren'Pys cache before the Animation starts. (This isn't always ideal, sort of a last resort.)
Also make sure that all the scenes/images in the script that have been "Shown" are "hidden" after that scene. As Ren'Py will still store it, which can cause potential lag in your animation and future scenes.
You can also do the clear.image cache, i don't fully recall the code. But it's in the Ren'Py docs.I tried re-encoding them with HandBrake, so I don't think that's the problem, but I don't think I ever touched the bitrate settings, it's an interesting thing to take a look at. I thought that the problem might be that it could run better when you compile a build, but that didn't seem to be the case. I'll try to experiment with fps and the bitrate.
If I read the documentation correctly "scene" should clear the current cache if I am not wrong, so cache hopefully isn't a problem in this case.
I don't think the "scene" command clears the cache - it clears images being displayed on a layer, but I don't think it directly involves the cache. As I understand things, Ren'py normally tries to predict the image(s) you're going to need a couple of statements ahead and tries to have those pre-loaded in the cache via a background process so that the user doesn't see any "loading the images off disk" lag when new images are called up. This is where ATL animations with a large number of images (which I know isn't your case) can run into problems - if Ren'py can't fit all those images into the cache, you get a lot of disk thrashing constantly loading images.If I read the documentation correctly "scene" should clear the current cache if I am not wrong, so cache hopefully isn't a problem in this case.
It don't. The only thing cleared byI don't think the "scene" command clears the cache
scene
is the screen layer (perhaps a little more but I'm not sure right now). It wouldn't make sense that the (should be) most used image statement clear the cache when called, since it would make both the cache and the prediction mechanism totally useless.That's exactly that. And like, as far as I remember, movies aren't cached, clearing the cache would change nothing here.As I understand things, Ren'py normally tries to predict the image(s) you're going to need a couple of statements ahead and tries to have those pre-loaded in the cache via a background process so that the user doesn't see any "loading the images off disk" lag when new images are called up. This is where ATL animations with a large number of images (which I know isn't your case) can run into problems - if Ren'py can't fit all those images into the cache, you get a lot of disk thrashing constantly loading images.
image myMovie = Movie( play="07_03_din.avi" )
screen myMovieCache:
add "myMovie":
xpos config.screen_width + 10
ypos config.screen_height + 10
label start:
show screen myMovieCache
"blablabla"
"blablabla"
hide screen myMovieCache
show myMovie
i think the bug with some renders not displaying at all, and ending 'animations' not replaying on Again button is when you jump to a label you may have scene pictures without dialogue and separated only by "pause 1" lines. i think pause doesnt work here and renpy skips all these pictures to the next one with dialogue.
what fixed it for me was adding a dummy character in script.rpy like so:
define filler = Character("")
open all rpys in np++.
then do two preliminary replacements (to avoid false hits in final stage):
pause 10 -> pause 20
pause 1.5 -> pause 1
finally replace in all rpys:
pause 1 -> filler " "
Hit Save All in np++.
According to what I understood of the message you quoted, the actual animation look like this :Is there a problem with the loops if they are in the images but do not ... errr ... loop?
scene frame01
pause 1
scene frame02
pause 1
scene frame03
pause 1
pause
statement ; it would have been different if it was $renpy.pause
, the optimization would have attached them to the previous statement, and perhaps made the pause transparent.image myAnim:
"image/frame01.png"
pause 1
"image/frame02.png"
pause 1
"image/frame03.png"
label whatever:
show myAnim
Its fine actually the Angela animations didn't come out well enough last minute so I cut them and probably going to stop doing animations because they are costing me too much time so there was suppose to be Angela content but I get your point.
Ah! I saw the slower/faster options that did nothing, and was perplexed. Looking at the extracted images, I thought is saw that the frames are there... but using full page renders for animations seems like a resource sink, when sprites are probably a better option, for both render times and file size... Corrupting the Intern seems to do a ton of sprite based dev well-ish.
The catch is, actually, the sheer ego of the fact that, the very first scenes are botched animations that this dev chose to leave in his game, even though he got to actually implement animations through clips much later in the game.The problem with spirits is... they loose all shadows however slight the shadows may seem in most spots if you don't have them they become eye catching... or else the render time actually is nearly the same... I think the reason the art is the way it is, is because I don't use spirits, but you guys have fun or not have fun... download or don't download the 1GB... its up to you guys.
It happen too often. The games are released as update, and too many devs decide that what is already done shouldn't change. I can understand when it's the game mechanism, but when it's the CG it make less senseThe catch is, actually, the sheer ego of the fact that, the very first scenes are botched animations that this dev chose to leave in his game, even though he got to actually implement animations through clips much later in the game.