SlideShare a Scribd company logo
1 of 24
Browser Game Development with
           HTML5
       Chances and Pitfalls
Outline

Introduction
HTML 5
Developing with HTML and JavaScript
Showcases
Conclusion
Bytro Labs


Founded in 2009
Focus: browser based online games
Development and distribution
15 employees
2 mio. registered users
Completely independent
Bytro Labs Games

Supremacy 1914




                                Industrie Tycoon

PanzerWars



                       <HTML>
Goals:
  State of the art social browser game
  High quality graphics
  Massive number of objects rendered in real-time
  Graphical effects
     Animations
     Object Highlighting
     (Semi-) transparent Masking
  Low latency client server
  communication
  Easy access, good outreach
Outline

Introduction
HTML 5
Developing with HTML and JavaScript
Showcases
Conclusion
What is HTML 5

Collection of standards, extensions and technologies
New tags, JavaScript APIs and styling options
Plug-in less
Increasing hardware acceleration support (for graphics)
Standard(s) not finalized – “Living Standard”
HTML 5 Support




                                                        caniuse.com




                                            browser-statistik.de
- For older IE versions: Chrome Frame       25.09.2012 – Last 30 Days
HTML 5 in Topia Island


Canvas 2D
Web Sockets
CSS3
Web Storage

Planned
  Audio
  Web Worker
Outline

Introduction
HTML 5
Developing with HTML and JavaScript
Showcases
Conclusion
Client Server Architecture


    JavaScript                                        •   Visualization
                                                      •   User Interaction
                                      Client          •   Data Structures
                          client.js
             index.html                               •   Simulation Logic


                     Web Socket            Protocol: JSON


                                                     • Data Structures
Web Server                       Game Server         • Game Logic
              Java
                                                  Cassandra
                                                     DB
Developing with HTML and JavaScript


Client Server Code
  Keep Java and JavaScript data structures and code in sync
     Google Web Toolkit (GWT) – Everything in Java; JS cross-compiled
     note.js – Everything in JavaScript
     Strongly-Typed JavaScript (st-js) – Simple Java to JavaScript cross-compiler


JavaScript Code Structuring and Management
  Use supporting tools and libraries, e.g. require.js, Google Closure


JavaScript Tools Support
  Syntax highlighting and autocompleting can break easily
  Disciplined development (e.g. use Constructor / Prototype syntax,
  JSDoc type hints /** @type {string} */ var example; )
Developing with HTML and JavaScript


Backwards compatibility and Cross-Browser support
  Cross Browser libraries (e.g. jQuery)
  Polyfills


HTML GUI Development
  Missing WYSIWYG editor
      Code generation problem
  Application Suitability
      e.g. Multi-layer mouse listener problem


Future Development:
  Editors for HTML5 (e.g. Adobe Edge)
  HTML5 Libraries (e.g. CreateJS)
Outline

Introduction
HTML 5
Developing with HTML and JavaScript
Showcases
Conclusion
HTML 5 Laser Engine


Client


              Canvas 2D
mainloop
update();
render();
requestAnimationFrame();

                                   Web
                                  Storage
                      WebSocket
HTML 5 Laser Engine Showcases


Selection Bitmask
Highlight Outline
Transparent Masking
Animation
Selection Bitmask




Receive Image Data
Store Bitmask with JavaScript Bit Operations
                     imageData = canvasContext.getImageData(0, 0, image.width, image.height);
                     while(...) {
Selection Test                    ...
                                  pixelAlphaValue = imageData.data[(x + y * image.width) * 4 + 3];
                                  ...
   1. Bounding Box                if(pixelAlphaValue > threshold) {
                                              bitmask[byteIndex] |= (1 << bitIndex);
   2. Bitmask                     }
                                  ...
                     }
Highlight Outline




Setup / Init

offscreenCanvas = document.createElement('canvas');
offscreenCanvas.setAttribute('width', image.width);
offscreencanvas.setAttribute('height', image.height);
offscreenContext = offscreenCanvas.getContext('2d');
offscreenContext.drawImage(image, 0, 0);

imageData = offscreenContext.getImageData(0, 0, image.width, image.height);

while(...) {
               ...
               pixelAlphaValue = imageData.data[(x + y * image.width) * 4 + 3];
               ...
}

Draw Highlight
                                                                                        Vectorization
                                                                                  (Simplified potrace algorithm)
mainContext.beginPath();
mainContext.moveTo(point[0][0], point[0][1]);
while(...) {
             context.lineTo(point[i][0], point[i][1]);
}
context.stroke();
Transparent Masking




Draw Masked Sprite

maskBufferContext.clearRect(0, 0, spriteWidth, spriteHeight);

maskBufferContext.drawImage(spriteImage, 0, 0, spriteWidth, spriteHeight);

gradient = maskBufferContextctx.createRadialGradient(midX, midY, 0, midX, midY, spriteWidth/2);
gradient.addColorStop(0.2, 'white');
gradient.addColorStop(1, 'rgba(255,255,255,0)');
maskBufferContext.fillStyle = gradient;
maskBufferContext.globalCompositeOperation = 'destination-out';

maskBufferContext.beginPath();
maskBufferContext.arc(midX, midY, spriteWidth/2, 0, 360);
maskBufferContext.closePath();

maskBufferContext.fill();

mainContext.drawImage(maskBufferContext.canvas, spriteX, spriteY, spriteWidth, spriteHeight);
Animation




Sprite Animation
  drawImage(image, source rectangle, destination rectangle)


2D Animation
  2D Transformations
     Translate
     Scale
     Rotate
     Matrix Stack
Outline

Introduction
HTML 5
Developing with HTML and JavaScript
Showcases
Conclusion
Performance
    HTML5 Canvas 2D performance comparable with Flash and Java
    performance
    HW acceleration can not be presumed

Comparable Flash Game                       Topia Island
       ~13 FPS                                 ~18 FPS
Conclusion
   Browser Game Development with HTML5



Chances
   Browser Plug-in-less
   Increasing support
   High quality, high performance graphics


Pitfalls
   Large scale JavaScript undersupported
   Disciplined development required
   Different competing HTML5 technologies
Thank you!




www.topiaisland.com




   jobs@bytro.com

More Related Content

Viewers also liked

Systematic Bytes - profile
Systematic Bytes - profileSystematic Bytes - profile
Systematic Bytes - profileJawad Bokhari
 
Horror Ideas Moodboard
Horror Ideas MoodboardHorror Ideas Moodboard
Horror Ideas Moodboardmarrd005
 
Ejemplo entrega de análisis previo Estrategia de Neuromarketing Digital Avanti
Ejemplo entrega de análisis previo Estrategia de Neuromarketing Digital AvantiEjemplo entrega de análisis previo Estrategia de Neuromarketing Digital Avanti
Ejemplo entrega de análisis previo Estrategia de Neuromarketing Digital AvantiAlexander Montoya
 
Seminario n° 13 evaluación diente pilar y áreas edéntulas
Seminario n° 13   evaluación diente pilar y áreas edéntulasSeminario n° 13   evaluación diente pilar y áreas edéntulas
Seminario n° 13 evaluación diente pilar y áreas edéntulasSebastián Meneses
 
KB 1 Aspek Keuangan
KB 1 Aspek KeuanganKB 1 Aspek Keuangan
KB 1 Aspek Keuanganpjj_kemenkes
 
77 2015 linea di indirizzo “le modalità di collaborazione alla valutazion...
77   2015   linea di indirizzo “le modalità di collaborazione alla valutazion...77   2015   linea di indirizzo “le modalità di collaborazione alla valutazion...
77 2015 linea di indirizzo “le modalità di collaborazione alla valutazion...http://www.studioingvolpi.it
 
Premier Gold Corporate Presentation
Premier Gold Corporate PresentationPremier Gold Corporate Presentation
Premier Gold Corporate PresentationCompany Spotlight
 
Examen de admision unasam 2013 I
Examen de admision unasam 2013 IExamen de admision unasam 2013 I
Examen de admision unasam 2013 IJoe Arroyo Suárez
 
Lalo Huber - Calidad en servicios de TI
Lalo Huber - Calidad en servicios de TILalo Huber - Calidad en servicios de TI
Lalo Huber - Calidad en servicios de TILalo Huber
 
Packet light short1
Packet light short1Packet light short1
Packet light short1Kurt Rahrig
 
WoTSF: A Framework for Searching in the Web of Things (WoT)
WoTSF: A Framework for Searching in the Web of Things (WoT)WoTSF: A Framework for Searching in the Web of Things (WoT)
WoTSF: A Framework for Searching in the Web of Things (WoT)Mina Younan
 
Catálogo formación tecnicos otp 2012 ed 1 comprimido slideshare
Catálogo formación tecnicos otp 2012 ed 1 comprimido slideshareCatálogo formación tecnicos otp 2012 ed 1 comprimido slideshare
Catálogo formación tecnicos otp 2012 ed 1 comprimido slideshareGrupotp
 
Rehabilitacion tras cirugia de ligamento cruzado anterior
Rehabilitacion tras cirugia de ligamento cruzado anteriorRehabilitacion tras cirugia de ligamento cruzado anterior
Rehabilitacion tras cirugia de ligamento cruzado anteriorGuillermo Rodriguez Maruri
 

Viewers also liked (19)

Roberto Moya Clemente
Roberto Moya ClementeRoberto Moya Clemente
Roberto Moya Clemente
 
Systematic Bytes - profile
Systematic Bytes - profileSystematic Bytes - profile
Systematic Bytes - profile
 
Horror Ideas Moodboard
Horror Ideas MoodboardHorror Ideas Moodboard
Horror Ideas Moodboard
 
3 claves para logres tu libertad financiera
3 claves para logres tu libertad financiera 3 claves para logres tu libertad financiera
3 claves para logres tu libertad financiera
 
Ejemplo entrega de análisis previo Estrategia de Neuromarketing Digital Avanti
Ejemplo entrega de análisis previo Estrategia de Neuromarketing Digital AvantiEjemplo entrega de análisis previo Estrategia de Neuromarketing Digital Avanti
Ejemplo entrega de análisis previo Estrategia de Neuromarketing Digital Avanti
 
Seminario n° 13 evaluación diente pilar y áreas edéntulas
Seminario n° 13   evaluación diente pilar y áreas edéntulasSeminario n° 13   evaluación diente pilar y áreas edéntulas
Seminario n° 13 evaluación diente pilar y áreas edéntulas
 
KB 1 Aspek Keuangan
KB 1 Aspek KeuanganKB 1 Aspek Keuangan
KB 1 Aspek Keuangan
 
77 2015 linea di indirizzo “le modalità di collaborazione alla valutazion...
77   2015   linea di indirizzo “le modalità di collaborazione alla valutazion...77   2015   linea di indirizzo “le modalità di collaborazione alla valutazion...
77 2015 linea di indirizzo “le modalità di collaborazione alla valutazion...
 
Premier Gold Corporate Presentation
Premier Gold Corporate PresentationPremier Gold Corporate Presentation
Premier Gold Corporate Presentation
 
Examen de admision unasam 2013 I
Examen de admision unasam 2013 IExamen de admision unasam 2013 I
Examen de admision unasam 2013 I
 
Lalo Huber - Calidad en servicios de TI
Lalo Huber - Calidad en servicios de TILalo Huber - Calidad en servicios de TI
Lalo Huber - Calidad en servicios de TI
 
Packet light short1
Packet light short1Packet light short1
Packet light short1
 
Tema libre
Tema libreTema libre
Tema libre
 
luke-luobio_59_2016
luke-luobio_59_2016luke-luobio_59_2016
luke-luobio_59_2016
 
Vogue mediakit 2013
Vogue mediakit 2013Vogue mediakit 2013
Vogue mediakit 2013
 
WoTSF: A Framework for Searching in the Web of Things (WoT)
WoTSF: A Framework for Searching in the Web of Things (WoT)WoTSF: A Framework for Searching in the Web of Things (WoT)
WoTSF: A Framework for Searching in the Web of Things (WoT)
 
Catálogo formación tecnicos otp 2012 ed 1 comprimido slideshare
Catálogo formación tecnicos otp 2012 ed 1 comprimido slideshareCatálogo formación tecnicos otp 2012 ed 1 comprimido slideshare
Catálogo formación tecnicos otp 2012 ed 1 comprimido slideshare
 
Rehabilitacion tras cirugia de ligamento cruzado anterior
Rehabilitacion tras cirugia de ligamento cruzado anteriorRehabilitacion tras cirugia de ligamento cruzado anterior
Rehabilitacion tras cirugia de ligamento cruzado anterior
 
Taller de Blogger
Taller de BloggerTaller de Blogger
Taller de Blogger
 

Similar to HTML5 - Chances and Pitfalls (Bytro Labs GmbH)

Windows 8 Pure Imagination - 2012-11-24 - Getting your HTML5 game Windows 8 r...
Windows 8 Pure Imagination - 2012-11-24 - Getting your HTML5 game Windows 8 r...Windows 8 Pure Imagination - 2012-11-24 - Getting your HTML5 game Windows 8 r...
Windows 8 Pure Imagination - 2012-11-24 - Getting your HTML5 game Windows 8 r...Frédéric Harper
 
HTML5: An Overview
HTML5: An OverviewHTML5: An Overview
HTML5: An OverviewNagendra Um
 
An Introduction to Microsoft Edge
An Introduction to Microsoft EdgeAn Introduction to Microsoft Edge
An Introduction to Microsoft EdgeChris Love
 
JavaONE 2012 Using Java with HTML5 and CSS3
JavaONE 2012 Using Java with HTML5 and CSS3JavaONE 2012 Using Java with HTML5 and CSS3
JavaONE 2012 Using Java with HTML5 and CSS3Helder da Rocha
 
Windows8 lightningtalk
Windows8 lightningtalkWindows8 lightningtalk
Windows8 lightningtalkcarlspierre
 
Introduction to HTML5 & CSS3
Introduction to HTML5 & CSS3Introduction to HTML5 & CSS3
Introduction to HTML5 & CSS3Pravasini Sahoo
 
Building a Better Web with HTML5 and CSS3
Building a Better Web with HTML5 and CSS3Building a Better Web with HTML5 and CSS3
Building a Better Web with HTML5 and CSS3Karambir Singh Nain
 
Talk Paris Infovis 091207132953 Phpapp01(2)
Talk Paris Infovis 091207132953 Phpapp01(2)Talk Paris Infovis 091207132953 Phpapp01(2)
Talk Paris Infovis 091207132953 Phpapp01(2)johnnybiz
 
Using Web Standards to create Interactive Data Visualizations for the Web
Using Web Standards to create Interactive Data Visualizations for the WebUsing Web Standards to create Interactive Data Visualizations for the Web
Using Web Standards to create Interactive Data Visualizations for the Webphilogb
 
Building a game engine with jQuery
Building a game engine with jQueryBuilding a game engine with jQuery
Building a game engine with jQueryPaul Bakaus
 
Canvas in html5 - TungVD
Canvas in html5 - TungVDCanvas in html5 - TungVD
Canvas in html5 - TungVDFramgia Vietnam
 
Creating 3D Worlds with WebGL and Babylon.js - Codemotion.es
Creating 3D Worlds with WebGL and Babylon.js - Codemotion.esCreating 3D Worlds with WebGL and Babylon.js - Codemotion.es
Creating 3D Worlds with WebGL and Babylon.js - Codemotion.esdavrous
 
HTML5 Intoduction for Web Developers
HTML5 Intoduction for Web DevelopersHTML5 Intoduction for Web Developers
HTML5 Intoduction for Web DevelopersSascha Corti
 
qooxdoo - Open Source Ajax Framework
qooxdoo - Open Source Ajax Frameworkqooxdoo - Open Source Ajax Framework
qooxdoo - Open Source Ajax Frameworkecker
 
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5Sadaaki HIRAI
 

Similar to HTML5 - Chances and Pitfalls (Bytro Labs GmbH) (20)

Windows 8 Pure Imagination - 2012-11-24 - Getting your HTML5 game Windows 8 r...
Windows 8 Pure Imagination - 2012-11-24 - Getting your HTML5 game Windows 8 r...Windows 8 Pure Imagination - 2012-11-24 - Getting your HTML5 game Windows 8 r...
Windows 8 Pure Imagination - 2012-11-24 - Getting your HTML5 game Windows 8 r...
 
HTML5: An Overview
HTML5: An OverviewHTML5: An Overview
HTML5: An Overview
 
An Introduction to Microsoft Edge
An Introduction to Microsoft EdgeAn Introduction to Microsoft Edge
An Introduction to Microsoft Edge
 
What is HTML5
What is HTML5What is HTML5
What is HTML5
 
JavaONE 2012 Using Java with HTML5 and CSS3
JavaONE 2012 Using Java with HTML5 and CSS3JavaONE 2012 Using Java with HTML5 and CSS3
JavaONE 2012 Using Java with HTML5 and CSS3
 
Jsf2 html5-jazoon
Jsf2 html5-jazoonJsf2 html5-jazoon
Jsf2 html5-jazoon
 
Windows8 lightningtalk
Windows8 lightningtalkWindows8 lightningtalk
Windows8 lightningtalk
 
Introduction to HTML5 & CSS3
Introduction to HTML5 & CSS3Introduction to HTML5 & CSS3
Introduction to HTML5 & CSS3
 
Building a Better Web with HTML5 and CSS3
Building a Better Web with HTML5 and CSS3Building a Better Web with HTML5 and CSS3
Building a Better Web with HTML5 and CSS3
 
Talk Paris Infovis 091207132953 Phpapp01(2)
Talk Paris Infovis 091207132953 Phpapp01(2)Talk Paris Infovis 091207132953 Phpapp01(2)
Talk Paris Infovis 091207132953 Phpapp01(2)
 
Using Web Standards to create Interactive Data Visualizations for the Web
Using Web Standards to create Interactive Data Visualizations for the WebUsing Web Standards to create Interactive Data Visualizations for the Web
Using Web Standards to create Interactive Data Visualizations for the Web
 
HTML5 - A Whirlwind tour
HTML5 - A Whirlwind tourHTML5 - A Whirlwind tour
HTML5 - A Whirlwind tour
 
Building a game engine with jQuery
Building a game engine with jQueryBuilding a game engine with jQuery
Building a game engine with jQuery
 
Canvas in html5 - TungVD
Canvas in html5 - TungVDCanvas in html5 - TungVD
Canvas in html5 - TungVD
 
Creating 3D Worlds with WebGL and Babylon.js - Codemotion.es
Creating 3D Worlds with WebGL and Babylon.js - Codemotion.esCreating 3D Worlds with WebGL and Babylon.js - Codemotion.es
Creating 3D Worlds with WebGL and Babylon.js - Codemotion.es
 
HTML5 Intoduction for Web Developers
HTML5 Intoduction for Web DevelopersHTML5 Intoduction for Web Developers
HTML5 Intoduction for Web Developers
 
qooxdoo - Open Source Ajax Framework
qooxdoo - Open Source Ajax Frameworkqooxdoo - Open Source Ajax Framework
qooxdoo - Open Source Ajax Framework
 
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
 
Word camp nextweb
Word camp nextwebWord camp nextweb
Word camp nextweb
 
Word camp nextweb
Word camp nextwebWord camp nextweb
Word camp nextweb
 

Recently uploaded

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 

Recently uploaded (20)

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 

HTML5 - Chances and Pitfalls (Bytro Labs GmbH)

  • 1. Browser Game Development with HTML5 Chances and Pitfalls
  • 2. Outline Introduction HTML 5 Developing with HTML and JavaScript Showcases Conclusion
  • 3. Bytro Labs Founded in 2009 Focus: browser based online games Development and distribution 15 employees 2 mio. registered users Completely independent
  • 4. Bytro Labs Games Supremacy 1914 Industrie Tycoon PanzerWars <HTML>
  • 5. Goals: State of the art social browser game High quality graphics Massive number of objects rendered in real-time Graphical effects Animations Object Highlighting (Semi-) transparent Masking Low latency client server communication Easy access, good outreach
  • 6. Outline Introduction HTML 5 Developing with HTML and JavaScript Showcases Conclusion
  • 7. What is HTML 5 Collection of standards, extensions and technologies New tags, JavaScript APIs and styling options Plug-in less Increasing hardware acceleration support (for graphics) Standard(s) not finalized – “Living Standard”
  • 8. HTML 5 Support caniuse.com browser-statistik.de - For older IE versions: Chrome Frame 25.09.2012 – Last 30 Days
  • 9. HTML 5 in Topia Island Canvas 2D Web Sockets CSS3 Web Storage Planned Audio Web Worker
  • 10. Outline Introduction HTML 5 Developing with HTML and JavaScript Showcases Conclusion
  • 11. Client Server Architecture JavaScript • Visualization • User Interaction Client • Data Structures client.js index.html • Simulation Logic Web Socket Protocol: JSON • Data Structures Web Server Game Server • Game Logic Java Cassandra DB
  • 12. Developing with HTML and JavaScript Client Server Code Keep Java and JavaScript data structures and code in sync Google Web Toolkit (GWT) – Everything in Java; JS cross-compiled note.js – Everything in JavaScript Strongly-Typed JavaScript (st-js) – Simple Java to JavaScript cross-compiler JavaScript Code Structuring and Management Use supporting tools and libraries, e.g. require.js, Google Closure JavaScript Tools Support Syntax highlighting and autocompleting can break easily Disciplined development (e.g. use Constructor / Prototype syntax, JSDoc type hints /** @type {string} */ var example; )
  • 13. Developing with HTML and JavaScript Backwards compatibility and Cross-Browser support Cross Browser libraries (e.g. jQuery) Polyfills HTML GUI Development Missing WYSIWYG editor Code generation problem Application Suitability e.g. Multi-layer mouse listener problem Future Development: Editors for HTML5 (e.g. Adobe Edge) HTML5 Libraries (e.g. CreateJS)
  • 14. Outline Introduction HTML 5 Developing with HTML and JavaScript Showcases Conclusion
  • 15. HTML 5 Laser Engine Client Canvas 2D mainloop update(); render(); requestAnimationFrame(); Web Storage WebSocket
  • 16. HTML 5 Laser Engine Showcases Selection Bitmask Highlight Outline Transparent Masking Animation
  • 17. Selection Bitmask Receive Image Data Store Bitmask with JavaScript Bit Operations imageData = canvasContext.getImageData(0, 0, image.width, image.height); while(...) { Selection Test ... pixelAlphaValue = imageData.data[(x + y * image.width) * 4 + 3]; ... 1. Bounding Box if(pixelAlphaValue > threshold) { bitmask[byteIndex] |= (1 << bitIndex); 2. Bitmask } ... }
  • 18. Highlight Outline Setup / Init offscreenCanvas = document.createElement('canvas'); offscreenCanvas.setAttribute('width', image.width); offscreencanvas.setAttribute('height', image.height); offscreenContext = offscreenCanvas.getContext('2d'); offscreenContext.drawImage(image, 0, 0); imageData = offscreenContext.getImageData(0, 0, image.width, image.height); while(...) { ... pixelAlphaValue = imageData.data[(x + y * image.width) * 4 + 3]; ... } Draw Highlight Vectorization (Simplified potrace algorithm) mainContext.beginPath(); mainContext.moveTo(point[0][0], point[0][1]); while(...) { context.lineTo(point[i][0], point[i][1]); } context.stroke();
  • 19. Transparent Masking Draw Masked Sprite maskBufferContext.clearRect(0, 0, spriteWidth, spriteHeight); maskBufferContext.drawImage(spriteImage, 0, 0, spriteWidth, spriteHeight); gradient = maskBufferContextctx.createRadialGradient(midX, midY, 0, midX, midY, spriteWidth/2); gradient.addColorStop(0.2, 'white'); gradient.addColorStop(1, 'rgba(255,255,255,0)'); maskBufferContext.fillStyle = gradient; maskBufferContext.globalCompositeOperation = 'destination-out'; maskBufferContext.beginPath(); maskBufferContext.arc(midX, midY, spriteWidth/2, 0, 360); maskBufferContext.closePath(); maskBufferContext.fill(); mainContext.drawImage(maskBufferContext.canvas, spriteX, spriteY, spriteWidth, spriteHeight);
  • 20. Animation Sprite Animation drawImage(image, source rectangle, destination rectangle) 2D Animation 2D Transformations Translate Scale Rotate Matrix Stack
  • 21. Outline Introduction HTML 5 Developing with HTML and JavaScript Showcases Conclusion
  • 22. Performance HTML5 Canvas 2D performance comparable with Flash and Java performance HW acceleration can not be presumed Comparable Flash Game Topia Island ~13 FPS ~18 FPS
  • 23. Conclusion Browser Game Development with HTML5 Chances Browser Plug-in-less Increasing support High quality, high performance graphics Pitfalls Large scale JavaScript undersupported Disciplined development required Different competing HTML5 technologies