How to decrease my empty Unity PUN project size

Dear Community
I created an empty project in Unity and imported PUN 2 via the package manager. I excluded the demos and the photon chat.
When I deployed a build of the still empty project (only a camera in the default scene) my project had 120mb!! (This is for MacOS)
Before I imported PUN the size of the build was 60mb. So by simply importing PUN and not even using it my size increased by 60mb.
Is there a way for me to decrease that? I googled around but couldn't find anything.
I would be grateful for any insights and tips!

Best Answers

  • Tobias
    Tobias admin
    Answer ✓
    This is actually a question for Unity, not us. It's not like PUN adds a ton of code or complicated assets.
    Maybe Unity was stripping way more of the engine, when the scene did not contain anything.

    Do you have a non-empty project that's half-way "realistic"? If so: Add PUN there and compare build sizes before and after. This should be a fairer comparison.

    And: Build a release.
  • Tobias
    Tobias admin
    Answer ✓
    Glad this helped get some context.
    I'm no expert for the build options but in general, release code should be leaner. The project size also depends on how much debug information is being created along with the project. This data / code is needed to pause execution, etc. It can be stripped from release builds.

Answers

  • Tobias
    Tobias admin
    Answer ✓
    This is actually a question for Unity, not us. It's not like PUN adds a ton of code or complicated assets.
    Maybe Unity was stripping way more of the engine, when the scene did not contain anything.

    Do you have a non-empty project that's half-way "realistic"? If so: Add PUN there and compare build sizes before and after. This should be a fairer comparison.

    And: Build a release.
  • Dear Tobias,
    thank you very much for a very helpful reply.
    I used Unity's "TANK Tutorial" to do as you suggested. When I imported PUN 2 the build size increased from 90mb (without) to 95mb (with PUN)
    So I tried building a release version of my own game (instead of a development build) as you suggested and yes, instead of 130mb I am down to 70mb.
    Thanks a million.
    Would you mind explaining to me, why building a release has such a huge impact of the size of the build?
  • Tobias
    Tobias admin
    Answer ✓
    Glad this helped get some context.
    I'm no expert for the build options but in general, release code should be leaner. The project size also depends on how much debug information is being created along with the project. This data / code is needed to pause execution, etc. It can be stripped from release builds.
  • Thank you Tobias. Also for your excellent PUN product.
  • Thanks for the kind words! Glad you get along so well.