Using too much memory!

0 favourites
  • 7 posts
From the Asset Store
With this template you will learn how to use the GooglePlay Games native plugin
  • Hello everybody. I'm new in C2, then first thing to say: Congratulations for this nice program and I'm so happy to see the big community that already exist. It's very helpful all the information that you can find. Great!

    My problem is... I'm using the trial version. And I'm trying to make a interactive book for children with lots of animations. Then, I'm using Flash Professional to design my characters and their animations. I'm exporting my pictures as .png to animation frames in C2. When I already export all, I crop the images.

    For the first scene I have 4 characters and the background. For being animated, they use around 600 frames. The biggest character sprite is around 270x300. The memory use is 74 mb! And the approx. download is 6.6 mb.

    I was wondering:

    1 - 6.6 mb is the download size? I mean, hypothetically, if I publish the project as a native app, this will be the size in mb of the app? Or the other (74 mb)?

    2 - Am I wrong using C2 to create a interactive book? I check on google play how big it is a interactive book and the approx. size it's 40-50 mb. Knowing that my book wants to have 23 pages-scenes (not all of them with so much frames per character), if I suppose all the scenes with the same size in mb (23x6.6), my app will have 151.8 mb. This is not so smart according to the market app. Or am I wrong with some supposition?

    Some suggestions?   

    Thanks

    P.S.: Sorry for my english!

  • Hi morgandalf

    1. It will be around 6.6mb , in fact a little more because the APK contains other stuff used by Android

    2. According to this Ludei's Official Page :

    COCOONJS, THE ADVANCED SURVIVAL GUIDE.

    The memory use is the memory allocated when the image is rendered by the graphics engine. If you plan to publish your App on google play you may encounter some memory problems. By experience, I use CocoonJS and for each picture the opengl engine will allocate for your picture size 512x512x4 octets. So the total memory used should be : 512x512x4x600 = 600Mb

    May be you should try to limit the frames number...

  • Thanks

    Then, if I have understand well, when you use CocoonJS to deploy your app, the size of the project always increase. This is because in CocoonJS the textures must be 2^n sized.

    Please, correct me if I'm wrong... C2 allows you to crop the images to save memory, but if you want to upload your creacions to the market you have to use CocoonJS (considering it the best option to do it) that makes your project considerably heavier. Maybe in a ratio of 2:3 or 2:4, if you are using lots of images.

    It's like this?

    Otherwise, I split my characters between animated parts and quiet parts and I delete some frames doing the animation less detailed. This changes reduce the size considerably and it still work well.

  • morgandalf

    Not the project size but the memory usage

  • I'm not 100% sure, but beufreecasse might be referring to the fact that your textures are 270x300, meaning C2 and CocoonJS will allocate memory for them as though they are 512x512 textures - since they work to power of 2 textures. This means if you can scale those textures down to fit in a 256x256 size (so 230x256 and crop your frames as closely as possible), then you'll be saving a ton of memory. I honestly think that's worth trying, because with 600 frames you will cut down your memory usage significantly.

    The other option is to cut down on the number of animation frames. Do you really need 600? What do you mean by animated parts and quiet parts?

    I know the feeling though. I'm an artist, and always find it hard to prioritize optimization and memory usage. I used to throw huge textures and detailed animations at my games, and then wonder why they didn't run well <img src="smileys/smiley17.gif" border="0" align="middle" />

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ok, thank you both.

    -Silver-

    Sorry, I have a limitated vocabulary in english. With animated parts and quiet parts I wanted to mean that if I have a character and the only part that's animated is the arm, I create 2 different sprites: one for the arm (animated part) and other for the rest of the body (quiet part, or maybe better to say static part or not animated part). I did it and the memory use decrease a lot as I want.

    Now, knowing that images takes a lot of the memory, I will try to use as less as possible and scale them into the 2^n size. But let me ask you a few questions (I'm new working on computer):

    A good practice when I export an image it could be that I adjust the size in the "edit image" dialog and resize it to a 2^n size pixels?

    This means that I have to try to resize my images (both width and height) close to 8, 16, 32, 64, 128, 256, 512, 1024, etc.?

    Then, I guess the following numbers are valids image sizes:

    • 256 x 1024
    • 1024 x 64
    • 32 x 128

    Thanks a lot!!!

  • Yep, that's correct! It's always best to try and stay within those boundaries. For example, if you create an image that is 513x513 pixels, it will be treated as though it's a 1024x1024 image.

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