Unity compress?

Dec 30, 2017
91
40
It is though.
Look, Unity is much different than Ren'Py. Compression works much differently than what you may think, and it is not always build size.

Ren'Py simply reads they file as they are, and they are not packed, which means you can easily corrupt compress them with third party tools.

In Unity I can have a 500mb psd file for a character and when I build the game, that 500mb will transform into a 2mb (Depends on settings, resolution, and so on) image during the build process.

Unity has already built-in methods to compress resources, and it is not always about reducing the game size... Sometimes, it is more preferable to have a +200% import size in order to be easier on the CPU, you can read more about it here if you are curious:

Not to mention that when you zip your unity game, the size is greatly reduced for distribution.


TLDR; Unity Engine already handles compression, you do not need to worry about it. It is not Ren'Py.
Okay, but for the trick of project extraction I found a positive answer:

Contrary to popular belief, it is possible to get the compiled code and assets from a built version of the Unity game. If you ever happened to create a build you can use tools such as ILSpy or dotPeek to gain access to the code. For assets, you can use Unity Asset Explorer. Just search that up on google and I'm sure you're capable of finding it. Else, I'm afraid it is truly gone forever assuming you didn't leave the project in the recycle bin on the windows.


THE FOLLOWING SOLUTION WORKS WITH WINDOWS ONLY


Once you have downloaded either ILSpy or dotPeek, navigate to the “managed” folder of your game build, and open the ‘Assembly-CSharp.dll’, ‘Assembly-CSharp-firstpass.dll’ and ‘Assembly-UnityScript.dll’ files with either of these programs. You shouldn't have a hard time finding all your code from there.


As for assets, using unity asset explorer, it is pretty straightforward to get your assets. I recommend reading this article: A practical tutorial to hack & protect Unity games - Alan Zucconi


It will show you how to do everything I mentioned above.
 

Winterfire

Forum Fanatic
Respected User
Game Developer
Sep 27, 2018
4,955
7,272
As I have said, that hardly matters.
You already get 49% compression just by zipping your project, and that is only with the default 7zip settings.
If you touched the assets like that, not only you would not gain any reduction in file size upon zipping them, but you'd have the added extra risk of corrupting the assets... In the best case scenario, a ruined CG only to gain a few kb/mb off.
 

cooperdk

Engaged Member
Jul 23, 2017
3,375
4,909
Nope. Sorry
You're wrong. Using a couple of tools you can actually extract game data to (fx) PNG and then compress, and put it back. But there's no bulk tool available (except one that costs $$$ named DevXUnity), so it would take a long time with fx Afterglow which has about 4500 textures.

True, Unity will run on the widest range of hardware including consoles... but
Fewer people are going to download a 6GB game.

Steam users...
6 GB games? I'm sorry mate, but if you create the same game using the same resources on Ren'Py and Unity, then the Unity game will be smaller unless you use a lot of external game assets. I can prove it, because I tried making a "Hello World" basic game on both Ren'Py and Unity.
The Unity version was 20 MB less than the Ren'Py version.

The reason?
Ren'Py has a complete Python package included in every game, which requires 70+ MB.
Unity compiles everything and the base folder ("Managed") is about 11 MB.
In order for Unity to be bigger, you need a game with hundreds of textures, but then again, it will be a lot faster, support your GPU, and support most platforms, which Ren'Py really doesn't.

By the way, DevXUnity DOES allow you to completely reverse a game into an editable Unity project.
 
Last edited:

Winterfire

Forum Fanatic
Respected User
Game Developer
Sep 27, 2018
4,955
7,272
You're wrong. Using a couple of tools you can actually extract game data to (fx) PNG and then compress, and put it back. But there's no bulk tool available (except one that costs $$$ named DevXUnity), so it would take a long time with fx Afterglow which has about 4500 textures.



6 GB games? I'm sorry mate, but if you create the same game using the same resources on Ren'Py and Unity, then the Unity game will be smaller unless you use a lot of external game assets. I can prove it, because I tried making a "Hello World" basic game on both Ren'Py and Unity.
The Unity version was 20 MB less than the Ren'Py version.

The reason?
Ren'Py has a complete Python package included in every game, which requires 70+ MB.
Unity compiles everything and the base folder ("Managed") is about 11 MB.
In order for Unity to be bigger, you need a game with hundreds of textures, but then again, it will be a lot faster, support your GPU, and support most platforms, which Ren'Py really doesn't.
Not exactly true.

The reason why the same game on Unity is lighter is because Unity has asset compression, Ren'Py does not.
Of course the Python package thingie you said is also true, but the biggest difference is in that.

And again, extracting assets to compress them with third party tools (and potentially corrupt them or make them ugly af) is completely useless... At least for distribution.
If you were to do that because you have a very smol HDD/SDD, then sure... You can get a few extra MB of space, but considering how cheap space is nowdays, it is not worth the risk of corrupting the game and having to redownload it.


-edit-
The opposite can also be true (An unity game having a way bigger size than the same project in Renpy), because wrong settings in Unity not only can kill performance, but also have a way higher import size. There are a couple examples of that here on F95Zone.
 

cooperdk

Engaged Member
Jul 23, 2017
3,375
4,909
Not exactly true.

The reason why the same game on Unity is lighter is because Unity has asset compression, Ren'Py does not.
Of course the Python package thingie you said is also true, but the biggest difference is in that.

And again, extracting assets to compress them with third party tools (and potentially corrupt them or make them ugly af) is completely useless... At least for distribution.
If you were to do that because you have a very smol HDD/SDD, then sure... You can get a few extra MB of space, but considering how cheap space is nowdays, it is not worth the risk of corrupting the game and having to redownload it.


-edit-
The opposite can also be true (An unity game having a way bigger size than the same project in Renpy), because wrong settings in Unity not only can kill performance, but also have a way higher import size. There are a couple examples of that here on F95Zone.
My point is that every single Ren'Py game has at least 80-120 MB of Python libraries etc., regardless of the game's size.
And that, given the other possibilities Unity offers, choosing Ren'Py for game development is like using a popcorn machine as a nuclear weapon.
 

Winterfire

Forum Fanatic
Respected User
Game Developer
Sep 27, 2018
4,955
7,272
My point is that every single Ren'Py game has at least 80-120 MB of Python libraries etc., regardless of the game's size.
And that, given the other possibilities Unity offers, choosing Ren'Py for game development is like using a popcorn machine as a nuclear weapon.
Hm? Are you sure? I remember that an empty project is around 6 MB, 80-120 MB of Python Libraries seems far-fetched...

Anyways, Ren'Py for game development is an acceptable choice depending on what you want to do.
I still have Ren'Py installed even though I can use Unity just fine.
 

Darksshades

Member
Feb 7, 2020
127
407
-edit-
The opposite can also be true (An unity game having a way bigger size than the same project in Renpy), because wrong settings in Unity not only can kill performance, but also have a way higher import size. There are a couple examples of that here on F95Zone.
Wish there was a easy way to forcefully compress the assets. Its ridiculously easy to do it the dev side, just activate an option on the project file to compress the game size 50-80% but there are always devs that doesn't do it.
Just to point out an example. 1.5 GB to 300 MB just setting a dropdown option

TLDR; Unity Engine already handles compression, you do not need to worry about it. It is not Ren'Py.
Thats only true if the developer knows even a bit of what its doing. I think the default settings of unity does not use compression for both textures and game asset compression. So its not uncommon to see unity pixelart games being 1-2GB extracted and 100 MB when zipped just to show how badly compressed the files really are.
 
Last edited:

Winterfire

Forum Fanatic
Respected User
Game Developer
Sep 27, 2018
4,955
7,272
Wish there was a easy way to forcefully compress the assets. Its ridiculously easy to do it the dev side, just activate an option on the project file to compress the game size 50-80% but there are always devs that doesn't do it.
Just to point out an example. 1.5 GB to 300 MB just setting a dropdown option
That does not matter as much as you may think.
If you zip the same game (with default compression or LZ4HC), the difference will be of around 100mb on a 3gb game, which is nice, but not game changing.

The issue is when unzipping the game, the one with default compression might unzip to something of 7gb+, whereas the LZ4HC one will keep around the same size as the zip you downloaded.
Considering how cheap memory is, hardly anyone would care about this... Of course the 100mb (and more on bigger games) is a plus if you have a slow connection.


Thats only true if the developer knows even a bit of what its doing. I think the default settings of unity does not use compression for both textures and game asset compression. So its not uncommon to see unity pixelart games being 1-2GB extracted and 100 MB when zipped just to show how badly compressed the files really are.
If the developer has no idea of how to use Unity correctly and still decides to publish a game, the game's size is the least of worries... I have seen some cursed stuff done on Unity x).
It is probably one of the biggest reasons why Unity games are considered "slow" and require high resources.