Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[Facebook PlayableAd] runtime.js size

Discussion in 'Project Tiny' started by TirawaStudios, Apr 23, 2019.

  1. TirawaStudios

    TirawaStudios

    Joined:
    Feb 13, 2019
    Posts:
    1
    I'm trying to create a Facebook PlayableAd and there is a size restriction: 2mb. Also, they demand a single HTML file with all content (js, sprites, sounds, etc).

    After 3 days of tests, I just figure out that the JavaScript code is huge even in a fresh new project. Actually, the runtime.js size never changes.

    This one is my PlayableAd project.
    mine.jpg

    This one is a fresh new and completely empty project.
    new.jpg

    When I create a new project and build, no code, no assets, nothing, using the option to minify and embed the JS code to create a single HTML file, the final size is almost 1.7mb.

    How can I create a mini-game with 300kb?

    Anyone, please, I need some insights here.

    Thanks
     
    romiohasan and Alegev like this.
  2. Alegev

    Alegev

    Joined:
    Feb 14, 2017
    Posts:
    9
    the same problem, cannot figure out where to decrease the size, even I have disabled much useless modules, and compress my pics to extremly small size, my release build is still bigger than 2mb.
     
    romiohasan likes this.
  3. ntl92bk

    ntl92bk

    Joined:
    Apr 12, 2016
    Posts:
    1
    I think we can remove "game.js.map" file
     
  4. Alegev

    Alegev

    Joined:
    Feb 14, 2017
    Posts:
    9
    of course you can delete it , actually the "game.js.map" is useless for release, it's just a map for minified code that we can ignore, and what I meant the "2mb size" was not include this map file.

    if you focus on the progress of building, you will find a file named "runtime.js" which has 4mb size(don't know how to decrease this size) that has been build into the final html file, and I think this is the real problem.
     
  5. TanChoi

    TanChoi

    Joined:
    Jun 14, 2016
    Posts:
    15
    Same here.

    I'm trying to reduce file size under 2mb for my playable ad.
    But already the runtime.js takes almost 2mb.