User Tag List

Page 1 of 5 1 2 3 ... LastLast
Results 1 to 10 of 48

Thread: Binary Data: How to use it, and what it is.

  1. #1
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Binary Data: How to use it, and what it is.

    What is binary data?
    Binary data is just data embedded in your application. When you use a Play Sound action or Play Music, unless you specify play from file and use and expression, the music/sound gets embedded in your MFA, and then your application when you build it. Flash connverts sounds to MP3, of course, and Java only supports Wav right now. But Vitalize, Screensavers, and EXEs all support binary data.

    However, only screensavers and EXEs can extract your custom-included binary data. This data can be included via the Binary Tab of the Data Elements window. You can access it by clicking the button next to the event editor button. It looks like a musical note with a paper.

    What does the Binary Data tab look like?
    Well, it looks something or other like this:


    Here you can add and remove files from the list of files to include in the built application. These files are not saved with the MFA, and have to be accessed in a special way using some of MMF2's built in features. (Namely the Special Object)

    When you want to use a file from here, you need to use the exact same path as is seen in this tab for it to work.

    How do I use the files I have listed in the tab in my application?
    Note that because the binary data files are only embedded in your built application, in some cases you might not be able to test this by simply running your application from MMF2. You have to build your application and run the file for it to work. However sometimes you can test it from MMF2. It just depends.

    Once you have your binary data in the list, you can start to program your application for the files. Here is the process:
    1. Take note of the path of the file you want that is listed in the Data Elements' Binary Data tab. You will need to use this exact text every time you refer to the file. (I will refer to it as "{MyFile}")
      [size:8pt](note: this path is saved in the EXE/SCR no matter what the compression. To save space and privacy, I recommend you use Windows Explorer's Map Network Drive feature. Open My Computer, go to Tools -> Map Network Drive. Select the drive letter that you want, then map it to the folder that has the file you want. Then instead of using the whole path, now you can just use, for example, Y:\File.wav)[/size]
    2. When you want to use the file, use the action Extract Binary File "{MyFile}" from the special object.
    3. When you want to reference the file for an extension or object or MMF2, or whatever, then use the expression BinFileTempName$("{MyFile}") from the special object to get the path for it.
    4. When you are done using the file, or your application is closing, then you should always release the file with the action Release Binary File "{MyFile}" from the special object.
    And that's how you use it! This is also how the auto installer was made for Knytt Stories. The game files had to come out of somewhere!

    To see a working example, check this out:
    http://www.LB-Stuff.com/MMF2/BinaryDataExample.zip

    Enjoy,
    -LB
    Working as fast as I can on Fusion 3

  2. #2
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    James's Avatar
    Join Date
    Jun 2006
    Location
    Newcastle, UK
    Posts
    6,773
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: Binary Data: How to use it, and what it is.

    This could be good for a FusionWiki article, LB You should go make one!

  3. #3
    Clickteam Clickteam
    Simon's Avatar
    Join Date
    Jun 2006
    Location
    UK
    Posts
    2,637
    Mentioned
    57 Post(s)
    Tagged
    3 Thread(s)

    Re: Binary Data: How to use it, and what it is.

    Nice article LB - the concept of using the original path can be a bit confusing at first, you've explained it really well here

  4. #4
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: Binary Data: How to use it, and what it is.

    Made it on FusionWiki!
    http://www.fusionwiki.com/wiki/Binary_Data
    Man, tons of red links!!


    Please fix the article up as you wish.
    Working as fast as I can on Fusion 3

  5. #5
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator Pro
    nivram's Avatar
    Join Date
    Jul 2006
    Location
    Bandon, Oregon
    Posts
    6,720
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)

    Re: Binary Data: How to use it, and what it is.

    Thanks LB. Great informative article. This old goat appreciates it.

    Marv
    ​458 TGF to CTF 2.5+ Examples and games
    http://www.castles-of-britain.com/mmf2examples.htm

  6. #6
    Clicker Multimedia Fusion 2SWF Export Module

    Join Date
    Sep 2006
    Posts
    1,537
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: Binary Data: How to use it, and what it is.

    Would this be poor for resources that have to be loaded at runtime? It adds an extra step of writing to the disk to loading from it, if I'm reading it correctly. My only other alternative would be having external files installed with the program in folders next to it, but I'm aware most modern software extracts materials at the "loading" of each level, etc. I doubt I'd have enough space issues to make that a serious constraint however

  7. #7
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: Binary Data: How to use it, and what it is.

    Well, think of it this way.

    Lets say you use a play sound event. This embeds the sound in the MFA and the EXE.

    Now, say instead you included the sound in the data elements tab and made code to extract, play, and release it. The code takes just a little more space, but the file is not embedded in the MFA.

    These two methods are supposedly exactly the same, if you leave out the code to extract and release the sound file.


    It is up to you to decide which method you want to use. Just remember that file that MMF2 automatically embeds can only be released at the end of the application. Binary files can be released any time.
    Working as fast as I can on Fusion 3

  8. #8
    Clicker Multimedia Fusion 2SWF Export Module

    Join Date
    Sep 2006
    Posts
    1,537
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: Binary Data: How to use it, and what it is.

    The meat of the question really is though, when you export a binary data element into memory on the computer by extracting it, is the action of loading it again into another object going to take just as much time as if it had already been there? Because in that case, you're effectively doubling the time required for using the data element.

    I'm more interested in time efficiency with my project- I know theres always a tradeoff of space to time, and I've got plenty of the former in both RAM and hard disk requirements, and not so much of the latter.


    I'll probably play around with doing it both ways and see which works better, but I'm still iffy on it. Having a single .exe is great, but having terrible loading times at the start of each level is not.

  9. #9
    No Products Registered

    Join Date
    Mar 2007
    Location
    Sydney, Australia
    Posts
    1,369
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Binary Data: How to use it, and what it is.

    Thanks for explaining this LB.
    I have always wondered how that worked and never quite understood it.

    But what I would much prefer is rather than saving the binary data in the exe file, would it be possible to store it in an external file instead?
    For example, you could store all sound/images for a particular level in one file, or have seperate files for sound/images/whatever.

    Is this possible?

  10. #10
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: Binary Data: How to use it, and what it is.

    I think you may want to have a Directory Packing extension (like the one we have already) but it can extract certian files.

    Surely with the binary object you can come up with your own format?
    Working as fast as I can on Fusion 3

Page 1 of 5 1 2 3 ... LastLast

Similar Threads

  1. Binary Data (INI)
    By Danny in forum Android Export Module Version 2.0
    Replies: 2
    Last Post: 13th February 2013, 09:56 AM
  2. Binary Data Question
    By droberson in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 12th July 2010, 04:17 PM
  3. Binary Data
    By Mars31 in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 21st April 2009, 04:49 PM
  4. using binary data at data elements
    By Chokito in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 5th August 2008, 05:22 AM
  5. Binary Data
    By Nick in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 8th May 2008, 03:08 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
  •