User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11

Thread: Active Object, load image problem

  1. #1
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module
    Nifflas's Avatar
    Join Date
    Jul 2006
    Posts
    2,613
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Active Object, load image problem

    I'm creating a new game with a level editor. I was using the Active Picture object to load the graphics that each room uses from external files.

    Now, the process of loading a room is too slow. I need to pre-cache the image files so they're in either the RAM or VRAM already when each room begins to load.

    I figured that the best solution would be to use the active object instead. I can prepare like 1024 empty 1x1 animation frames in an animation sequence, load my images into those slots, use an array to memorize what animation frame that is linked to what image. Should work in theory, but I'm having a problem setting the hotspot. As the level format work now, it stores the position of the hotspot relative to the center of the object. I can center the hotspot when loading an image (or position it anywhere I want relative to the top-left of the image), but I can't set the hotspot to an offset of the center (because I can not retrieve the image width before I have already imported the image file). I'm not open for using an extension to figure out the image width and height first, because there's too much data to waste on reading the image files twice, and the hotspot position is essential for scaling and rotation.

    What do I do if I need to pre-cache a large set of images when starting a frame (remember I'm not accepting quirky workarounds, everything should be done properly and efficiently)?

  2. #2
    No Products Registered

    Join Date
    Dec 2006
    Posts
    319
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Active Object, load image problem

    I've had that problem before in the past but didn't find a solution. I never understood why they removed the option to meddle with the hot/action spot via the event editor, because if I remember correctly that was possible in older versions of MMF2.

  3. #3
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module
    Nifflas's Avatar
    Join Date
    Jul 2006
    Posts
    2,613
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Active Object, load image problem

    On the plus side, while I develop the game I can just load the image files on the fly when the player enters the room, but before the game can be released this functionality is a must (either set the hotspot to an offset of the center, or alternatively pre-cache an image file to the active picture object), otherwise it'll never be fast enough.

  4. #4
    Clicker Fusion 2.5 DeveloperSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,739
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    Re: Active Object, load image problem

    Well, an object that can modify MMF's image bank would be pretty nifty... this could essentially allow you to do a lot of things since it is used by all inbuilt objects.
    The Surface object allows you to use a lot of messy tricks. You can basically keep images in a global state. I'm honestly not sure if it can in the currently released version, but if not it will soon - got other priorities now though!

  5. #5
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module
    Nifflas's Avatar
    Join Date
    Jul 2006
    Posts
    2,613
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Active Object, load image problem

    I'm a bit scared of adding a surface object full of features when I only need to use such a small part of it. At some point I'll probably hire someone to just create a simple image loading extension (with custom hotspot based of an offset to the center). Are you interested?

  6. #6
    Clicker Fusion 2.5 DeveloperSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,739
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    Re: Active Object, load image problem

    Sounds simple but I *really* do not want to accept any other jobs right now - I'm pretty much booked up, as far as I can go - taking another challenge certainly wouldn't make things easier, even if it would only take a day or so!

  7. #7
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    NecroLuigi's Avatar
    Join Date
    Jul 2011
    Posts
    56
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Nifflas! I'm struggling with a similar challenge in my game, since I use huge backdrop images (http://www.youtube.com/watch?v=xgW-XA_nZEg) and they sum to a HUGE exe file!

    If I read correctly, your problem is that you need to set the hot spot on the fly WHILE you're loading it (or at least in the same set of MMF parameters for loading images into the Active Object). You need to set it before you can use any command to get the image's width and height.

    Is it an option to do it in 2 steps? First loading the image with whatever hotspot, storing the image width and height in internal values, and then loading the image again, this time setting the hot spot using some math, based on the fact that you will know the image dimensions. Take a look => http://dl.dropbox.com/u/69894467/for%20Nifflas.zip

    Doing it in two steps does increase the initial loading time a little, but I understand it correctly, it is not a problem as long as you're able to have it pre-loaded before the frame itself is loaded, right?

  8. #8
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    NecroLuigi's Avatar
    Join Date
    Jul 2011
    Posts
    56
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Jee, just noticed the last post before mine was on March, 3rd of the wrong year! hahaha

    Anyway, hope it worked out by the time.

  9. #9
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export Module
    Konidias's Avatar
    Join Date
    Aug 2009
    Posts
    1,546
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    This thread brings up a good point though... For MMF being a game development software, it is really lacking in ways to load a lot of external images quickly at runtime. This problem alone was the reason I had to indefinitely postpone a game I was developing. Seems like a feature that should be in there from day one.

  10. #10
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    NecroLuigi's Avatar
    Join Date
    Jul 2011
    Posts
    56
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Konidias, I'm hearing this specific requirement everywhere I look! This is also bothering me a lot in my game, and it seems it's really a hot topic for more professional devs. I'll start a new thread, hopefully we all can leverage on each other's experiences and see what MMF really can't do, what it can by default, and what we can make it do in unusual (but hopefuly reasonable) ways!

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Load image from binary / external into an active object
    By Popcorn in forum iOS Export Module Version 2.0
    Replies: 1
    Last Post: 1st February 2013, 07:58 AM
  2. Load image from directory using Active Picture
    By paobrasil in forum iOS Export Module Version 2.0
    Replies: 3
    Last Post: 25th July 2012, 09:35 AM
  3. Active Picture - Load image from path or folder
    By AyreGuitar in forum iOS Export Module Version 2.0
    Replies: 9
    Last Post: 30th November 2011, 12:35 PM
  4. Image Bug, some active object problem
    By NecroToad in forum Hardware Accelerated Runtime
    Replies: 7
    Last Post: 19th October 2011, 12:41 PM
  5. Load / replace active's image at runtime?
    By Tuna in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 4th April 2008, 04:26 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
  •