SlideShare a Scribd company logo
1 of 40
Download to read offline
IntoWebGL:
A postmortem of porting
to a post-plugin
existence
Ryan Alcock
ryan.alcock@intoscience.com
Rob Lee
rob.lee@intoscience.com
What is IntoScience?
IntoScience is large
● 124 unique activities mapped to curriculum.
● 6 interactive 3D environments.
● 38 ‘quests’ (including multi-part, ambience & portals)
● Multiplayer live science quiz.
● Always on-line.
● Teacher control over student navigation.
● Reporting
● And much more!
IntoScience is Cross-Platform
● WebPlayer
● iPad
● Standalone (Windows & Mac)
● Windows App Store
● Working Android prototype
● And now… WebGL!
Our customers are schools
● Slow networks
● Slow machines
● Restrictive firewalls / proxies
● Limited IT support
Basically, IntoScience is rather ambitious
● Small team (<15 people)
● Lots of 3rd party Assets from the Asset Store
○ NGUI
○ AStar pathfinding
○ Marmoset
○ Json utils
○ Tween utils
○ Playmaker
○ Mega-Fiers
○ ...and many more
● Lots of Playmaker driven content (eep)
● So the LEAST likely app to be able to port smoothly into a new platform like
WebGL
Build System
Texture Streaming
Why WebGL?
● Chrome were the first to move away from the old plugin structures.
● There is no Chrome without using WebGL
● Chrome is 46.1% of our browser users (28% of all platforms)
● No choice but to support it if we want to keep using Unity (we do!)
● Google has forced our hand in the short term
● In the long term everyone will need to use it anyway because…
● No plugin!
○ Makes it a lot easier to deploy to schools
○ Easier to release new versions
WebPlayer is dead
● The rest of the vendors will soon be following the same path as Chrome
● WebPlayer won’t exist in Unity 5.4
● Reality is WebPlayer is already gone. You should already be using
WebGL.
● The problem?
WebGL is still a ‘Preview’
● Not quite there yet… but close!
● Clearly a work in progress.
● Must be treated as an entirely new platform
● Many missing features
● Critical bugs from all sides
● BUT!! It’s still possible to get something working
IntoScience on WebGL
Current stats
● Initial download of 21Mb of compressed data and javascript.
● After the initial download the results should be cached.
● But still have to compile the javascript every time.
● About 10 seconds load time on an i7 with fast internet. (after initial load)
● 5 to 6 minutes initial load time on a slow chromebook
● 1 to 2 minutes on subsequent loads.
IntoScience on WebGL
First release (Google September deadline)
● Had problems with memory
● Tended to crash if re-loading the page.
● 3D scene performance was poor.
IntoScience on WebGL
Second Release (World Education Games)
● Lots and lots of students (800,000)
● Scary
● Solved the problem with the memory and stability
● Improved 3D performance.
What went right?
What went right?
● Released on time.
● Multiple releases in short period of time.
● Most of the content ‘just worked’
● Unity managed to fix the most critical issues before the deadline.
● Still sharing the codebase between all our platforms.
● Content team didn’t have to worry about the WebGL differences.
● Now have a plugin free environment.
The Bad Stuff or: Tips and Tricks to
Avoid The Bomb
What went wrong?
● Being on the bleeding edge of Unity releases is problematic.
● Bug fixing ‘whack-a-mole’
● WebGL was/is ‘coming in hot’ which means we were too.
● Cache fun.
○ Always be clearing
○ Require production asset versioning.
● Some audio assets crash on import.
● Lots of memory issues
● Lots of performance issues
WebGL performance
● WebGL is super hard to profile accurately. Very unstable at the moment.
○ To profile memory, start with the profiler turned off. Switch it on and take a memory snapshot
before it crashes.
○ Don’t profile memory usage in the editor game window.
○ Luckily, framerate profiling in the editor is almost accurate enough to point you in the right
directions.
○ CPU will pretty much always be the problem at the moment
○ Reduce draw calls as much as possible
○ Make sure your scripts are optimised.
● Framerate of WebGL is about half of WebPlayer for the same scene.
● Using asset bundles turns off static batching. Manually recombine with
StaticBatchingUtility.Combine(..)
Cross-Origin Resource Sharing (CORS)
● CORS!
● WebGL requires CORS headers for all the www calls you make.
● This means you have tell your webserver to add them.
● http://enable-cors.org/server_apache.html
● There are no movie textures in webgl. Use the WebGLMovieTexture plugin.
● Add video.crossOrigin = “anonymous”; to the .jslib file
Our WebGL App Goals
● Smallest possible initial download.
● Bundle/Stream everything.
● Minimise wait time with scaling asset detail levels.
● Avoid third party plugins!
● Remove all exceptions (not easy).
● Generally try to reduce codebase size.
Asset Bundles
● “chunk” your asset bundles as much as possible.
○ Promotes better caching.
○ More flexible detail level scaling.
○ Make sure to AssetBundle.Unload(..) asap.
○ Only load/unload one bundle at a time.
○ Download one asset at a time.
Asset Bundles
● Regularly sanity check asset bundle contents.
● Don’t use the old asset bundle system. (bugs)
● Use crunched texture compression for everything.
● Compress all your meshes as much as you can.
Code Stripping and Asset Bundles
● Use namespaces to fix stripping problems.
● Brute force the rest. Find the errors and add to list.
○ Look for “Could not produce class with ID XXX”
○ http://docs.unity3d.com/Manual/ClassIDReference.html
WebGL Memory
● Memory usage was one of the key limitations
● Try set your WebGL Memory Size to a max of 256 for
stability. This can be hard.
● Turn off ‘Data Caching’ for now!!
● Recommend you don’t use www.
LoadFromCacheOrDownload(..) for now!!
Minor Issues
WebGL Player Settings
● Our current Unity Player Settings
Random Tips
● Use the chrome developer tools. (Ctrl + Shift + I)
● Don’t try inspect/debug the .js files!
● Chrome can throttle bandwidth now. Useful for testing for clients with poor
internet.
● Use the .jslib plugins for unity->javascript communications.
● Setup a local Apache server to test your stuff. I use XAMPP.
Random Tips
● For too long we didn’t have a backspace key!!
● Here’s useful snippet for the HTML wrapper: (Backspace and ESC blocking)
TIP: Testing Webgl Apps
● Unity dev may not have experienced a lot of these
issues before.
● Maintain a local web server.
● Modify local hosts file to allow cross-domain fakery.
● e.g. Add:
○ 127.0.0.1 mydomain.com
○ This will let me access my local server via http:
//mydomain.com and test the CORS setup.
The Future
The Future
● Multiple vendors working on making WebGL better.
● New technology coming to improve WebGL/javascript
performance
○ WebAssembly - faster, smaller download/compile times
○ SIMD.js - faster math stuff
○ Shared Array Buffers - threading
○ Unity tools for code stripping.
● Stick with it! Things will constantly improve!
http://intoscience.com/signin/
Questions and Live Test!!
Questions?
IntoScience
http://www.intoscience.com
Ryan Alcock
ryan.alcock@intoscience.com
Rob Lee
rob.lee@intoscience.com

More Related Content

What's hot

The Professional Programmer
The Professional ProgrammerThe Professional Programmer
The Professional ProgrammerDave Cross
 
Using Javascript in today's world
Using Javascript in today's worldUsing Javascript in today's world
Using Javascript in today's worldSudar Muthu
 
npm + browserify
npm + browserifynpm + browserify
npm + browserifymaxgfeller
 
HH.JS - State of the Automation
HH.JS - State of the AutomationHH.JS - State of the Automation
HH.JS - State of the AutomationAdam Christian
 
Writing native Linux desktop apps with JavaScript
Writing native Linux desktop apps with JavaScriptWriting native Linux desktop apps with JavaScript
Writing native Linux desktop apps with JavaScriptIgalia
 
Instant LAMP Stack with Vagrant and Puppet
Instant LAMP Stack with Vagrant and PuppetInstant LAMP Stack with Vagrant and Puppet
Instant LAMP Stack with Vagrant and PuppetPatrick Lee
 
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.js
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.jsThe MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.js
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.jsMongoDB
 
Work smart with Gutenberg - Fellyph Cintra
Work smart with Gutenberg - Fellyph CintraWork smart with Gutenberg - Fellyph Cintra
Work smart with Gutenberg - Fellyph CintraFellyph Cintra
 
Vagrant + SaltStack + Django - Ararat Poghosyan - DM10
Vagrant + SaltStack + Django - Ararat Poghosyan - DM10Vagrant + SaltStack + Django - Ararat Poghosyan - DM10
Vagrant + SaltStack + Django - Ararat Poghosyan - DM10Ararat Poghosyan
 
Coding for the cloud - development of modern web applications
Coding for the cloud - development of modern web applicationsCoding for the cloud - development of modern web applications
Coding for the cloud - development of modern web applicationsWekoslav Stefanovski
 
Through Meteor to the stars - Developing full-stack SPA's with meteor.js
Through Meteor to the stars - Developing full-stack SPA's with meteor.jsThrough Meteor to the stars - Developing full-stack SPA's with meteor.js
Through Meteor to the stars - Developing full-stack SPA's with meteor.jsWekoslav Stefanovski
 
Why and How You Should Move from PHP to Node.js
Why and How You Should Move from PHP to Node.jsWhy and How You Should Move from PHP to Node.js
Why and How You Should Move from PHP to Node.jsBrainhub
 
All Aboard The Stateful Train
All Aboard The Stateful TrainAll Aboard The Stateful Train
All Aboard The Stateful TrainSmartLogic
 
Campkde 2010: KDE Plasma netbook
Campkde 2010: KDE Plasma netbookCampkde 2010: KDE Plasma netbook
Campkde 2010: KDE Plasma netbookMarco Martin
 
JS digest. May 2017
JS digest. May 2017JS digest. May 2017
JS digest. May 2017ElifTech
 

What's hot (19)

The Professional Programmer
The Professional ProgrammerThe Professional Programmer
The Professional Programmer
 
Using Javascript in today's world
Using Javascript in today's worldUsing Javascript in today's world
Using Javascript in today's world
 
npm + browserify
npm + browserifynpm + browserify
npm + browserify
 
HH.JS - State of the Automation
HH.JS - State of the AutomationHH.JS - State of the Automation
HH.JS - State of the Automation
 
Writing native Linux desktop apps with JavaScript
Writing native Linux desktop apps with JavaScriptWriting native Linux desktop apps with JavaScript
Writing native Linux desktop apps with JavaScript
 
Instant LAMP Stack with Vagrant and Puppet
Instant LAMP Stack with Vagrant and PuppetInstant LAMP Stack with Vagrant and Puppet
Instant LAMP Stack with Vagrant and Puppet
 
Jaap : node, npm & grunt
Jaap : node, npm & gruntJaap : node, npm & grunt
Jaap : node, npm & grunt
 
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.js
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.jsThe MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.js
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.js
 
Work smart with Gutenberg - Fellyph Cintra
Work smart with Gutenberg - Fellyph CintraWork smart with Gutenberg - Fellyph Cintra
Work smart with Gutenberg - Fellyph Cintra
 
Vagrant + SaltStack + Django - Ararat Poghosyan - DM10
Vagrant + SaltStack + Django - Ararat Poghosyan - DM10Vagrant + SaltStack + Django - Ararat Poghosyan - DM10
Vagrant + SaltStack + Django - Ararat Poghosyan - DM10
 
Coding for the cloud - development of modern web applications
Coding for the cloud - development of modern web applicationsCoding for the cloud - development of modern web applications
Coding for the cloud - development of modern web applications
 
Through Meteor to the stars - Developing full-stack SPA's with meteor.js
Through Meteor to the stars - Developing full-stack SPA's with meteor.jsThrough Meteor to the stars - Developing full-stack SPA's with meteor.js
Through Meteor to the stars - Developing full-stack SPA's with meteor.js
 
Project Timbit
Project TimbitProject Timbit
Project Timbit
 
Node.js
Node.jsNode.js
Node.js
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
Why and How You Should Move from PHP to Node.js
Why and How You Should Move from PHP to Node.jsWhy and How You Should Move from PHP to Node.js
Why and How You Should Move from PHP to Node.js
 
All Aboard The Stateful Train
All Aboard The Stateful TrainAll Aboard The Stateful Train
All Aboard The Stateful Train
 
Campkde 2010: KDE Plasma netbook
Campkde 2010: KDE Plasma netbookCampkde 2010: KDE Plasma netbook
Campkde 2010: KDE Plasma netbook
 
JS digest. May 2017
JS digest. May 2017JS digest. May 2017
JS digest. May 2017
 

Viewers also liked

Lessons Learned with Unity and WebGL
Lessons Learned with Unity and WebGLLessons Learned with Unity and WebGL
Lessons Learned with Unity and WebGLLior Tal
 
An OzNome as Infrastructure Value Proposition
An OzNome as Infrastructure Value PropositionAn OzNome as Infrastructure Value Proposition
An OzNome as Infrastructure Value PropositionJonathan Yu
 
Cepss reprodutor humano
Cepss reprodutor humanoCepss reprodutor humano
Cepss reprodutor humanoLeonardo Souza
 
Prezi pixton - zuly andrea galeano
Prezi   pixton - zuly andrea galeanoPrezi   pixton - zuly andrea galeano
Prezi pixton - zuly andrea galeanoZagr Galeano
 
dosing pump cataloges
dosing pump catalogesdosing pump cataloges
dosing pump catalogesBharat Wagh
 
Domains in computer science
Domains in computer scienceDomains in computer science
Domains in computer scienceYash Bele
 
555555555555555555555555555
555555555555555555555555555555555555555555555555555555
555555555555555555555555555Juancho Mora
 
WESCML: A Data Standard for Exchanging Water and Energy Supply and Consumptio...
WESCML: A Data Standard for Exchanging Water and Energy Supply and Consumptio...WESCML: A Data Standard for Exchanging Water and Energy Supply and Consumptio...
WESCML: A Data Standard for Exchanging Water and Energy Supply and Consumptio...Jonathan Yu
 
Tipos de cables de red
Tipos de cables de redTipos de cables de red
Tipos de cables de redEdgar30697
 
Q3 2016 Myers Industries Inc. Earnings Presentation Final
Q3 2016 Myers Industries Inc. Earnings Presentation FinalQ3 2016 Myers Industries Inc. Earnings Presentation Final
Q3 2016 Myers Industries Inc. Earnings Presentation FinalMyers_Investors
 
Advanced Apache Spark Meetup Project Tungsten Nov 12 2015
Advanced Apache Spark Meetup Project Tungsten Nov 12 2015Advanced Apache Spark Meetup Project Tungsten Nov 12 2015
Advanced Apache Spark Meetup Project Tungsten Nov 12 2015Chris Fregly
 
Robot submarinos
Robot submarinosRobot submarinos
Robot submarinosJuan Markz
 

Viewers also liked (16)

Lessons Learned with Unity and WebGL
Lessons Learned with Unity and WebGLLessons Learned with Unity and WebGL
Lessons Learned with Unity and WebGL
 
An OzNome as Infrastructure Value Proposition
An OzNome as Infrastructure Value PropositionAn OzNome as Infrastructure Value Proposition
An OzNome as Infrastructure Value Proposition
 
Cepss reprodutor humano
Cepss reprodutor humanoCepss reprodutor humano
Cepss reprodutor humano
 
Prezi pixton - zuly andrea galeano
Prezi   pixton - zuly andrea galeanoPrezi   pixton - zuly andrea galeano
Prezi pixton - zuly andrea galeano
 
dosing pump cataloges
dosing pump catalogesdosing pump cataloges
dosing pump cataloges
 
Domains in computer science
Domains in computer scienceDomains in computer science
Domains in computer science
 
555555555555555555555555555
555555555555555555555555555555555555555555555555555555
555555555555555555555555555
 
Expanding
ExpandingExpanding
Expanding
 
Manipulation
ManipulationManipulation
Manipulation
 
WESCML: A Data Standard for Exchanging Water and Energy Supply and Consumptio...
WESCML: A Data Standard for Exchanging Water and Energy Supply and Consumptio...WESCML: A Data Standard for Exchanging Water and Energy Supply and Consumptio...
WESCML: A Data Standard for Exchanging Water and Energy Supply and Consumptio...
 
Presentasi prakarya
Presentasi prakaryaPresentasi prakarya
Presentasi prakarya
 
Text procedure
Text procedureText procedure
Text procedure
 
Tipos de cables de red
Tipos de cables de redTipos de cables de red
Tipos de cables de red
 
Q3 2016 Myers Industries Inc. Earnings Presentation Final
Q3 2016 Myers Industries Inc. Earnings Presentation FinalQ3 2016 Myers Industries Inc. Earnings Presentation Final
Q3 2016 Myers Industries Inc. Earnings Presentation Final
 
Advanced Apache Spark Meetup Project Tungsten Nov 12 2015
Advanced Apache Spark Meetup Project Tungsten Nov 12 2015Advanced Apache Spark Meetup Project Tungsten Nov 12 2015
Advanced Apache Spark Meetup Project Tungsten Nov 12 2015
 
Robot submarinos
Robot submarinosRobot submarinos
Robot submarinos
 

Similar to IntoWebGL - Unite Melbourne 2015

kranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High loadkranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High loadKrivoy Rog IT Community
 
JavascriptMVC: Another choice of web framework
JavascriptMVC: Another choice of web frameworkJavascriptMVC: Another choice of web framework
JavascriptMVC: Another choice of web frameworkAlive Kuo
 
Are app servers still fascinating
Are app servers still fascinatingAre app servers still fascinating
Are app servers still fascinatingAntonio Goncalves
 
Power of WebGL (FSTO 2014)
Power of WebGL (FSTO 2014)Power of WebGL (FSTO 2014)
Power of WebGL (FSTO 2014)Verold
 
Thinking cpu & memory - DroidCon Paris 18 june 2013
Thinking cpu & memory - DroidCon Paris 18 june 2013Thinking cpu & memory - DroidCon Paris 18 june 2013
Thinking cpu & memory - DroidCon Paris 18 june 2013Paris Android User Group
 
Performance optimization techniques for Java code
Performance optimization techniques for Java codePerformance optimization techniques for Java code
Performance optimization techniques for Java codeAttila Balazs
 
The Bleeding Edge
The Bleeding EdgeThe Bleeding Edge
The Bleeding EdgejClarity
 
Tools and libraries for common problems (Early Draft)
Tools and libraries for common problems (Early Draft)Tools and libraries for common problems (Early Draft)
Tools and libraries for common problems (Early Draft)rc2209
 
jQuery Conference Toronto
jQuery Conference TorontojQuery Conference Toronto
jQuery Conference Torontodmethvin
 
GWT - Building Rich Internet Applications Using OO Tools
GWT - Building Rich Internet Applications Using OO ToolsGWT - Building Rich Internet Applications Using OO Tools
GWT - Building Rich Internet Applications Using OO Toolsbarciszewski
 
PyGrunn2013 High Performance Web Applications with TurboGears
PyGrunn2013  High Performance Web Applications with TurboGearsPyGrunn2013  High Performance Web Applications with TurboGears
PyGrunn2013 High Performance Web Applications with TurboGearsAlessandro Molina
 
Electron JS | Build cross-platform desktop applications with web technologies
Electron JS | Build cross-platform desktop applications with web technologiesElectron JS | Build cross-platform desktop applications with web technologies
Electron JS | Build cross-platform desktop applications with web technologiesBethmi Gunasekara
 
Improving Game Performance in the Browser
Improving Game Performance in the BrowserImproving Game Performance in the Browser
Improving Game Performance in the BrowserFITC
 
Modern Messaging for Distributed Systems
Modern Messaging for Distributed SystemsModern Messaging for Distributed Systems
Modern Messaging for Distributed SystemsAndrea Rabbaglietti
 
Introduction google glass en - rev 20 - codemotion
Introduction google glass   en - rev 20 - codemotionIntroduction google glass   en - rev 20 - codemotion
Introduction google glass en - rev 20 - codemotionCodemotion
 
Educate 2017: Quick 'n Lazy: How we keep things speedy while staying out of y...
Educate 2017: Quick 'n Lazy: How we keep things speedy while staying out of y...Educate 2017: Quick 'n Lazy: How we keep things speedy while staying out of y...
Educate 2017: Quick 'n Lazy: How we keep things speedy while staying out of y...Learnosity
 
Castle Game Engine and the joy of making and using a custom game engine
Castle Game Engine and the joy  of making and using a custom game engineCastle Game Engine and the joy  of making and using a custom game engine
Castle Game Engine and the joy of making and using a custom game engineMichalis Kamburelis
 
Критика "библиотечного" подхода в разработке под Android. UA Mobile 2016.
Критика "библиотечного" подхода в разработке под Android. UA Mobile 2016.Критика "библиотечного" подхода в разработке под Android. UA Mobile 2016.
Критика "библиотечного" подхода в разработке под Android. UA Mobile 2016.UA Mobile
 
Utopia Kindgoms scaling case: From 4 to 50K users
Utopia Kindgoms scaling case: From 4 to 50K usersUtopia Kindgoms scaling case: From 4 to 50K users
Utopia Kindgoms scaling case: From 4 to 50K usersJaime Buelta
 

Similar to IntoWebGL - Unite Melbourne 2015 (20)

kranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High loadkranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High load
 
JavascriptMVC: Another choice of web framework
JavascriptMVC: Another choice of web frameworkJavascriptMVC: Another choice of web framework
JavascriptMVC: Another choice of web framework
 
Are app servers still fascinating
Are app servers still fascinatingAre app servers still fascinating
Are app servers still fascinating
 
Power of WebGL (FSTO 2014)
Power of WebGL (FSTO 2014)Power of WebGL (FSTO 2014)
Power of WebGL (FSTO 2014)
 
Thinking cpu & memory - DroidCon Paris 18 june 2013
Thinking cpu & memory - DroidCon Paris 18 june 2013Thinking cpu & memory - DroidCon Paris 18 june 2013
Thinking cpu & memory - DroidCon Paris 18 june 2013
 
Performance optimization techniques for Java code
Performance optimization techniques for Java codePerformance optimization techniques for Java code
Performance optimization techniques for Java code
 
The Bleeding Edge
The Bleeding EdgeThe Bleeding Edge
The Bleeding Edge
 
The Bleeding Edge
The Bleeding EdgeThe Bleeding Edge
The Bleeding Edge
 
Tools and libraries for common problems (Early Draft)
Tools and libraries for common problems (Early Draft)Tools and libraries for common problems (Early Draft)
Tools and libraries for common problems (Early Draft)
 
jQuery Conference Toronto
jQuery Conference TorontojQuery Conference Toronto
jQuery Conference Toronto
 
GWT - Building Rich Internet Applications Using OO Tools
GWT - Building Rich Internet Applications Using OO ToolsGWT - Building Rich Internet Applications Using OO Tools
GWT - Building Rich Internet Applications Using OO Tools
 
PyGrunn2013 High Performance Web Applications with TurboGears
PyGrunn2013  High Performance Web Applications with TurboGearsPyGrunn2013  High Performance Web Applications with TurboGears
PyGrunn2013 High Performance Web Applications with TurboGears
 
Electron JS | Build cross-platform desktop applications with web technologies
Electron JS | Build cross-platform desktop applications with web technologiesElectron JS | Build cross-platform desktop applications with web technologies
Electron JS | Build cross-platform desktop applications with web technologies
 
Improving Game Performance in the Browser
Improving Game Performance in the BrowserImproving Game Performance in the Browser
Improving Game Performance in the Browser
 
Modern Messaging for Distributed Systems
Modern Messaging for Distributed SystemsModern Messaging for Distributed Systems
Modern Messaging for Distributed Systems
 
Introduction google glass en - rev 20 - codemotion
Introduction google glass   en - rev 20 - codemotionIntroduction google glass   en - rev 20 - codemotion
Introduction google glass en - rev 20 - codemotion
 
Educate 2017: Quick 'n Lazy: How we keep things speedy while staying out of y...
Educate 2017: Quick 'n Lazy: How we keep things speedy while staying out of y...Educate 2017: Quick 'n Lazy: How we keep things speedy while staying out of y...
Educate 2017: Quick 'n Lazy: How we keep things speedy while staying out of y...
 
Castle Game Engine and the joy of making and using a custom game engine
Castle Game Engine and the joy  of making and using a custom game engineCastle Game Engine and the joy  of making and using a custom game engine
Castle Game Engine and the joy of making and using a custom game engine
 
Критика "библиотечного" подхода в разработке под Android. UA Mobile 2016.
Критика "библиотечного" подхода в разработке под Android. UA Mobile 2016.Критика "библиотечного" подхода в разработке под Android. UA Mobile 2016.
Критика "библиотечного" подхода в разработке под Android. UA Mobile 2016.
 
Utopia Kindgoms scaling case: From 4 to 50K users
Utopia Kindgoms scaling case: From 4 to 50K usersUtopia Kindgoms scaling case: From 4 to 50K users
Utopia Kindgoms scaling case: From 4 to 50K users
 

Recently uploaded

Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...masabamasaba
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...masabamasaba
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Hararemasabamasaba
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburgmasabamasaba
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is insideshinachiaurasa2
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfonteinmasabamasaba
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024VictoriaMetrics
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Bert Jan Schrijver
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2
 

Recently uploaded (20)

Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 

IntoWebGL - Unite Melbourne 2015

  • 1. IntoWebGL: A postmortem of porting to a post-plugin existence
  • 4.
  • 5.
  • 6. IntoScience is large ● 124 unique activities mapped to curriculum. ● 6 interactive 3D environments. ● 38 ‘quests’ (including multi-part, ambience & portals) ● Multiplayer live science quiz. ● Always on-line. ● Teacher control over student navigation. ● Reporting ● And much more!
  • 7. IntoScience is Cross-Platform ● WebPlayer ● iPad ● Standalone (Windows & Mac) ● Windows App Store ● Working Android prototype ● And now… WebGL!
  • 8. Our customers are schools ● Slow networks ● Slow machines ● Restrictive firewalls / proxies ● Limited IT support
  • 9. Basically, IntoScience is rather ambitious ● Small team (<15 people) ● Lots of 3rd party Assets from the Asset Store ○ NGUI ○ AStar pathfinding ○ Marmoset ○ Json utils ○ Tween utils ○ Playmaker ○ Mega-Fiers ○ ...and many more ● Lots of Playmaker driven content (eep) ● So the LEAST likely app to be able to port smoothly into a new platform like WebGL
  • 12.
  • 13. Why WebGL? ● Chrome were the first to move away from the old plugin structures. ● There is no Chrome without using WebGL ● Chrome is 46.1% of our browser users (28% of all platforms) ● No choice but to support it if we want to keep using Unity (we do!) ● Google has forced our hand in the short term ● In the long term everyone will need to use it anyway because… ● No plugin! ○ Makes it a lot easier to deploy to schools ○ Easier to release new versions
  • 14. WebPlayer is dead ● The rest of the vendors will soon be following the same path as Chrome ● WebPlayer won’t exist in Unity 5.4 ● Reality is WebPlayer is already gone. You should already be using WebGL. ● The problem?
  • 15. WebGL is still a ‘Preview’ ● Not quite there yet… but close! ● Clearly a work in progress. ● Must be treated as an entirely new platform ● Many missing features ● Critical bugs from all sides ● BUT!! It’s still possible to get something working
  • 16.
  • 17. IntoScience on WebGL Current stats ● Initial download of 21Mb of compressed data and javascript. ● After the initial download the results should be cached. ● But still have to compile the javascript every time. ● About 10 seconds load time on an i7 with fast internet. (after initial load) ● 5 to 6 minutes initial load time on a slow chromebook ● 1 to 2 minutes on subsequent loads.
  • 18. IntoScience on WebGL First release (Google September deadline) ● Had problems with memory ● Tended to crash if re-loading the page. ● 3D scene performance was poor.
  • 19. IntoScience on WebGL Second Release (World Education Games) ● Lots and lots of students (800,000) ● Scary ● Solved the problem with the memory and stability ● Improved 3D performance.
  • 21. What went right? ● Released on time. ● Multiple releases in short period of time. ● Most of the content ‘just worked’ ● Unity managed to fix the most critical issues before the deadline. ● Still sharing the codebase between all our platforms. ● Content team didn’t have to worry about the WebGL differences. ● Now have a plugin free environment.
  • 22. The Bad Stuff or: Tips and Tricks to Avoid The Bomb
  • 23. What went wrong? ● Being on the bleeding edge of Unity releases is problematic. ● Bug fixing ‘whack-a-mole’ ● WebGL was/is ‘coming in hot’ which means we were too. ● Cache fun. ○ Always be clearing ○ Require production asset versioning. ● Some audio assets crash on import. ● Lots of memory issues ● Lots of performance issues
  • 24. WebGL performance ● WebGL is super hard to profile accurately. Very unstable at the moment. ○ To profile memory, start with the profiler turned off. Switch it on and take a memory snapshot before it crashes. ○ Don’t profile memory usage in the editor game window. ○ Luckily, framerate profiling in the editor is almost accurate enough to point you in the right directions. ○ CPU will pretty much always be the problem at the moment ○ Reduce draw calls as much as possible ○ Make sure your scripts are optimised. ● Framerate of WebGL is about half of WebPlayer for the same scene. ● Using asset bundles turns off static batching. Manually recombine with StaticBatchingUtility.Combine(..)
  • 25. Cross-Origin Resource Sharing (CORS) ● CORS! ● WebGL requires CORS headers for all the www calls you make. ● This means you have tell your webserver to add them. ● http://enable-cors.org/server_apache.html ● There are no movie textures in webgl. Use the WebGLMovieTexture plugin. ● Add video.crossOrigin = “anonymous”; to the .jslib file
  • 26. Our WebGL App Goals ● Smallest possible initial download. ● Bundle/Stream everything. ● Minimise wait time with scaling asset detail levels. ● Avoid third party plugins! ● Remove all exceptions (not easy). ● Generally try to reduce codebase size.
  • 27. Asset Bundles ● “chunk” your asset bundles as much as possible. ○ Promotes better caching. ○ More flexible detail level scaling. ○ Make sure to AssetBundle.Unload(..) asap. ○ Only load/unload one bundle at a time. ○ Download one asset at a time.
  • 28. Asset Bundles ● Regularly sanity check asset bundle contents. ● Don’t use the old asset bundle system. (bugs) ● Use crunched texture compression for everything. ● Compress all your meshes as much as you can.
  • 29. Code Stripping and Asset Bundles ● Use namespaces to fix stripping problems. ● Brute force the rest. Find the errors and add to list. ○ Look for “Could not produce class with ID XXX” ○ http://docs.unity3d.com/Manual/ClassIDReference.html
  • 30. WebGL Memory ● Memory usage was one of the key limitations ● Try set your WebGL Memory Size to a max of 256 for stability. This can be hard. ● Turn off ‘Data Caching’ for now!! ● Recommend you don’t use www. LoadFromCacheOrDownload(..) for now!!
  • 32. WebGL Player Settings ● Our current Unity Player Settings
  • 33. Random Tips ● Use the chrome developer tools. (Ctrl + Shift + I) ● Don’t try inspect/debug the .js files! ● Chrome can throttle bandwidth now. Useful for testing for clients with poor internet. ● Use the .jslib plugins for unity->javascript communications. ● Setup a local Apache server to test your stuff. I use XAMPP.
  • 34. Random Tips ● For too long we didn’t have a backspace key!! ● Here’s useful snippet for the HTML wrapper: (Backspace and ESC blocking)
  • 35. TIP: Testing Webgl Apps ● Unity dev may not have experienced a lot of these issues before. ● Maintain a local web server. ● Modify local hosts file to allow cross-domain fakery. ● e.g. Add: ○ 127.0.0.1 mydomain.com ○ This will let me access my local server via http: //mydomain.com and test the CORS setup.
  • 37. The Future ● Multiple vendors working on making WebGL better. ● New technology coming to improve WebGL/javascript performance ○ WebAssembly - faster, smaller download/compile times ○ SIMD.js - faster math stuff ○ Shared Array Buffers - threading ○ Unity tools for code stripping. ● Stick with it! Things will constantly improve!
  • 38.