I’d like to occasionally include a complete Unity project with a blog post, does anyone have any tips for minimising the size of a project, assume I’m only using geometric objects included in the editor like cubes and spheres, and only tiny textures if any at all…
What’s the best way to identify what packages I can ditch from the project ?
Is there any other resources that can be ditched assuming I’m just using simple geom’s and mainly focusing on c# behaviours ?
Instead of a project, it might make more sense to export a Unity package file with only your own content.
For a smaller file, don’t include any packages from the package manager. Whoever downloads can create their own project and the common packages will already be there (or they can just install the packages on their own).
Code stripping set as high as possible in player settings
Crunch textures + limit their resolution to lowest possible for each texture
If you do not need mipmaps, disable them on textures where not necessary
Remove any 3rd party code and plugins that are not 100% necessary
Remove any (or all) packages that are not 100% necessary
The above alone will drastically reduce the size of a project.
For example, our WebGL build went from 400mb to 16mb using just the above steps, with no visible loss of quality in any way.
This also helped reduce memory consumption. Good luck!
Do those things change the project source size? I thought they’d only change the build size and cached resources (ie: the Library folder).
If uploading projects make sure to delete the Library folder, as well as obj and Temp if I remember correctly. They’re all derived cache data, as opposed to source, and are not necessary when distributing your source.
Project Tiny isn’t what you want. It’s designed around smaller builds and low power consumption, not smaller distributed project sizes. It also requires basically changing the entire way your project works if you want to use it.
In such case, OP can simply use online repositories, like github for example. With numerous advantages.
No need for uploading projects to own website, other than linking references to repo.
The problem wasn’t about hosting a large file, it was about identifying what would best be removed from the project for sharing, which ultimately amounts to using a package as explained. For the samples I read on the blog, that makes a decent amount of sense and solves any potential dependency issues save for packages.