Parallel "show picture" event stuttering game

Hey all,

I have a general question that I can't figure out the language to search the forum for to find any previous solutions or advice, so I hope you don't mind me asking it here.

I'm trying to add some larger environment movement -- things like large foreground tree branches moving slightly or a bird flying past. But what I'm finding is that having a parallel event that uses "show picture" to change a branch's position for example, with some little "Waits" in between, makes the game noticeably stutter.

I'd love to just use tileset images on events for these but sometimes it's just not a possibility. My project keeps a really slim cpu/memory footprint so it's not that -- even without any "bind to map" plugins, even something like ...

Show Picture A
Wait 60
Show Picture B
Wait 30

... in parallel, stutters the game. The pictures themselves are small, ~30kb. So I'm wondering what others have done to have larger parallel picture changes without causing jitters to the game.

Thanks so much for any advice!

c
you can make an event for 3 frames, and stepping animation to make it move.
so I dont know why you use pictures for them.

as it should work, and no parallel event required.
you have two problems with the statements in your post:

1) lag is additive. It is very much possible that that event alone only creates minimal lag, but that that minimal lag is the last drop to overflow the reserves, making the lag of other events noticable.

2) your listing the commands alone does not mean that there is not anything else in that event that can cause lag. screenshots of the entire event page including properties are needed to determine howmuch lag that really creates.
you have two problems with the statements in your post:

1) lag is additive. It is very much possible that that event alone only creates minimal lag, but that that minimal lag is the last drop to overflow the reserves, making the lag of other events noticable.

2) your listing the commands alone does not mean that there is not anything else in that event that can cause lag. screenshots of the entire event page including properties are needed to determine howmuch lag that really creates.

Here is one of the parallel events where I'm experiencing stuttering:

2022-11-22 15_21_08-ID_005 - Event Editor.png


@ShadowDragon I would love to use only events in stepping but I've found that it's extremely difficult to integrate with fully parallax environments.

For example, if I have a foreground treebranch that stretches nearly halfway across the screen, I could use an event image with a super gigantic character set, but integrating it with the parallax so it fits in becomes quite challenging. And I'm also limited to just a few frames.

There are also several instances where using pictures provides more functionality, such as rotating an image smoothly. And sometimes, I just need a bunch of different movement frames and using an event with stepping is a bit too limiting.

But I'm totally open to any advice on the topic!
screenshots of the entire event page including properties
Please read what I wrote
Here is one of the parallel events where I'm experiencing stuttering:
Your screenshot is missing the properties.
Please do not crop away parts of the event window - an event is always more than just its content, and bughunting is impossible with only partial info.

That said, depending on what exact effect you get you might have too many waitframes in that event.
This is the full event:

2022-11-22 15_50_08-ID_005 - Event Editor.png


I've done some further testing and found out that regardless of file size, file DIMENSION seems to make a huge difference. When I made the images larger -- even though it was 99% empty space, and file size was still just a few kb, the stuttering got way worse. When I made the image smaller in dimension, stuttering went away.

This actually clears a lot of things up as I didn't realize picture dimension was a factor in game performance as well as picture file size.

Please read what I wrote

Your screenshot is missing the properties.
Please do not crop away parts of the event

By way of feedback, I feel I need to let you know that this comes off as unnecessarily harsh and hurtful, although I know you probably did not intend it that way.

I am not skilled with RPG Maker and didn't quite understand what "properties" meant. I am immensely grateful for the help, I just don't want to be made to feel bad for not knowing something.

Thanks for hearing me out on that :LZSgrin: Maybe you are just having a tricky day! I am still appreciative.
as I didn't realize picture dimension was a factor in game performance as well as picture file size
it's actually the other way around - storage file size is compressed and has almost nothing to do with game performance, because you need the pictures uncompressed to work with them.
and the uncompressed filesize is directly related to picture dimension.

BMP has no compression, so if you make a test and store your pictures as BMP, then the filesize will tell you how much RAM that picture needs while it is used.

as for the way I asked for the screenshot - that correction has to have been asked for hundreds of times each month, and sometimes the few people who help here (for free, no one gets paid) are tired of repeating that again and again.
If it's related to large images, you may want to consider increasing the image cache size, e.g. using the Community_Basic plugin (present by default in new projects). The default cache size is 10 MPix, which is small for most games and can result in excessive reloads if you're using a lot of pictures. Loading files from disk is much slower than reading from RAM, hence the stuttering.

In terms of RAM usage: at 32 bits (= 4 bytes) per pixel, 10 MPix is ~40 MB. You could try increasing the cache size to 50 or 100 MPix to see if that helps.
It might also help to use one of the preloader plugins so that when the map is loaded it pre-caches those images. That could reduce any lag from the first time each image is displayed, then the larger cache keeps them in RAM.
The RMMV core scripts (try to) load all images referenced by an event when that event starts (Game_Interpreter.requestImages), so I think that with a suitably-large image cache the only delay, if any, should be when the event starts.

The problem with a small cache is that it'll load all images from start to finish, but the last few images might push the first one out of cache, making the whole thing redundant. You can work around this by ensuring that each event only uses a few images, but that can still cause a noticeable delay when starting an event with new images.

Technically, you can just use a map event for preloading, no plugin required. E.g. a Parallel event like: Show Picture (opacity 0), Erase Picture, Erase Event. The event will pause at Show Picture until the picture is loaded/shown. You can use a similar trick with other image types.
The RMMV core scripts (try to) load all images referenced by an event when that event starts (Game_Interpreter.requestImages), so I think that with a suitably-large image cache the only delay, if any, should be when the event starts.

Thanks @caethyril and @ATT_Turan -- I'm realizing how clueless I am about how RPGM handles images and caching. I'm going to run a bunch of experiments on this today and I'll get back to you with my results.

I must have erased the MVCommons plugin because it wasn't in my project but I found it and will try it out.

In my event that was stuttering (posted above), I was alternating between two pictures with the same number ID, but not erasing them. It stuttered each time, which confused me -- I would have thought as you've both said that once an image is loaded on a map, it should be ready to go.

But now I'm wondering if the way I'm doing it with the same number, and not erasing them first, is causing the issue.

Lots to try here -- thanks for the help!
I was alternating between two pictures with the same number ID, but not erasing them. It stuttered each time, which confused me -- I would have thought as you've both said that once an image is loaded on a map, it should be ready to go.

But now I'm wondering if the way I'm doing it with the same number, and not erasing them first, is causing the issue.
It's most likely what caethyril already explained, that your image cache is too small to hold both of those images at the same time.
Also, just to be clear: the plugin I mentioned is Community_Basic, not MVCommons. It has a cacheLimit parameter that can be adjusted in the Plugin Manager.

Alternatively you could just stick this line in a .js file and load it as a plugin:
JavaScript:
ImageCache.limit = 50 * 1000 * 1000;
Replace the 50 with whatever value you like (default is 10).

Original thread: https://forums.rpgmakerweb.com/threads/parallel-show-picture-event-stuttering-game.152829/