I've been experimenting with the data elements tab to try to internalize some of the massive file structures that go along with my game, and I was wondering a bit about the efficiency of packing them into the executable as binary data.
I'm still not exactly sure how the data elements work, though. When I load files into them, they have the file address on my machine (ie C:/mmf2/stuff.png), but my application loads all external files based on the folders file structure, for example a file might be loaded into the active picture object as:
So just loading the files into the data elements seems to pack them internally fine, but I'm curious how its referencing these files when it calls them? Because I can compile the .exe, delete the folder the files were in, and they'll still be loaded fine- thats good. But when I move the .exe to a different folder, they are still loaded fine which makes me thing, how are they being loaded.
Is MMF2 just searching over the internal data elements based on the filename and not path when it is loaded in? Since my game is trying to load "C:/Application Folder/Data1/Stuff.PNG", but the file was saved under the address "C:/MMF2/Data1/Stuff.PNG". Is it just searching for "Stuff.PNG" in the internal elements? Is there some specific syntax I should use to more easily reference files in the internal structure, like skipping the whole file address stuff?
And if so, does this create a problem with multiple files with the same name? I mean, if I had multiple "Main.ini" files in different folders, loaded into the INI object, and tried to load them, would it know to search the pseudo-folder of the internal structure or would it just pick the first match?
Also, what sort of efficiency issues would I have with binary data. I gather that some extensions load it directly from the .exe, and some first unpack the data to a temporary folder then load it. In the former, there should be the same disk call time of just having the file on your hard drive, but in the second there should be both a read and write time (much slower), right? And I'm guessing from my brief messing around that binary data is *not* loaded into the RAM during runtime until it is called- it wouldn't inflate my memory footprint to stuff everything in the .exe, right? Well it shouldn't, I suppose.
And also, is there any sort of compression applied to the binary data? Does it need to be decompressed when called? Because I imagine that would (marginally) slow down performance over just loading via disk, while lowering filesize.
Lastly, is there any list of which extension *can* pull data out of the compiled .exe, and relatedly which extensions can pull files but need to cache them on the disk first?
Thanks for any help!
*oh yeah, also, whats the interaction with the File Object? Specifically, if I had a condition that said "Does file exist? {directory}", would this search for internal data elements too, if they matched the string?
*and also, how would I go about playing a sound effect from an internal data element? I mean, I have all my sound effects stored externally to the game, and it precaches and plays them via the "play external file" thing, but this does not appear to work with embedded files. I know this question might seem odd since I could just store them internally via the *normal* MMF2 play sound method, but in this case I need to be able to dynamically play files based off of their names, and you can't do that with the normal play sample options.