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?