How exactly are assets loaded?

0 favourites
  • 8 posts
From the Asset Store
Is a circular loading screen with code ready to use. No Animation.
  • Ashley (to get your attention because I need a technical "description"). I'm sorry if this information is somewhere already, but I can't find it.

    I finished an education application, it has around 50mb of images. On web preview it works perfectly, in phoneGap it crashes (see my question here: stackoverflow.com/questions/9960100/phonegap-android-with-relatively-large-html5-application-hangs-or-crashes).

    So, how exactly are assets loaded into construct? Becuase if they are forced into ram at the beginning this will limit a lot the ability to develop for mobile.

    If someone has any information it would be greatly appreciate it.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Non technical description: see that little blue bar underneath the html5 logo at the beginning of the game? Thats the preloader.

    Loading assets separately is on the todo list.

    Until then, 50megs is just too much, even for pc's imo.

  • Well, right now it will just load all the game images on startup, so the phone will probably also decompress them to bitmap in memory. We have improving resource management on our todo list but it's quite complicated. Even then it will probably only reduce it to per-layout images, so you'll still have to make sure one layout can fit in phone memory. 50mb sounds kinda big even considering that, since that's probably the compressed size you're measuring. Decompressed it could be 300mb+, so one layout could still push the phone memory to the limit. Why is your game so large? Do you have long animations or something? It is of course best to scale down games for weaker mobile hardware and test regularly from the start so you know when you're hitting limits rather than getting a nasty surprise at the end.

  • Is it possible to override or modify C2 loading everything on start with the plugin sdk?

    The game I'm working on a will be ~100MB, but each layout has few assets <15MB.

  • One hackish solution for the moment is to implement a "lazy-load". Use white Sprites of the right size in your game, and, when the user is doing something that means is going to change layout, use the Behavior to inject new images in those Sprites (you can find that behavior in the "Plugins" section of the forum).

  • Pode I was actually looking at yours and at the loadURL plugins to solve my problems. Basically I don't need to have 50mb of images at runtime since the application is procedurally generated at runtime showing only ONE image (60kb) out of the thousands I have so your plugin could be a saver. Now my only problem is to understand from where c2 loads images locally, it looks like image.png from preview and images/image.png from "compiled".

    Also is it possible to build the image name from variables?

  • 0plus1 : I know that the loadURL (which isn't mine) plugin has a once where he doesn't update the graphical view when it fetches an image, but some time after...

    If you want to use my behavior, you can load images from the exported image folder. Or you can place directly your own imagefiles in a folder next to it.

    If you use a global var "image_to_load", and you exported the game "MyGame", say, to dropbox, you need to fill your var like this :

    image_to_load = 'http://dl.dropbox.com/u/YOURADRESS/MyGame/images/' & 'name_of_your_image.png'

    You can then pass 'image_to_load' as the adress to my behavior.

  • Pode Ok I see, I need something relative though, I'm experimenting with assets loading as I would like something relative in order to have it load from phonegap.

    Like image_to_load = 'images/image.png' I'll let you know.

    You are a life saver!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)