Compressing Games

HandofVecna

Active Member
Sep 4, 2018
563
982
Hello,

I was wondering if someone could help with compressing a game. The game has over 500 images, several music WAV files, SFX, and animations. It is coming in at 3G. All images have been saved at smallest size through adobe. How do you as developers expand your game but keep the size manageable?

Thanks for any help you might be able to provide.

Mick
 

Porcus Dev

Engaged Member
Game Developer
Oct 12, 2017
2,582
4,692
I don't know what kind of game engine you use, but in renpy it's usual to use WEBP for images, WEBM for video (VP9 codec for video and OGG for audio), and OGG for music and/or sound effects.
 
  • Like
Reactions: HandofVecna

Rich

Old Fart
Modder
Donor
Respected User
Game Developer
Jun 25, 2017
2,490
7,035
All images have been saved at smallest size through adobe.
But in what format? If they're PNG, for example, you don't get a ton of compression.

For images, the main issue is to use a lossy format. JPEG, or (as mgomez0077 pointed out) WEBP. With those formats, you can trade off "size on disk" against "quality." In many cases, a relatively small reduction in quality will yield a VERY significant savings in disk size. In the work I'm doing, I'm usually getting about a 6-to-1 compression in the JPEG's I'm using versus the JPEG's that Daz Studio turns out, and those are significantly smaller than the PNG's would be.
 

HandofVecna

Active Member
Sep 4, 2018
563
982
I don't know what kind of game engine you use, but in renpy it's usual to use WEBP for images, WEBM for video (VP9 codec for video and OGG for audio), and OGG for music and/or sound effects.
Using Renpy. Thank you so much for the advice will look into it ASAP! Very kind of you to respond!
 
  • Like
Reactions: Porcus Dev

HandofVecna

Active Member
Sep 4, 2018
563
982
But in what format? If they're PNG, for example, you don't get a ton of compression.

For images, the main issue is to use a lossy format. JPEG, or (as mgomez0077 pointed out) WEBP. With those formats, you can trade off "size on disk" against "quality." In many cases, a relatively small reduction in quality will yield a VERY significant savings in disk size. In the work I'm doing, I'm usually getting about a 6-to-1 compression in the JPEG's I'm using versus the JPEG's that Daz Studio turns out, and those are significantly smaller than the PNG's would be.

Thanks for the reply! All my images are PNG. I will convert to JPEG or WEBP. Thanks so much both of you!
 

Rich

Old Fart
Modder
Donor
Respected User
Game Developer
Jun 25, 2017
2,490
7,035
Thanks for the reply! All my images are PNG. I will convert to JPEG or WEBP. Thanks so much both of you!
Oh, yeah - you'll be able to get significantly smaller images using either of those formats...

PNG's good if you absolutely, positively must have every pixel perfect, but for games where most images aren't going to be seen for more than a minute, you don't usually need that kind of fidelity.
 
  • Like
Reactions: HandofVecna

Canto Forte

Post Pro
Jul 10, 2017
21,165
25,947
Fancy things in any game engine need a lot of work and innovation.
You have to remember to look at what memory game uses right off the bat as to not clog the pipes.
Bad memory optimisation coupled with huge size of renders in animations result in laggy / buggy game. Just remember that running the game solely on your render machine does nothing 4 optimisation as all games have to run on everyone's rig.
Happy Gaming!
 

recreation

pure evil!
Respected User
Game Developer
Jun 10, 2018
6,272
22,421
If you are using Photoshop, save as a JPG with a quality of 8 will give you nice small file size without any noticeable quality loss.
There is a webp plugin for photoshop as well. It comes directly from google (the developers of the weppy format):
 
  • Like
Reactions: mickydoo

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,581
2,219
Hello,

I was wondering if someone could help with compressing a game. The game has over 500 images, several music WAV files, SFX, and animations. It is coming in at 3G. All images have been saved at smallest size through adobe. How do you as developers expand your game but keep the size manageable?
Another consideration is... Is it your own game or something written by someone else?

If it's your own game... then the advice so far will see you on the right track for a future release.

If however it's someone else's game and you just want a smaller version of it (perhaps to create an android port of that game)... consider using UnRen to unpack it (if it's already packed)... then use something like Cruncher to vastly reduce the size of the images/videos/audio files. As with the other suggestion already mentioned, you'll be balancing image quality -vs- file size. Cruncher does have a disclaimer, which I will repeat here... it overwrites the original files... So make sure to run it against a copy of the game, not the game itself. I can't speak to the quality of the resulting images, since I've never personally used it.
(For the most part, RenPy doesn't care what the file extension is. If you have a .PNG file that is actually a .JPEG... RenPy will display it anyway. Tools like Cruncher will recode the images to another format, but leave the name alone so nothing within the game breaks. Which is why tools like Cruncher can work without issue).

There are other tools which will mass convert one image format to another format... or convert one image format to a lower quality version. I've only done something like this once before and found some random freeware tool using google. I didn't even keep it long enough to remember what it was called.

As for "saved at smallest size through adobe"... I will say that isn't always the case. It really depends on the settings.
For example, a random 720p image I picked to test with resulted in the following file sizes (when using "Save for Web...").
  • PNG (24bit) - 1.1 M
  • PNG (8bit) - 251 K
  • JPEG (Quality 85) - 328 K
  • JPEG (Quality 60) - 146 K
  • JPEG (Quality 30) - 59 K
  • JPEG (Quality 10) - 35 K
Same image, just differing settings.

My usual "find the right level" is to find an image with a large flat area with almost the same color (sky, doors, windows, dresses, etc)... then compress it. If the resulting image is too blocky and too grainy for my personal tastes... I up the quality level and try again until I'm happy. Then I use that same image quality throughout the project (because I can't be arsed evaluating each and every image). The resulting images are probably bigger than they absolutely could be... but it's a trade off of image quality -vs- my time. Also... there WILL always be images that don't look good when compressed... learn to live with it as long as it remains a tiny percentage of the overall project -OR- learn to love 3GB projects :devilish:

If it is your own project... then render to the highest quality you can and keep those images separate. Then either photoshop each one as you finish each render or mass convert the whole folder just before (each) release. Personally I would delay compressing/converting images until the last moment - since maintaining two copies of the same images WILL result in something going wrong at some point. You'll re-render something or touch it up or something and your two versions will be out of step. It really depends on your workflow and how careful you are.
 
Last edited:

mickydoo

Fudged it again.
Game Developer
Jan 5, 2018
2,446
3,548
There is a webp plugin for photoshop as well. It comes directly from google (the developers of the weppy format):
Yeah I got that, I didn't see any size difference when the .jpg was at 8. The webm for movies but is godsend.
 

recreation

pure evil!
Respected User
Game Developer
Jun 10, 2018
6,272
22,421
Yeah I got that, I didn't see any size difference when the .jpg was at 8. The webm for movies but is godsend.
It's not so much the image size, but the quality difference. Webp tend to leave more original pixels on low compression plus it keeps transparency.