Preload Manager

● ARCHIVED · READ-ONLY
Started by Galenmereth 289 posts Page 5 of 15 View original ↗
  1. lukiono said:
    http://mvplugins.tordamian.com/plugins/preload-manager/#advanced_preload_files_onstartup


    there you go....



    Animations are a little more complicated than images or sound files (as they can contain both). You can preload images from the Animation subfolder, as well as the sound effects used in the Animation - which I've tried, but I'm not seeing any reduction in the initial delay. Hence why I asked whether this plugin even applies to the unique case of Animations.
  2. Ahhh. Tested with an external web upload and not the pc version. I see what you mean... I'm very sorry and you're right. This delay is big.... Hopefully this will or can be fixed...
  3. Maybe it's just me..... but this preload manager is still not helping. I even tried publishing a game and testing it that way, the music still lagged like crazy.


    I'm just running it on windows.
  4. Galenmereth said:
    I'll take a look at these bugs. I think what @clitvin is experiencing on PC is the fact that occasionally the webkit wrapper just fails to load a resource, and I haven't made a failsafe for this yet because I was sort of hoping it would be solved by official patches sooner rather than later. Since it hasn't, I'll have to figure out a way to deal with this more cleverly. So in other words I'm aware of it :)


    When it comes to mobile devices, I really have no clue what might be the problem there. Is it possible to get access to the debug console on mobile when testing the game to see if it spits out any error messages of relevance?


    If you're using Chrome on Android, or Safari on iOS, yes. https://developers.google.com/web/tools/chrome-devtools/debug/remote-debugging/remote-debugging?hl=en
    It's a remote debugger though- none of the mobile browsers have a proper debugger implemented, and in the case of a containerized app, I'm not sure if it exposes JS debug info in a capacity where it would be meaningful to use logcat. 
  5. Hi Galenmereth,


    Thanks for your useful Preload Manager plugin!


    In version 1.1.1, it seems to create an infinite loading on mobile devices. It does work fine on Windows, Mac and Web Browsers. The issue seems to only occurs on Android and iPhone devices (and also when playing on mobile web browsers). Do you have an idea what can cause this issue to occurs? I cannot F8 on mobile so I'm having a hard time to debug. Maybe I can send you the project?


    Thanks for you help!
  6. darkelite said:
    Hi Galenmereth,


    Thanks for your useful Preload Manager plugin!


    In version 1.1.1, it seems to create an infinite loading on mobile devices. It does work fine on Windows, Mac and Web Browsers. The issue seems to only occurs on Android and iPhone devices (and also when playing on mobile web browsers). Do you have an idea what can cause this issue to occurs? I cannot F8 on mobile so I'm having a hard time to debug. Maybe I can send you the project?


    Thanks for you help!



    I was able to run the debugger on Android using Intel XDK and I gathered some logs!


    Console was cleared /C:/Users/michel/AppData/Local/Intel/XDK/xdk/components/client/emulator/index.js:17
    ========= TDDP PreloadManager: Boot Preload ========= TDDP_PreloadManager.js:445
    ========= TDDP PreloadManager: Boot Preloading System SFX ========= TDDP_PreloadManager.js:496
    ========= TDDP PreloadManager: Boot Preloading System Music ========= TDDP_PreloadManager.js:503
    Failed to load resource: the server responded with a status of 404 (Not Found) http://127.0.0.1:58889/http-services/emulator-webserver/ripple/userapp/x/C/…ed6485f-045a-4f84-afa1-bf3a82d82e86/platforms/android/assets/www/undefined


    Debug.jpg
  7. If 5 different events on the same map use some sound "Open1.ogg", PreloadManager will currently load it 5 times. While I understand the garbage collection will clean up all the duplicates eventually, it seems that for big maps with many events that reuse a lot of sounds this can apparently result in such a temporary spike of duplicate loads that people are seeing out of memory even on desktop platforms. (This was reported to me by some WebAudioCache users - WebAudioCache won't keep duplicate loaded resources in its cache, but it won't stop them from being temporarily loaded up multiple times if they are requested in parallel before one has finished loading)


    Therefore it would be great if PreloadManager would be fixed to not preload any resource of a map twice or more if multiple events on the map use it.
  8. anoo...


    excuse me..


    may i ask?


    why when i use this plugin, and deploy to android (apk)


    when i try to play, i always stuck on loading screen..


    thanks :)
  9. What does this error code mean?

    Untitled.png
  10. I had an animation being called that didn't exist, silly me sorry
  11. Hi everyone. Sorry for my late reply to all of you. I've taken note of all your concerns and I'm addressing them one by one as I work on the new version of this plugin. I have decided to bump the new version to 2.0 (once done) and I'm doing major rewrites. The reason is that I not only want to fix the problems and bugs, but I also want to improve on it a lot. The new version will have some new (some of them much requested) features:

    1. Its own proper cache solution where you can specify the amount of memory before the oldest, least-used elements are purged. This is both to combat mobile device memory issues and also to make the experience smoother for the player.
    2. The "preload on boot" assets will let you specify an entire folder. Obviously care should be taken here, but I want the option in there for us advanced users.
    3. Assets set to "preload on boot" can be configured to not be garbage collected by the plugin. This one will need warning signs all around it, but consider this: You have a custom menu that always loads the same sfx and image files. Why not keep them in memory always instead of asking for them over and over and over. (I need this for my own sanity)

    And as I've mentioned, all bugs that have been reported are noted. I'll let you know once I make some more progress. I'll likely release a "beta" version at some point to let you all test out and find bugs for me. Mwahaha.


    Thank you for your patience everyone!
  12. Galenmereth said:
    Hi everyone. Sorry for my late reply to all of you. I've taken note of all your concerns and I'm addressing them one by one as I work on the new version of this plugin. I have decided to bump the new version to 2.0 (once done) and I'm doing major rewrites. The reason is that I not only want to fix the problems and bugs, but I also want to improve on it a lot. The new version will have some new (some of them much requested) features:

    1. Its own proper cache solution where you can specify the amount of memory before the oldest, least-used elements are purged. This is both to combat mobile device memory issues and also to make the experience smoother for the player.
    2. The "preload on boot" assets will let you specify an entire folder. Obviously care should be taken here, but I want the option in there for us advanced users.
    3. Assets set to "preload on boot" can be configured to not be garbage collected by the plugin. This one will need warning signs all around it, but consider this: You have a custom menu that always loads the same sfx and image files. Why not keep them in memory always instead of asking for them over and over and over. (I need this for my own sanity)

    And as I've mentioned, all bugs that have been reported are noted. I'll let you know once I make some more progress. I'll likely release a "beta" version at some point to let you all test out and find bugs for me. Mwahaha.


    Thank you for your patience everyone!



    Thanks! That's super awesome!


    I am definitely voluntering for alpha-beta testing it. :)
  13. Progress is being made rather quickly now finally. All asset preloading works, and this time audio is cached properly too (except BGM's on Android Chrome; more on that later). What remains is to implement the actual memory limit options and handling those as the pool fills up, as well as overall code polish and documentation.


    For now, here's a preview of the console output. Take not of how messages are tagged with various log levels (debug, info, warn and error); there's an option for which you want to see, so that if you need to debug the nitty gritty you can set it to debug, and otherwise have it set to warn or even just error for some sweet console silence :)


    pm2_debug.PNG


    Some nerdy details: Practically every single line of code is rewritten for far better performance, stability, and to make it easier to extend with your own plugins. The TDDP.PreloadManager object implements an event listener structure now so that you can listen for load, progress, errors, and other relevant events, as well as simple interfaces for getting the currently loaded percentage (and of course bytes loaded and bytes total).
  14. Cache memory pruning is now implemented in the new version (not yet released). In the following screenshot the limits are set ridiculously low (10MB for images and 4MB for audio) just to see what happened. The plugin will free assets from its cache starting at the last used / requested and work its way from the back like that. It won't delete the existing references to the asset should it free up something that is actually in use; it only frees it from its own cache memory.


    logeddyloggings.PNG


    The PreloadManager now places itself between the default MV core loading code (ImageManager and AudioManager) and the filesystem itself. The connection between these look like this simplified. This is only when an asset is directly requested; preloading on game load and map entry is what ensures that objects are cached before requested and ready to be served.


    preloadManagerDiagram.PNG


    I've taken care to touch as little of MV's core code as possible for compatibility reasons and to make future updates to MV easy to keep up with for myself. However the plugin can not (and should not) limit how assets are used; if plugins or core code keep a lot of unused references to its data, memory cannot be freed. So the coming PIXI 4 update is crucial to solve MV's memory leak issues completely (related to textures mainly).


    It's important to remember that the PreloadManager's job is to lessen the requests sent to the filesystem and minimize delay in the display of images and playback of audio.
  15. Help out and beta test the major v2 rewrite


    Anyone wants to help out with beta testing the new and major rewrite of this plugin? If so, head on over her, hit CTRL+S and save it in your plugins folder: https://raw.githubusercontent.com/TorD/rmmv-preload-manager/master/TDDP_PreloadManager.js


    Tips: Hit F8 when the game is running to open the console and look at what the PreloadManager is doing :)


    Important:

    1. Put this at the end of all other plugins!
    2. Don't use this together with the old PreloadManager!

    Things to keep in mind:

    1. It's current in beta phase (release candidates with nightly builds); things might break :)  But please report any problems you have.
    2. Features are not necessarily final.
    3. Report any problems you come across, or even hard-to-understand features.
    4. If it's incompatible with other plugins, I won't prioritize fixing that at this point in time.
    5. All code is documented, but there is no documentation of the plugin other than that for now.
    6. The feature for permanently preloaded files is not yet fully implemented.
    7. Map loading is slightly slower (this is also affected by the console output if open) locally; if played from a server, map load will take far longer (which is natural)

    Improvements you should notice:

    1. Animations and audio start playing precisely when they should
    2. All graphics in general will display immediately as they're called; no waiting for faces to load for message boxes to display
    3. There should be no audio delay in general for BGM's (except on Android Chrome; can't fix that)



    Have fun, and thanks in advance for any feedback you can provide!
  16. I'ma bit confused about 'Map loading is slightly slower' being an improvement? Map loading is still super slow in MV 1.2?
  17. gRaViJa said:
    I'ma bit confused about 'Map loading is slightly slower' being an improvement? Map loading is still super slow in MV 1.2?



    The plugin preloads assets (audio and images) used on maps and in battles as the maps and battles load. The loading time up front is not the improvement: The improvement is for the player when the map is done loading and the fact that the display of images and animations, as well as playback of sound effects, all fire off without any delay.


    It should not be listed under improvements though, that's a good point ;)  
  18. I will post my tests results here as well for better visibility.


    I've grabbed the latest version (RC4) and I'm crashing after starting a new game. Test performed on Windows. See error below:


    PreloadManager debug › Adding to queue: img/sv_actors/hero2_0.png
    rpg_managers.js:1588 Uncaught TypeError: Cannot read property 'animation1Name' of nullrpg_managers.js:1588 SceneManager.onError
    rpg_managers.js:1589 file:///C:/Users/michel/Desktop/Projects/GoogleDrive/Dungeons730f%20Betrayal/DungeonCrawler05-01-2016/js/plugins/TDDP_PreloadManager.jsrpg_managers.js:1589 SceneManager.onError
    /C:/Users/michel/Desktop/Projects/GoogleDrive/Dungeons%20of%20Betrayal/DungeonCrawler05-01-2016/js/plugins/TDDP_PreloadManager.js:730 Uncaught TypeError: Cannot read property 'animation1Name' of null
  19. I had the same issue when testing, it's looking for animation1Name and I solved it by removing all classes starting skills, maybe this will help you pinpoint the issue. I'll post my console tomorrow when I get some time.
  20. That error is because events can grow "stale" when it comes to referencing animation ID's in the Database. Most likely you had events pointing to animation ID's that have since been removed (the max number of animations shortened). That's the only way I could reproduce it so far at least :)


    I've added a check for this in the latest master build (https://raw.githubusercontent.com/TorD/rmmv-preload-manager/master/TDDP_PreloadManager.js). It'll now check the validity of the returned animation object and print a warning and skip it if it's not valid.


    Update: Here's a preview of a simple loading screen I made using the public methods of the Preload Manager. I plan to release a configurable plugin addon for showing loading indicators like this: