Preloader with less Ram use?

KiraNet

Engel der Dunkelheit
Veteran
Joined
Jan 2, 2019
Messages
54
Reaction score
7
First Language
Deutsch
Primarily Uses
RMMV
Does anyone know a Preloader Plug In that uses not insane amount of ram? I need a preloader for my pics because they flicker during change to the next one... I used the one from SRD befor but that took tooooo much ram and the game kept crashing after 30 minutes... it reached 1.6 GB after just 5 minutes eh... I tried the one from Galf which did nothing actually .-. I need one for version 1.5.1
 

ShadowDragon

Veteran
Veteran
Joined
Oct 8, 2018
Messages
2,938
Reaction score
1,044
First Language
Dutch
Primarily Uses
RMMV
galv_ImageCache, load image directly or ON map where the actor goes/is, when it
is possible to use. Use fast and smoothly.

the only problem probably is, it doesn't empty the cache, but otherwise,
1 of the most usefull for picture using though.
 

KiraNet

Engel der Dunkelheit
Veteran
Joined
Jan 2, 2019
Messages
54
Reaction score
7
First Language
Deutsch
Primarily Uses
RMMV
galv_ImageCache, load image directly or ON map where the actor goes/is, when it
is possible to use. Use fast and smoothly.

the only problem probably is, it doesn't empty the cache, but otherwise,
1 of the most usefull for picture using though.
I tried that one and put in the Picture Folder to be loaded from the beginning cause its the only one I need to be preloaded but the Plug In from Galv did nothing... (Thats the one I meant that I tried after SRD) Maybe I did somehing wrong?
 

ShadowDragon

Veteran
Veteran
Joined
Oct 8, 2018
Messages
2,938
Reaction score
1,044
First Language
Dutch
Primarily Uses
RMMV
galv plugin works correctly , did you use teh scriptcall correctly? or the param setting?
if it doesn't work from the params, you can initilize together with the start up of your game,
like when the Intro starts to load those images.

I dont have that problem on my Evented Main Menu tutorial (needs to be updated),
if used correctly.

can you screenshot the param/event where it is used?
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,528
Reaction score
14,259
First Language
English
Primarily Uses
RMVXA
The issue here is NO such preloader exists sadly. Images have to be loaded uncompressed, and that takes up a whopping amount of space. You would really need to load your images only when needed and see if you can lower the size of them, as otherwise they will just take up a lot of memory.

And yes, uncompressed images need tons of memory. You'd be shocked how much it takes for just a 816 x 624 image to load into memory uncompressed.
 

KiraNet

Engel der Dunkelheit
Veteran
Joined
Jan 2, 2019
Messages
54
Reaction score
7
First Language
Deutsch
Primarily Uses
RMMV
The issue here is NO such preloader exists sadly. Images have to be loaded uncompressed, and that takes up a whopping amount of space. You would really need to load your images only when needed and see if you can lower the size of them, as otherwise they will just take up a lot of memory.

And yes, uncompressed images need tons of memory. You'd be shocked how much it takes for just a 816 x 624 image to load into memory uncompressed.
Oooooh maybe thats the problem... I tried to preload 1.435 Pictures 850 x 500 (Character Profiles... I have alot of them eh...) I didnt knew that they take up so much! ooh noooo I'm so dumb .-. hm is there any preloader or a way to preload specific pictures for a current event and then delete them from the memory when the event is done manually? That would be a muuuch smaller amount then... My events usually only play ones
 

ShadowDragon

Veteran
Veteran
Joined
Oct 8, 2018
Messages
2,938
Reaction score
1,044
First Language
Dutch
Primarily Uses
RMMV
you can reduce the size by 80% though, and with galv, you can load it when need it.
but need to be modified to delete them somehow (or save way you load them).

I couldn't figure that you though, but to reduce the size, use tinypng, the bad side
on that is, you can do 20 images each time, when paid, you can bulk all the pictures.

images I create, is something I can directly reduce (in a similair way).
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,528
Reaction score
14,259
First Language
English
Primarily Uses
RMVXA
What may work is to preload images that you need on each map only. You could do that with a parallel process that you end with erase event. Only issue is it might slow down the map transition some.

BTW I ran the numbers for 1435 850 x 500 images uncompressed and it is 19.156 GB. So that is probably the issue too. I don't know if tinypng will help at all as it will still be uncompressed when loaded to memory and you need 32 bits of memory per pixel loaded too at mimimum (8 for the red 8 for green 8 for blue and 8 for alpha or transparancy value, and there could even be more with today's monitors that is loaded too, that's just the values I know of off the top of my head), so the math is 1435 * 850 * 500 * 32.
 

KiraNet

Engel der Dunkelheit
Veteran
Joined
Jan 2, 2019
Messages
54
Reaction score
7
First Language
Deutsch
Primarily Uses
RMMV
Ah thank you both! I will try doing that with the parallel process and look if that works... and maybe if tinypng wont help with that problem it would at least reduce the size cause I'm not even half done with the Game so yeah... Ehm Tinypng doesnt lower the quality noticeable or? I dont know how this stuff works ^^" Btw what is the max RAM that should a RPG Maker Game use? Is over 1GB to much? Even if I dont use any preloader my Game still raises just slower over 1GB... I tested at the same point and with Preloader it had at that point 1.6 GB in use and without 1GB so after 7 minutes... I havent test it completely yet but I havent reached a stop point yet .-. Idk if another Plug In causes that or if this is normal to be honest I never looked at the RAM useage befor... I just started cause the Game kept crash
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,420
Reaction score
7,709
First Language
German
Primarily Uses
RMMV
@KiraNet
I think the biggest part of the problems is several misunderstandings what preloaders and compression really means. Because several comments above show a lack of that understanding.

First, compression is for storage only. To use a picture it needs to be uncompressed in RAM.
You can compare this with the street map of a large city. Folded it is very small and fits into the car compartment easily, but to use it you have to unfold it - and completely unfolded it rarely fits into the car as it could easily be one or two meters across.

If you save a picture as BMP, you'll see how much memory that picture needs while in RAM - because BMP has no compression, filesize is true size. All those programs like tinypng work on that filesize by increasing the compression - which means they have no effect on the RAM use after the computer uncompresses them.
The only things that can reduce RAM usage of a picture is to reduce either its size (and that won't work with most parts of the engine) or its color depth (and 256 colors look a lot worse than 16/24-bit colors).


second, the purpose of a preloader.
A picture needs to be loaded before it can be displayed, and especially for larger pctures that loading can take some time. So a preloader is there to allow the computer to tell "in ten second I'll need that picture, please start loading it" so that when the picture is needed, it is already loaded in RAM.

However that does NOT mean "load everything in the beginning, hours before the pictures are really needed" - because as you have seen, pictures require simply too much RAM to have everything ready at all times.
Preloaders work best if you give the commands to load the pictures (or audios or whatever) about five to ten seconds before the file is needed. A shorter span has the risk of the loading not yet complete, a longer span has the risk of too much memory usage and disabling the garbage collector that is supposed to remove resources after their use.

And that is why so many users have problems with preloading plugins: they don't understand that the quality of the plugin depends on the developer telling the plugin when to load what.
 

KiraNet

Engel der Dunkelheit
Veteran
Joined
Jan 2, 2019
Messages
54
Reaction score
7
First Language
Deutsch
Primarily Uses
RMMV
@KiraNet
I think the biggest part of the problems is several misunderstandings what preloaders and compression really means. Because several comments above show a lack of that understanding.

First, compression is for storage only. To use a picture it needs to be uncompressed in RAM.
You can compare this with the street map of a large city. Folded it is very small and fits into the car compartment easily, but to use it you have to unfold it - and completely unfolded it rarely fits into the car as it could easily be one or two meters across.

If you save a picture as BMP, you'll see how much memory that picture needs while in RAM - because BMP has no compression, filesize is true size. All those programs like tinypng work on that filesize by increasing the compression - which means they have no effect on the RAM use after the computer uncompresses them.
The only things that can reduce RAM usage of a picture is to reduce either its size (and that won't work with most parts of the engine) or its color depth (and 256 colors look a lot worse than 16/24-bit colors).


second, the purpose of a preloader.
A picture needs to be loaded before it can be displayed, and especially for larger pctures that loading can take some time. So a preloader is there to allow the computer to tell "in ten second I'll need that picture, please start loading it" so that when the picture is needed, it is already loaded in RAM.

However that does NOT mean "load everything in the beginning, hours before the pictures are really needed" - because as you have seen, pictures require simply too much RAM to have everything ready at all times.
Preloaders work best if you give the commands to load the pictures (or audios or whatever) about five to ten seconds before the file is needed. A shorter span has the risk of the loading not yet complete, a longer span has the risk of too much memory usage and disabling the garbage collector that is supposed to remove resources after their use.

And that is why so many users have problems with preloading plugins: they don't understand that the quality of the plugin depends on the developer telling the plugin when to load what.
Oh thanks Point one makes sense but for Storage size it would at least help

To the second Point... Would it still better work and not eat all RAM if I would preload the Pics of an current playing event at the beginning? Cause my Events are build up like... Showing the potraits of the characters all in a room and then comes a text box and if the text box gets closed the next pics do appear like one charater gets an open mouth or changes the pose and then a text box comes again so I cant really count 10 seconds cause its depending when the textbox gets closed... I just want to get rid of the flicker when the game starts to load the next pic
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,420
Reaction score
7,709
First Language
German
Primarily Uses
RMMV
no one can really tell without testing.

and don't count seconds, that was only an average as an example. The key is to release RAM after a picture is no longer needed, and load the next picture before it is used. Small pictures are usually loaded in half a second, so for a small picture you should time it nearer to use than for a full parallax map (which might need several seconds to be completely loaded).

You can consider the RAM like a pipe, with things stuffed in on one end and dropping out as no longer needed on the other end. If you wait with stuffing the next part in, then the flow in the pipe might stop and the screen flicker due to missing picture data.
Stuffing in too much will have the early parts drop out before they are even used (memory overload).
closing the other end so that things aren't dropped from RAM is what is called a "Memory Leak" as in RAM becoming unusable.
And some people have longer pipes (=more RAM) than others and therefore can hold more parts.

Timing it too close to what your own computer can do makes for better performance, but requires at least the same amount of RAM to keep that performance.

RAM management is not easy - otherwise you wouldn't have memory leak errors or performance problems or a lot of other things. And while that isn't exclusive to the RPG-Makers, the way how plugins can mix up code from different programmers is one of the reasons why the RMs always have been more performance-critical than other games and programs.
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,528
Reaction score
14,259
First Language
English
Primarily Uses
RMVXA
BTW when I did the math I accidentally posted it in Gigabits not gigabtyes. Divide by 8 to get the real GB. And that still assumes 256 colors, which many pictures use more than that, Andar might have a better idea what is all loaded into memory when a picture is loaded.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 9)

Latest Threads

Latest Profile Posts

This is relevant so much I can't even!
Frostorm wrote on Featherbrain's profile.
Hey, so what species are your raptors? Any of these?
... so here's my main characters running around inside "Headspace", a place people use as a safe place away from anxious/panic related thinking.
Stream will be live shortly! I will be doing some music tonight! Feel free to drop by!
Made transition effects for going inside or outside using zoom, pixi filter, and a shutter effect

Forum statistics

Threads
105,999
Messages
1,018,220
Members
137,778
Latest member
lifehoroscopee
Top