Forums

OverviewV-Play 1 Support › Build problems on Android

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #4193

    Heini

    Hi Chris,

    i have a project that needs many images. When i try to build for Android, it fails (iOs works). When i build the project only with a few of the images, it works, but i want them all!

     

    Bye

    Heini

    #4194

    Alex
    V-Play Team

    Hi Heini,

    on behalf of Chris, this particularly sounds like a memory allocation problem within the Android toolchain. We are aware of a problem for asset collections bigger than approx. 20MB and are currently working on fixing that. How large are your asset files (images and sounds) in total (uncompressed)?

    If you’re using some jpeg files you can temporarily save them with lower quality to bypass this problem until we have a proper fix for that. I’ll keep you updated, thanks for the hint!

    Cheers,
    Alex

    #4197

    Heini

    Hi Alex,

    the images and sounds have at the moment a size of aprox. 16 MB. The finished version will have about 50 MB and i am working also on a hd2-version for tablets that will surely have a size of about 80 – 100 MB.

    Thank you for fixing this!

     

    Bye

    Heini

    #4198

    Heini

    Hi Alex,

    sorry, the asset files are more than 20 MB at the moment.

    Heini

    #4199

    Alex
    V-Play Team

    Thanks Heini, just checked some of our server log files and this indeed seems to be a memory problem for which we are pushing a fix the next couple of days. Sorry for the intermediate inconvenience.

    Cheers,

    Alex

    #4211

    Alex
    V-Play Team

    Hey Heini,

    good news, we just pushed an update for our Build Server, resulting in shorter build times, smaller app binaries, and probably of interest for you, building Android projects with a lot of assets again. 😉

    Please give it a try, feedback is appreciated!

    Cheers,

    Alex

    #4217

    Heini

    Hi Alex,

    thank you for your quick response!

    #4222

    Heini

    Hi Alex,

    now that the project can be build with all its assets, i am facing a new problem, always on android. When the player reaches another level i change the background graphics of the scene. I do this by using the Image element and changing its source. This works for aboout 10 levels, then the screen gets black and the app hangs. Looks like a memory lag. Is qt internally instantiating always another image object, when the source gets changed? I set the chache property of the Image element to false, but when i reload a image that i used before, it loads very well, just like it would be cached.

    Bye,

    Heini

    #4225

    Christian
    V-Play Team

    Hi Heini,

    we are caching the images in the cocos renderer, which might be the source of your problem. Could you reproduce this error, e.g. by changing the source of the Image x times, leading to an app crash at the same amount of x? Could you also upload the image files that causes the problem together with the test of changing the image source, so we can have a detailed look at it? How big are the images, actually?

    #4226

    Heini

    Hi Chris,

     

    i´m sure, thats the reason for it. You can reproduce the error with the following code:

    GameWindow {
    id: window
    activeScene: scene

    width: 960
    height: 640

    property int curImage: 0
    property string filename: “Image”

    Scene {
    id: scene

    width: 480
    height: 320

    Image{
    id: image
    source: “Image1.jpg”
    anchors.fill: parent

    }

    SimpleButton{
    id: button
    text: “weiter”
    anchors.bottom: parent.bottom
    anchors.horizontalCenter: parent.horizontalCenter
    onClicked: {
    ++curImage;
    if (curImage <= 30)
    {
    var filestring = filename + curImage + “.jpg”
    image.source = filestring
    }

    }
    }

    }

    }

    In this example i am using 30 images with a size of 500×500 px and 250KB. They are named “Image1.jpg”, “Image2.jpg” ….and so on, till “Image30.jpg”. I am using a Samsung Galaxy Ace, that is not able to reach the last image. It would be great, if one could choose, if the image should be cached or not (maybe by setting Image::cache to false).

    Bye and have a nice weekend!

    Heini

    #4227

    Christian
    V-Play Team

    Hi Heini,

    I had a close look at this problem and tested it with a Samsung Galaxy Ace and a couple of other devices. It turns out, that you should not use jpg files at all, because they have a longer loading time and take up much more graphics memory than pngs. Also, please keep in mind to create 3 different image versions for sd, hd and hd2 devices and using the MultiResolutionImage component. The Ace is in the sd (=single definition) category, which works best with images made for 480×320 or 320×480, depending on your game being in landscape or portrait mode. We also added documentation about this topic here: http://v-play.net/doc/vplay-different-screen-sizes.html

    The best performance can be achieved by packing all images into a spritesheet, with the excellent tool Texture Packer. By using the spritesheet, your image only needs to be loaded once into memory and can then be used efficiently.

    In addition, we also added a new function to the NativeUtils component called clearCocosTextureCache(). This allows you to manually remove cached textures that are currently not in use. You can use it, if you know you will not load the images anytime soon, and it will be available with the next V-Play update v1.3.

    Please let me know if I can help any further,

    Chris

    #4228

    Heini

    Hi Chris,

    thank you for your effort and for adding this important function!

     

    Heini

Viewing 12 posts - 1 through 12 (of 12 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support