Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Lessons Learned with Unity and WebGL

37,336 views

Published on

Lessons we learned while getting Wonderball Heroes on WebGL using Unity 5.

The slides share our challenges, optimizations made and general tips for working with Unity and WebGL.

Published in: Software
  • If you’re looking for a great essay service then you should check out ⇒ www.HelpWriting.net ⇐. A friend of mine asked them to write a whole dissertation for him and he said it turned out great! Afterwards I also ordered an essay from them and I was very happy with the work I got too.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THE BOOK INTO AVAILABLE FORMAT (New Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://urlzs.com/UABbn } ......................................................................................................................... Download Full EPUB Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... Download Full doc Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... Download PDF EBOOK here { https://urlzs.com/UABbn } ......................................................................................................................... Download EPUB Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... Download doc Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THE can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THE is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBOOK .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, CookBOOK, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, EBOOK, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THE Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THE the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THE Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Dating for everyone is here: ❶❶❶ http://bit.ly/2ZDZFYj ❶❶❶
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Sex in your area is here: ❶❶❶ http://bit.ly/2ZDZFYj ❶❶❶
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THAT BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book that can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer that is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story That Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money That the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths that Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Lessons Learned with Unity and WebGL

  1. 1. Lior Tal Unity Developer (Moon Active) http://www.tallior.com Oren “De-Panther” Weizman Unity Developer (Total-Viz) http://de-panther.com/ + = Lessons Learned Getting Wonderball Heroes To WebGL Israeli Unity Developers Meetup 19/4/2015
  2. 2. Moon Active
  3. 3. Wonderball Heroes 2D “Destroy All Pegs” Game Over 1 Million Downloads Developed in Unity 4.5.4
  4. 4. WebGL: JavaScript API for rendering interactive 2D or 3D graphics inside an HTML5 <canvas> element WebGWhat ?!
  5. 5. Why WebGL ? Chrome (M42) dropped NPAPI support
  6. 6. WebGL In Unity - Released in Unity 5 as Preview - OpenGL ES2 - Officially supports Chrome & Firefox - Platform Limitations: ● Networking ● Audio features ● Script debugging ● Threads ● File I/O
  7. 7. Unity WebGL Build Process C# UnityScript Boo Compiled Code (IL) C++ JavaScript Mono Compiler IL2CPP Emscripten
  8. 8. Challenges New Version (Unity 5) New Platform (WebGL) New Compiler (IL2CPP)
  9. 9. New Version (Unity 5) - Auto Update - Most of the heavy lifting - Animator - Changes to “Apply Root Motion” - AudioSource - new “Spatial Blend” - Check Plugins for compatibility with Unity 5 !
  10. 10. New Platform (WebGL) Encountered 2 WebGL related bugs: - No WWW error reporting - AudioSource.mute doesn’t work … Already Fixed in Unity 5.1
  11. 11. New Compiler (IL2CPP) - New & Innovative Tech → Bugs - Issues with JSON.NET ○ Received a “street version” from the publisher (nebraskadev@gmail.com) ○ No support for generic arrays (Fixed in 5.0.1) - Check Plugins for compatibility with IL2CPP !!
  12. 12. Developing for WebGL - Minimal code changes from WebPlayer → WebGL - Build Settings o Optimization Level - Player Settings o Browser Memory o Cache o Enabling Exceptions o WebGLTemplates
  13. 13. Developing for WebGL - Debug HELL (JavaScript Console FTW) - Compression (gzip) - Full Screen button - need workarounds - Mixing domains (CORS) - New Native Plugin = “.jslib”
  14. 14. Our Dev Process - #if (UNITY_WEBPLAYER || UNITY_WEBGL) - JS Wrapper for FB SDK - Test as much as possible in editor
  15. 15. Our Dev Process #2 - Local Web Server (quick updates) - Redirection to two versions o Chrome → WebGL o Other Browsers → WebPlayer
  16. 16. Optimizations Goal - Minimize Download Size Initially 300 MB !! - Compression - Optimization Level - Exception Support - Streaming - Custom Build Script - Stripping*
  17. 17. Build Stats - Editor.log shows stats after finishing a build - Assets listed in decreasing size
  18. 18. Compression - Only for non-development builds - .htaccess on supported servers - Otherwise, need to manually rename some stuff
  19. 19. Optimization Level - Enables optimizations (Emscripten emcc parameters) - More optimizations == slower builds
  20. 20. Exception Support - Enable / Disable Exception Support
  21. 21. Build Output Game data (all assets, scenes, etc) Code (converted to js) Binary image for heap memory (Emscripten) Embeds the game content Supporting files for initialization Same as this folder, only compressed (gzip)
  22. 22. Streaming In WebGL - No official solution out of the box, but... - ...Using an editor script by Unity Developer (Thanks @jonasechterhoff !) o Shared in the Unity Beta Group - Implemented as a [PostProcessBuild] step
  23. 23. In a Streamed Web Player: “The index of the first level that will have access to all assets under Resources” http://docs.unity3d.com/Manual/class-PlayerSettingsWeb.html First Streamed Level
  24. 24. Streaming WebGL Solution 1. Split “game.data” and “fileloader.js” to smaller files (one per scene) 2. Add Resources to .data file of “First Streamed Level” 3. Combine all the new “fileloader” files into one 4. Change the code to run the game after first scene downloaded 5. Downloads scenes one by one
  25. 25. Custom Build Script - Removes unneeded scenes - Removes resources from the build - Removes texture usage & downloads them at runtime
  26. 26. Final Results - The game runs smoothly !! - Final build size: 28 MB - New users - can play after 3 MB - No need to install any plugin - Loading time is longer than WebPlayer
  27. 27. Thank You ! Lior Tal liortal53@gmail.com http://www.tallior.com Oren De-Panther Weizman depanther@gmail.com http://de-panther.com/
  28. 28. Unity Developer We’re Hiring! hello@moonactive.com
  29. 29. Tools ● Browser Developer Tools (Chrome, Firefox) o JS console, Network requests ● Charles (web proxy) o View network requests + responses ● NGINX - lightweight, portable web server o Setup a local test environment
  30. 30. Resources WebGL ● Owlchemy Labs Port to WebGL - https://hacks.mozilla.org/2014/10/unity-games-in-webgl- owlchemy-labs-conversion-of-aaaaa-to-asm-js/ ● WebGL Streaming - http://forum.unity3d.com/threads/webgl-with-streaming-option-like- webplayer.316620/ ● Fullscreen - http://forum.unity3d.com/threads/webgl-fullscreen-from-within-the-unity-app.318518/ ● Emscripten - http://kripken.github.io/emscripten-site/docs/getting_started/Tutorial.html ● http://forum.unity3d.com/forums/webgl.84/ ● http://docs.unity3d.com/Manual/webgl-gettingstarted.html ● WebGL Native Plugin - http://docs.unity3d.com/Manual/webgl- interactingwithbrowserscripting.html Unity 5 ● Upgrade Guide - http://docs.unity3d.com/Manual/UpgradeGuide5.html

×