User Tag List

Results 1 to 5 of 5

Thread: Slow Array Loading on HDD

  1. #1
    Clicker

    Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    DaveC's Avatar
    Join Date
    Jun 2007
    Location
    Perth, Australia
    Posts
    2,130
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)

    Slow Array Loading on HDD

    Hi Clickers, This may just come down to hardware - but I wondered if there was something I can do to optimize things. In my game, each time a map loads, it loads the data from an array at the start of the frame. Sometimes it takes less than 1/2 a second to load the array file, while other times it takes 2+ seconds to load the same exact array file. It's seemingly random on how fast it loads each time. Moving back and forward between 2 identical maps, same data, same path, it's different every time on how long it takes to load the file (before it even begins to draw the map in subsequent events)

    To be clear - it's not the drawing of the tiles with loops etc that is the problem, it's the actual loading of the array file. Drawing the frame is no issue at all, the Fusion "hang" comes from attempting to load a file.

    I decided to test my project on a brand new Solid State Drive (SSD) ..and it functions perfectly! It loads every array/map very quickly! However, the same build running on an older HDD is what gives slow/unreliable results, sometimes it takes half a second, sometimes >2 seconds for identical files. So most likely it's just bad hardware, an old fragmented HDD that is loading files slowly. But is there anything I can do to speed this up? Is there some way I can load all of the maps into memory and keep them there? Suppose I have 50 Array Files, all containing map data - rather than loading one array file from the hard disk at the start of each frame, could I keep them all in memory somehow? Most of the maps are only 36kb. I was thinking maybe something can be done with Binary Data Elements? I'm not sure how it works.

    I only have 1 "Array Object" in my frame, it needs to load in data from different array files - only 1 Array File can be loaded into the "Array Object" at a time.. The problem seems to be loading the file from the hard disk, so can I load the file from RAM instead?

    ( This is what my array loading looks like, this is the offending event, if I remove this, everything functions without a weird freeze while it loads the file. )



    BONUS MYSTERY: When I setup my project structure as follows:

    Frame 1: A completely empty Frame with 1 event ( start of frame, go to next frame )
    Frame 2: Gameplay Frame ( This is where I load the array, in the first line of events, then the game is played )

    In this case I would expect Frame 1 would only be shown for a split second, but instead, it seems to hang on Frame 1 until the array is loaded in Frame 2 -- But I'm loading the array at the start of Frame 2, so why is Fusion stuck on Frame 1 still??

    Thanks in advance!

    Edit 1. I've tried adding the maps into Binary Data... I notice the build size of my application is bigger, so the array files are in there - but if I try to load a map without the external files, it fails - so it's obviously not reading the files from the .exe - any clues how to make that work?

    Edit 2. I managed to get the arrays loading directly from binary data but it's not any faster. So I guess there is no way to keep it in memory then?

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCHTML5 Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    chrilley's Avatar
    Join Date
    Jul 2006
    Posts
    980
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    I think Arrays are only ever in memory after they've been loaded from the drive(until you load another file). I don't think they can be "stored" without using multiple arrays(one for each level).

    It would be neat if the Array object could let you pick a memory "slot" when you load an Array. Then perhaps have an action like "Select array from memory slot" that lets you quickly swap between loaded arrays.

    Binary Data:
    I think this will simply package your files within the game build which will then be extracted to some temporary folder when you run the game. I believe it's more of a convenient way to store external files rather than a performance booster.

    Edit: Is it out of the question to store multiple levels within 1 Array?

  3. #3
    Clickteam Clickteam

    Join Date
    Jun 2006
    Location
    France
    Posts
    13,858
    Mentioned
    262 Post(s)
    Tagged
    3 Thread(s)
    Up to 2 seconds to load a 36 Kb file it's not normal. Maybe try on another machine with another HDD?

    I think this will simply package your files within the game build which will then be extracted to some temporary folder when you run the game.
    They aren't extracted (unless the object requires it like video objects), they are read directly from the EXE.

  4. #4
    Clickteam Clickteam

    Join Date
    Jun 2006
    Location
    France
    Posts
    13,858
    Mentioned
    262 Post(s)
    Tagged
    3 Thread(s)
    Up to 2 seconds to load a 36 Kb file it's not normal. Maybe try on another machine with another HDD?

    >> I think this will simply package your files within the game build which will then be extracted to some temporary folder when you run the game.

    They aren't extracted (unless the object requires it like video objects), they are loaded directly from the EXE.

  5. #5
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCHTML5 Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    chrilley's Avatar
    Join Date
    Jul 2006
    Posts
    980
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Yves View Post
    They aren't extracted (unless the object requires it like video objects), they are loaded directly from the EXE.
    I stand corrected - Good to know!

Similar Threads

  1. Android Array Slow Down
    By coler123 in forum Android Export Module 2.5
    Replies: 1
    Last Post: 19th September 2017, 09:04 PM
  2. Sub Application loading slow?
    By Perry in forum Android Export Module 2.5
    Replies: 3
    Last Post: 2nd June 2014, 12:34 AM
  3. Loading an object from array when needed (loading an array in chunks)
    By fishrod in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 20th March 2014, 07:01 PM
  4. Loading slow / unresponsive?
    By Rik in forum SWF/Flash Export Module Version 2.0
    Replies: 7
    Last Post: 20th February 2011, 12:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •