does compressing images helps keeping the game size low. How can I keep my game at a low size and not compromise quality.
Use PNG only when you need transparancy/alpha channel, then optimize your png : https://tinypng.com/
PNG format is lossless, but heavy.
If your image doesn’t need transparancy : use jpg and manually choose the quality for the quality/size compromise.
And yes, compressing image reduce the size of the game, but uncompression need some more ressources.
I don’t agree with you Kink.
You should use PNG everywhere : it’s lossless but not as heavy as BMP and it supports transparency.
Note : GDevelop doesn’t support indexed PNG images (only full RGB PNG). If your images are in indexed mode, you’ll need to convert them using GIMP (Image > Mode > RGB and then export them again).
It’s depends on what game size we are talking about :
- size of project : the game folder
- size of the game in RAM
In the game folder, or on the web, the tiniest is the best : if you can reduce the size of the final product by 50%, it worths the working time.
In the ram : it’s true that compressed files will have to be decompressed into raw bitmap, wich take cpu/ram. Again optimization is a good thing to do if you are able to limit the cpu needs (or ram needs in my case in native mode i start to feel very bad the way is working GD with 32bits compilation).
A good example on image formats and optimizations : a complex image (size 1920*1080 pixels) used as background :
- The Jpeg file, quality set to 65% : average 400Kb
- The PNG file : 2.5Mb
There will be no real differences between the two images in terms of quality, but on web based HTML5 project, the difference will be heavy on loading times, scene changes (if you change the background also). The performance will also be affected if you use multiple images : 3 400Kb images versus 3 2.5Mb images will definitively be noticable.
Image format is an important thing depending on what media your using, the distribution mode of your game you have choosen, and of course performance.
If i could i would use only dds format but GD doesn’t support it (i work only on the native mode), also because it’s not free format (like jpeg isn’t too even if it’s a standard). Also in lot of case i’d use gif instead of png, sometimes you don’t need a lot of colors on simple image and you could obtain a 1:100 ratio between the 2 formats.
I have question related to this Victor and native games :
why does GD executable always take the same size in RAM without any changes in time ? Depending on what scene i generate, the client never changes it size, it seems it loads all ressources from the beginning, instead of loading only images/sounds it needs for the current scene.
I monitor this carrefully in my development process, but without the optimizations i’ve written up here in the post, i could have a 500Mb game executable… Thanks optimizations, the exe doesn’t exceed 25Mb.
It loads only the images it needs for all the objects of the scene.
I need my game file size not to cross 40 mbs this game is big and i think reach 100 mbs. please help.
Optimize as i explained (png optimization + Use Jpeg when transparency isn’t necessary), and make choices, there is nothing we can choose for you.
Maybe some images can be resized if you use scaling options (under scale “1”).
Then at last try optimization : if you need 100 clouds in the sky, no need to have 100 images : just use random image with random vertical/horizontal flip, random scale, random colors, etc. There are many options and ways to repeat some sprites without any repetitive feelings.
I am already taking care of these things. Is there nothing else I can do? Like the batman and robin’s adventure is about 2 mbs more or less. how is that possible
Advanced optimization, for example my current project is globally around 22Mb, where without optimization when i’ve done the “working draft” it was 257Mb.
For example I concepted an optimization way for background in the game to use a little library of 15 tiny images instead of 20 high resolution images : the result is better, where i had 40Mb for background images i have now only 1.8Mb.
Also i work on native mode, lot of effect can be made with particule system wich is very light… If your effect are bitmap animation, there is no miracle ! The game your refer to is probably using native functions on android/ios to render some effet.
Example : a good looking fire with particule system is just 1 action, so few bits in the projects ; a good looking fire with bitmap animation (frame per frame) will require lot of image, wich can take quickly take more than 5Mb of space for a single animation.