Yanfly improved battleback slightly lagging before switching battleback

I don't really know how i can describe this issue but basically i tried to use yanfly improved battleback but there's a slight problem in that before it actually switches to the background i want, there's around like a second or two where it's still the
default battleback

How do i fix this from not happening and it just displays the other battleback immediately

(I attached a gif as a example)
Example1.gif
this is most likely loading delay - all files have to be loaded completely before they can be used, and that is a bigger problem the larger the file is.

one option is to assign that battleback as a static battleback before the plugin gets involved - the effect would be much reduced.

there are a few other options but they have their disadvantages if used wrong, so I suggest you try the battleback change first.
and if that is not enough we need to know more about your battles, how they are started and so on.
this is most likely loading delay - all files have to be loaded completely before they can be used, and that is a bigger problem the larger the file is.

one option is to assign that battleback as a static battleback before the plugin gets involved - the effect would be much reduced.

there are a few other options but they have their disadvantages if used wrong, so I suggest you try the battleback change first.
and if that is not enough we need to know more about your battles, how they are started and so on.
I tried it and it works really nice however...It doesn't work with random encounters which is a problem since most of it is random battles

Is there some way to make it work with random encounters?
youll need an additional plugin that preloads images.

i suggest SRDs preloader core. it lets you preload stuff like sound and images before the game starts or during gameplay.
as the poster above said, in this case you'll need a preloader.

HOWEVER - preloaders are difficult to use intelligently, and anyone trying to just install and forget them will cause more problems to the game than a preloader solves.
never forget: a preloader is a memory leak by design, and used wrong it will cause lag instead of reducing it.

you need to load the pictures shortly before they are used - images loaded at the game start often have been removed from memory long before they are used, or if that was blocked then they cause lag by blocking memory.

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-improved-battleback-slightly-lagging-before-switching-battleback.148572/