Map Cache Fix

brandos

Veteran
Veteran
Joined
May 25, 2013
Messages
147
Reaction score
31
First Language
German
Primarily Uses
Hey folks,


I commissioned this awesome script from Felix "Xilefian" Jones and he allowed me to post it here.


This Plugin optimises the way spritesets are handled by Scene_Map by caching them. By using a cache, the memory usage and CPU usage is reduced massively.


You can even choose after which number of map transitions it cleans the cache. In my eyes its a must have problem for big projects with many parallax maps.


This also fixes completly the bug that the game starts to get slow when spamming the menu.


You can get it: here
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,230
Reaction score
3,079
First Language
English
If the sprites are cached, wouldn't that simply leave more data in memory until you explicitly clear it out?
 

brandos

Veteran
Veteran
Joined
May 25, 2013
Messages
147
Reaction score
31
First Language
German
Primarily Uses
To be honest i'm not really fond with the topic but I know that there is a critical error/mistake in the MV Engine. You can easily replicate it. Create a new project, add a large parallax map and then spam right click, after some while your Ram usage goes up. The same when you travel between maps with parallax maps. If you plan to use parallax maps bigger than 40 x 40 tiles this script is required otherwise it it will lead to freezes or random shut downs of the game.
 

KaYsEr

Koruldia
Veteran
Joined
Mar 14, 2014
Messages
227
Reaction score
455
First Language
French
Primarily Uses
RMMV
Wow, you are right. We usually never spend too much time in our games, walking between many maps etc (or call the menu more than 10 times), that's what happen when you only "play-test" your project, we close the game very often and start fresh.


But this issue is very serious, I tried to call the menu many time on a simple map with just some parallax fogs and my RAM was full in no time, the menu took longer and longer to appear/disappear and even the sound effects (when you open/close) started to glitch.


Thankfully this plugin fixed everything, but I really think you should show that to the staff, this is a game breaking problem that need to be officially fixed in a next update.


Thanks for sharing!
 

brandos

Veteran
Veteran
Joined
May 25, 2013
Messages
147
Reaction score
31
First Language
German
Primarily Uses
Sadly I have no idea how to contact the real developers since they are based in japan or china? But yeah it is crazy how something big like this is ignored by the developes. Maybe they are unable to fix it?
 

Victor Sant

Veteran
Veteran
Joined
Mar 17, 2012
Messages
1,694
Reaction score
1,445
First Language
Portuguese
Primarily Uses
Thankfully this plugin fixed everything, but I really think you should show that to the staff, this is a game breaking problem that need to be officially fixed in a next update.
This issue was already reported on the improvement board and the staff already acknowledge it. A solution probably will be set for the big update they are planning with all the data collected from there.
 
Last edited by a moderator:

KaYsEr

Koruldia
Veteran
Joined
Mar 14, 2014
Messages
227
Reaction score
455
First Language
French
Primarily Uses
RMMV
A solution probably will be set for the big update they are planning with all the data collected from there.
I can't wait for this day to happen, knowing all bug fixes are now built-in the main program without the use of plugins (no blur on parallax, delta time etc), this will be a relief.
Thanks for the link.
 

brandos

Veteran
Veteran
Joined
May 25, 2013
Messages
147
Reaction score
31
First Language
German
Primarily Uses
This issue was already reported on the improvement board and the staff already acknowledge it. A solution probably will be set for the big update they are planning with all the data collected from there.





Is there a rough date for when we can expect that update?
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,230
Reaction score
3,079
First Language
English
There's this plugin you can install
 

KaYsEr

Koruldia
Veteran
Joined
Mar 14, 2014
Messages
227
Reaction score
455
First Language
French
Primarily Uses
RMMV
The rm mv update included a fix for this i belive. The plugins are no longer needed.


Unfortunately no, I updated everything and this big problem is still here.


(again, it will take a pretty long time to "feel" the issue if you only move between tile-based maps with only some small parallaxes, but it will happen eventually. Big parallaxes are a faster way to experience the problem in no time, we just need to transfer between "many" maps [depending on how much RAM you have] to see the problem [transfers take longer and longer] or for an even faster result, by spamming the menu...)


@brandos Despite being pretty good, I need to report a big problem in your plugin. To reproduce it, simply create an event moving randomly (I don't know, just take the cat from RTPs and set "autonomous movement type" to "random"), it will work the first time you go on the map with this cat, but if you transfer to another map and come back, now the cat SPRITE will be at the last position it was before leaving the map, and even worse, now the original EVENT for this cat is still at the right position but invisible.


I don't see any other problem so far, too bad because this plugin is (for now) the only way to fix this "memory leak" (?) problem, the one linked by @Tsukihime doesn't change anything with me, it probably solved another issue.
 

Ashouse

Resident Zombie
Veteran
Joined
Oct 25, 2015
Messages
245
Reaction score
91
First Language
English
Primarily Uses
N/A
I haven't installed the update yet, so I don't know if it will fix anything. I run this plug in and it helped somewhat. I don't have any auto move routes, or anything other than transfer events running at the moment. I no longer come to a grinding halt between maps, but ram usage still jumps up and stays up. So, watching task manager, I start at say 300 something mb. Walk around a bit and transfer to a small map. 800 something. Then when transferring from a large map to another large map (80x80 to 40x40) It jumps WAY up and never comes down (High 90 percentiles). It didn't lag or slow, but it shouldn't be that high (and never come down). Also, I show 3 instances of "game.exe" running in my task manager. Is this usual? They all have different values, but I was wondering if that's just how it do...
 

KaYsEr

Koruldia
Veteran
Joined
Mar 14, 2014
Messages
227
Reaction score
455
First Language
French
Primarily Uses
RMMV
I start at say 300 something mb. Walk around a bit and transfer to a small map. 800 something. Then when transferring from a large map to another large map (80x80 to 40x40) It jumps WAY up and never comes down (High 90 percentiles)
Do you have this with this plugin ON?


Because I don't have any issue when this plugin runs, my RAM stays at a decent level, don't forget that it's not supposed to be the same size as your .PNG file once in the RAM, it's more like a .BMP equivalent so if you have a big 80x80 map with even just 2 layers it's going to be pretty big anyway, the good thing is that this plugin will flush the RAM so it's not going to saturate like it does by default (yes even with the new update), but hey... Put some random "auto move routes" events here and there and you'll see this plugin is not usable yet. I hope things will get better anytime soon.


PS: I also have 3 instances of game.exe
 
Last edited by a moderator:

Ashouse

Resident Zombie
Veteran
Joined
Oct 25, 2015
Messages
245
Reaction score
91
First Language
English
Primarily Uses
N/A
Alright, good to know (3 instances). Yeah, I have a big ram jump, but things are running smooth at least. I couldn't imagine what it would do to the average portable device. That's what I was aiming for early on, but now I'm just aiming at pc. Well, it's a pretty nasty little (big) bug. It simply can't go unfixed forever. But then again, us weirdos who want to spend 64 hours on a Parallax map aren't all that common... lol
 

KaYsEr

Koruldia
Veteran
Joined
Mar 14, 2014
Messages
227
Reaction score
455
First Language
French
Primarily Uses
RMMV
Well, even somebody who just want to map with chipsets and use the provided parallaxes (like those in RTPs) to have a simple landscape effect, will eventually have this problem, it will just take more time. (since this kind of parallax is smaller etc)


And, about RAM saturation on mobile devices, let's say now the latest iPhones/Galaxy have 2 or 3go, and it's not going to stop, so if we pay attention to the way we do maps I think it can work on those devices too. I tried on a cheap tablet PC with only 2go of RAM and a weak ATOM CPU and the game works:





But of course we need a way to clean the RAM  ;)  because my little screenshot looks nice until I transfer on many maps and the game crashes lol.


A solution exists... Simply use another plugin that uses pictures instead of parallaxes, like TDDP's "Bind Pictures to Maps", this one doesn't have the memory leak problem and you can chose to show a picture below your character so it will behave like a parallax. (would be nice to know this issue is fixed though)
 

Saneterre

Veteran
Veteran
Joined
Jul 5, 2015
Messages
221
Reaction score
69
First Language
French
Primarily Uses
thank you for the plugin
 

Victor Sant

Veteran
Veteran
Joined
Mar 17, 2012
Messages
1,694
Reaction score
1,445
First Language
Portuguese
Primarily Uses
Unfortunately no, I updated everything and this big problem is still here.
Well, i tested with a 3000 x 3000 parallax with 16MBs, no issue here. My ram was around 80% (wich is common when I have browser + maker + test play open) even changing maps or opening and closing the menu.


ram.png


And my pc RAM is 2GB.


Did you replace the .js on your project?
 
Last edited by a moderator:

KaYsEr

Koruldia
Veteran
Joined
Mar 14, 2014
Messages
227
Reaction score
455
First Language
French
Primarily Uses
RMMV
This is strange. Did you use the embeded RM parallax function or one of your personnal plugin? Maybe the one from KAUS (because indeed with that one it's fine, same as the TDDP one, but unfortunately not the one from GALV)


PS: don't forget you have to do multiple transfer/call menu
 
Last edited by a moderator:

KaYsEr

Koruldia
Veteran
Joined
Mar 14, 2014
Messages
227
Reaction score
455
First Language
French
Primarily Uses
RMMV
Did you replace the .js on your project?


Yes of course, I even tried from a fresh new project from v1.1 to be sure. With ZERO plugin to be extra sure, using simply the parallax function from RM.
 

Victor Sant

Veteran
Veteran
Joined
Mar 17, 2012
Messages
1,694
Reaction score
1,445
First Language
Portuguese
Primarily Uses
This is strange. Did you use the embeded RM parallax function or one of your personnal plugin? Maybe the one from KAUS (because indeed with that one it's fine, same as the TDDP one, but unfortunately not the one from GALV)
No plugin. But I also used my Fog and Overlay with multiple fogs with no issue.

PS: don't forget you have to do multiple transfer/call menu
I was transfering and open/closing the menu like crazy.
 

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

Latest Threads

Latest Profile Posts

Stream will be live shortly with some pixel art! Feel free to drop by!

Can't believe I forgot to put an image of my drawing pad! It looks kinda like this, maybe I'll get a better pic tomorrow...
Backup tip: If you don't want to back up your whole project every day, at least back up everything *except* your Image and Audio folders, which you can do weekly/as needed/etc.
The final version of our game is already available both in English and Spanish! ^___^
Can't believe this day has finally come... T_T
Im so happy that Dead By Daylight is getting a Silent Hill chapter! Cant wait to play as pyramid head

Forum statistics

Threads
97,813
Messages
947,144
Members
129,033
Latest member
jace00
Top