File sizes not changing

This forum is currently in read-only mode.
From the Asset Store
2D fighting template based in the game that defined the fighting games genre.
  • In trying to fix my complete-but-broken huge project, I came across the following oddity:

    when I remove a large sprite from the game, the filesize of the resulting .EXE doesn't change. In one case I replaced a .bmp with a .jpg and the resulting file was actually bigger.

    I also tried this on a new project and it still does more or less the same. It's as if Construct actually keeps all the information you've ever put into it.

    Am I missing something or should I report this as a bug?

  • Construct compresses all images as .png, it doesn't matter what format you're importing.

    But if you're importing a .jpg, then yes it will likely be a larger filesize than if you're importing a .bmp because jpeg compression is crap and causes extra color information due to artifacts. Png compression is optimized for areas of similar color, if you have lots of little changes in color information then the file size is going to go up.

    Example:

    http://dl.dropbox.com/u/529356/bigred.PNG

    This image is only 9.6kb, even though the physical dimensions are large. There is no change in color info from one pixel to the next.

    http://dl.dropbox.com/u/529356/smallSpray.PNG

    This image is 33.6kb even though it's got much smaller dimensions than the first image. The reason is that there is a lot of change in color info from pixel to pixel. That's almost four times more disk space.

    When you use .jpg compression, it causes little blurry artifacts at the edges of where colors change, in essence making a whole lot more colors than were there before. In short, .jpg is terrible for games and you shouldn't use it. Not only is it inefficient, it's ugly.

    As for removing the sprite from the game and the .exe not changing size... did you remove all instances of the sprite, or just one copy of it?

  • jpg hijack Q:

    So say I had a jpg pic. Should I load it in to photoshop and re-save as a png? Or has the dammage been done since it started as a jpg?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • As for removing the sprite from the game and the .exe not changing size... did you remove all instances of the sprite, or just one copy of it?

    All. Definitely all. In my simple test, there was only one layout and one object.

    These were the sizes of the .exes in the test project:

    Completely empty layout: 657kb

    Layout with large sprite: 3.54MB

    Layout with large sprite deleted: 3.34MB

    In my large project, the file sizes didn't change at all when I removed several huge objects.

  • jpg hijack Q:

    So say I had a jpg pic. Should I load it in to photoshop and re-save as a png? Or has the dammage been done since it started as a jpg?

    The damage has been done.

    To be safe you should probably just save all of your artwork as .png to begin with. Or .bmp. But .png supports alpha transparency, and Construct imports the alpha just fine and converts everything to .png anyway so, yeah, no reason not to use .png.

    >

    > As for removing the sprite from the game and the .exe not changing size... did you remove all instances of the sprite, or just one copy of it?

    >

    All. Definitely all. In my simple test, there was only one layout and one object.

    These were the sizes of the .exes in the test project:

    Completely empty layout: 657kb

    Layout with large sprite: 3.54MB

    Layout with large sprite deleted: 3.34MB

    In my large project, the file sizes didn't change at all when I removed several huge objects.

    That definitely sounds like a bug. Try this: Delete the large sprite, then save and close. Then reopen the .cap and export an .exe and see what that filesize is. It could be that it's just a memory issue with the IDE. It does still have to save the object in memory in case you want to undo the delete, after all... maybe something is getting fudged between that and exporting a build.

    At any rate it's probably going to have to go to the tracker, but getting as much info as you can on what's going wrong will help the devs figure it out.

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