image reuse (optimization) - de-duping

0 favourites
  • 7 posts
  • hi,

    I have about 14 animations for my player sprite, each about 15-30 frames. There are a number of these frames that most likely use the same image. I export them from my animation software, sometimes I'm just changing a small thing that is only in part of the animation sequence. So all the animations will definitely share some of the same exact frames. However they may have different names... i.e. "BeamWeapon008.png" and "AutoWeapon008.png"

    Does anyone know if C2 will take out duplicate images (on Export) and only use one image, or is this something I have to do manually? Ideally I'm looking to optimize and not load the same image into memory more than once.

    thanks..

  • Exact frames, per object, yes.

    Exact frames in multiple objects? Nope.

  • so if I have different animations (for the same sprite object) that have different filenames it will only use the 1 image?? that is cool.

    I guess that's why some people complain about export times, it's doing a bunch of deduping... thanks!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • https://www.scirra.com/tutorials/577/co ... imisations See step 1

    Only the same images between different object-types are not deduplicated.

  • Only the same images between different object-types are not deduplicated.

    Not quite - images can be deduplicated between different Sprite object types. Only images between Sprites and non-Sprites (e.g. Tiled Background) are not deduplicated. From the tutorial you linked to:

    [quote:2f1x2y4j]images are not deduplicated between Sprite objects and other objects, since Sprite object images are spritesheeted and other objects are not. For example, a Sprite and a Tiled Background with identical images will still export two images, but two Sprites or two Tiled Backgrounds with identical images will only export one image. Usually these are both edge cases and it should not be a serious problem.

    Also image deduplication is a pretty quick part of the export process, even with large projects - image recompression takes far longer, and you can skip that.

  • Ashley even better! that makes my job way easier... so I can load as many redundant frames as I want and C2 will 'trim the fat' - so to speak.

    excellent! thanks...

  • Ashley My understanding of "object-type" meaning was wrong, i thought object type is Sprite or Tiled Background, woops

    I tried to say this

    images between Sprites and non-Sprites (e.g. Tiled Background) are not deduplicated

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