Search Unity

Flash build size and parfomance

Discussion in 'Flash' started by Pandemona, Dec 29, 2011.

  1. Pandemona

    Pandemona

    Joined:
    Oct 13, 2010
    Posts:
    13
    After playing a little with 3.5 beta i realized that flash build performance isn't as good as should be(lots of bugs, memory requirements and unstable as unityplayer), yes i understand that it's in beta stage and don't mind bugs and performance issues, i hope they get fixed in next builds, but most thing that bugs me is flash build size.

    Compared to Unity3D player build which is approximately 500kb in size with simple scene, flash build is 2-3 mb or more, it doesn't sound too big, but when scene is complex end it uses many assets then flash build will be more than 10 mb.

    That idea came from Alternativa 8 and Away3D demos, those where huge in size, racing demo made with alternativa 8 was 50 mb+ if i remember correctly.

    Will unity 3.5 stable version(non beta) have asset compression method like unity Player or it's already compressed, just engine runtimes are included in flash builds?
     
  2. AngryAnt

    AngryAnt

    Keyboard Operator

    Joined:
    Oct 25, 2005
    Posts:
    3,045
    On flash we need to build the entire Unity engine to action script.

    This not only increases swf file size compared to unity3d file size (for the webplayer, the engine is contained in the plugin), but also decreases performance as the webplayer engine runs as native code.

    The platform consideration is leveraging size and performance versus reach.
     
  3. Pandemona

    Pandemona

    Joined:
    Oct 13, 2010
    Posts:
    13
    Wait, what? whole Unity3d is rewritten in AS3? and publisher is just a translator of C#/JS code to AS3? o_O

    Some milliseconds will be added before as3 calls some method and some method returns value. It'll be too slow for complex projects with drawcalls 500+

    Ok now i understand where comes from this 2-3 mb but what about memory issues? is it just a bug or just project isn't optimized for flash platform?
     
  4. AngryAnt

    AngryAnt

    Keyboard Operator

    Joined:
    Oct 25, 2005
    Posts:
    3,045
    Yea publishing "just" translates everything to as3 ;)

    Drawcall heavy stuff should not run particularly slower in flash. Generally CPU stuff is expensive, but GPU stuff is cheap. Flash is a new, unique, Unity target. You can not apply logic and assumptions to it gathered from other targets.

    You did not mention any memory issues in your original post. Which issues would that be?
     
  5. Pandemona

    Pandemona

    Joined:
    Oct 13, 2010
    Posts:
    13
    1. Image compression, how this would work? will flash based player handle image compression?
    2. Audio compression, how audio compression will apply in flash build?

    3. What about GC? how Garbage collecting will work? for example i created 1000 new cubes and after instantiation i deleted it, will it still allocated in memory? how good flash machine handles memory management?
     
  6. RalphH

    RalphH

    Administrator

    Joined:
    Dec 22, 2011
    Posts:
    592
    1) works by default when you use a block compressed texture format. For Flash this is encoded as a JPEG-XR by default.
    2) Anything imported will be converted to MP3 for Flash
    3) Most GC should be fine but some bugs might be there.
     
  7. AngryAnt

    AngryAnt

    Keyboard Operator

    Joined:
    Oct 25, 2005
    Posts:
    3,045
    Regarding 1. and 2. Flash functions just like any other platform. When you switch to it in the editor, everything gets imported to that platforms settings. You can tweak import details on a per-asset level via the import settings available through the inspector - when the asset is selected.