SlideShare une entreprise Scribd logo
1  sur  60
MARCO PARENZAN
Scrivere retrogames per
il web e aggiungerci
qualcosa di nuovo con
Azure e il cloud
WPC2018 1
I’m not a game developer
Less than an indie...
VERY long lasting projects! 
...it means «unfinished»!
«...Azure and the Cloud...»:
a nice apologize for
retrogaming WAF factor
Wife Acceptance Factor (WAF)• Wikipedia: https://en.wikipedia.org/wiki/Wife_acceptance_factor
• Scott Hanselman: https://www.hanselman.com/blog/TheStateOfMyDigitalMedia.aspx
Retrogaming is just a scenario
Objective: some takeaways,
some failures, some fun with
some Azure Services
Agenda
• Retro Fan
• Recreating the original game on a PC
• Identity for Serverless
• Connecting with websocket and
(Azure) SignalR
• Serverless container....what?
WPC2018
6
Retro Fan
Retro recovery from the dump (or garage)
(re)Making it with Arduino
And then?
MAKE IT AS A GAME ON A PC...
Recreating the original game on
a PC
Make it different...and new!
• Make it move in 4 directions
• Then do something more, like adding shoots and obstacles like
arkanoid (not yet implemented)
• Play it on mobile phone (touch!)
• Perheaps playing it remotly
«Less than an indie means...»
• ...no money
• «I’d like to deploy to the cloud»
• ...serverless!!!
WPC2018 13
Azure Serverless application platform
• Serverless is not strictly a technology, but an approach
Javascript
• I like it
• Used Phaser, powerful, but....
• ....too many feature for old legacy games...
• ...and Phaser 3 required a rewrite...
• So finding something lighter
• Just abstraction to the canvas
• And sprite management
• Collisions and physics by myself
• Kontra!
• Implemented like the arduino version
• Playfield is like Physical screen, device oriented (simple and easy...remember somewhere next
in slides!)
• Entirely JS no server side logic
Building a Blob Storage centered Web App
• From simple web page to web app
• Delivering the app to users from Blob Storage
• Client side Javascript to enrich the web app
• Enhancing the Web App with AI and data services
• Cloud AI services for a better end user experience
• Serverless technologies for ease of deployment and scale
Static Website Support
• Static website hosting in Azure Storage
• Default document
• Custom error document
• Custom domain SSL support with Azure CDN
• During preview of static websites support in Azure Storage, select
"custom origin" from the "origin type" drop down menu to add your
storage web endpoint. In Azure Portal, you will need to do this from your
CDN Profile instead of directly in your storage account.
• Storage Explorer
• Invites using Functions as a Backend
DEMO
Take away
• Azure Storage Static WebSite
• Azure CDN
What I need now
• Using the same JS base to allow two person playing
remotely
• With remote players you need to notify/be notified
• No polling
• For you, as a player
• ...and someone needs to «move» the ball!
• Web Sockets!
• But before reaching players, you need to identify them!
Identity for Serverless...
Requirements
• All logic is hosted in javascript
• No server-side logic
• Remember ASP.NET Identity?
• How to support social identities without it?
• Use SaaS
• Azure Active Directory B2C
WPC2018 22
Azure Active Directory B2C
• Reach any user, on any platform
• Select from a set of built-in, self-service identity experiences
• Customize each pixel. It’s your brand, your HTML and CSS
• Scale to 100s of millions of user accounts
• Run on the same secure, highly available infrastructure that
powers O365 authentications
Production-ready MSAL
• SDK for gaining access to API protected by Microsoft identities
• Fully OSS, easy to use, full-featured, production-ready
• Works with Azure AD v2 (work & school accounts, personal accounts)
and B2C
• Available on
• .NET 4,5x, .NET Core, Xamarin (iOS, Android, UWP)
• iOS (ObjC/Swift)
• Android (Java)
• Javascript
DEMO
Take away
• Azure Storage Static WebSite
• Azure CDN
• Azure Active Directory B2C
Now what?
• Now it’s time to connected the two identified players
Connecting with websocket
and Azure SignalR
WebSockets vs SignalR Core
• For games, websockets as better as the raw protocol
• SignalR is a layer on top of websockets, that becomes one
of the protocols supported by SignalR
• But you need to implement a backend logic
• Ex ASP.NET Core SignalR
• So what?
WPC2018 29
Azure SignalR Service
• Fully managed service—without worrying about capacity
provisioning, scaling or managing connections
• Native ASP.NET Core SignalR development support
• New possibilities when integrating with other Azure services
• Available in growing global regions
Initial feature sets for Azure SignalR Service
  
Azure SignalR pricing (just to understand)
• It is not subsecond pricing, but it’s an optimal proposal
in a (almost) serverless design
Is everything fine?
WPC2018 33
Is everything fine?
• No...because from signalr you cannot send messages to
peers
• So you need something like the hub
• Argh! Asp.NET Core? App Services?
• Any possibility for Serverless??
SignalR is a new binding for Functions
• SignalRConnectionInfo to associate the identity and
connection endpoints
• SignalR attribute to send messages to individual users or
broadcast
• …*sigh*…no sending to hub ….*sigh*….
• Hope improvements in the future
• Let’s fall back to Functions
Invitation
• How connecting two players?
• Web Sockets are useful to create web.whatsapp.com like links
(QR codes are just ncoded urls for cameras!)
• So
• The first player generate the link (which contains his/her username,
registered on the SignalR hub)
• Send the link (example through message/FB)
• The second player click on the link
• The page send a welcome message to both players...and the game
begins)
What I wrote on the client side
• The ball logic
• It’s your responsibility to calculate boll position if ball goes to the
other side
• LeftSpeed.x>0
• RightSpeed.x<0
• Receive ball position and other player position
• ...the ball...if is coming to you
• ...still different coordinate issues exist...
DEMO
Take away
• Azure Storage Static WebSite
• Azure CDN
• Azure Active Directory B2C
• Azure SignalR
• Azure Functions
Peer-to-Peer WebSocket Solution
Performances
• Bad. Too slow (big roundtrip for two entities - ball and player)
• Functions too slow
• Too delay (not investigated too much...)
• I needed something more
• And another issue:
• What about different screen sizes?
What I need now
• I need to rewrite because of world coordinates
• But also I need to host server side logic for ball
Serverless container....what?
Server-side worker hosting
• I don’t want to use a VM
• No Web Jobs
• It should be time for containers
• But I don’t want IaaS
• It should be time for Service Fabric
• But I don’t want IaaS
• Mesh! Serverless containers and service fabric it’s good for me
• Pay per second
• No IaaS
Azure container ecosystem
IaaSPaaS
Azure services
SQL Database
Redis Cache
CosmosDB
And more!
Partner services
OpenShift
Pivotal Cloud
Foundry
Docker Enterprise
Edition
Mesosphere
DC/OS
Azure
Azure
Container
Registry
(ACR)
Service Broker
Azure Kubernetes
Service (AKS)
ACS
Engine
Batch
Azure Container
Instances (ACI)
Azure Virtual
Machines
Virtual Machine
Scale Sets
(VMSS)
Service Fabric
Virtual kubelet
App Service
Containers as the App Packaging Format
…
Azure Container Registry
Manage a Docker private registry as a first-class Azure resource
Use familiar, open-
source Docker CLI tools
Azure Container Registry
geo-replication
Manage images for all
types of containers
Azure Container Instances (ACI)
Containers as a primitive
billed per second
Secure applications with
hypervisor isolation
Run containers
without managing
servers
Service Fabric Mesh
Dedicated Azure clusters
Service Fabric
Cluster
Bring your own infrastructure
Service Fabric
Standalone
On-premisesAny cloud
Dev machine
Dedicated
Service Fabric
Mesh
Fully managed by Azure
Serverless
What I wrote on the backend
• Game class which implements the game itself
• World class with 0..1 coordinates for Game
• Ball, Paddle classes which lives in World-sized game
• GameHub that communicates from/to clients through
websocket
• Game that runs the game loop and send ball movements to
users and receive users positions
What I wrote on the client side
• No more ball logic
• Only send your position
• Receive ball position and other player position
• All in world coordinate: each client had to scale to physical
as the current size
• (no dynamic resizing yet)
DEMO
Take away
• Azure Storage Static WebSite
• Azure CDN
• Azure Active Directory B2C
• Azure SignalR
• Azure Functions
• Azure Container Registry
• Azure Container Instances
• Azure Service Fabric Mesh
Conclusions
What I have learned
• Distributed/cloud need abstraction from the physicalWorld
• Containers are great if serverless!!!!
• Nice to have an out-of-the-box solution scaling out web
socket
Costs
• I haven’t done any cost analysis
• Is serveless feasible with all these amount of messages and
interaction?
• ...click...
Take away...just for a very simple game!!!
• Azure Storage Static WebSite
• Azure CDN
• Azure Active Directory B2C
• Azure SignalR
• Azure Functions
• Azure Container Registry
• Azure Container Instances
• Azure Service Fabric Mesh
...and make more fun with
retrogaming!
@MARCO_PARENZAN
https://github.com/marcoparenzan/webotronic
THE CODE
Q&A • Domande e risposte
WPC2018
59
Contatti
• OverNet Education
• Info@OverNetEducation.it
• www.OverNetEducation.it
• Rozzano (MI)+39 02 365738
• Bologna +39 051 269911
• www.wpc-overneteducation.it
ROZZANO (MI)
BOLOGNA
ROMA
GENOVA
TORINO
NAPOLI
WPC2018
60

Contenu connexe

Tendances

Using Windows Azure for Solving Identity Management Challenges
Using Windows Azure for Solving Identity Management ChallengesUsing Windows Azure for Solving Identity Management Challenges
Using Windows Azure for Solving Identity Management Challenges
Michael Collier
 
Cloud and Windows Azure
Cloud and Windows AzureCloud and Windows Azure
Cloud and Windows Azure
Radu Vunvulea
 
What's New for the Windows Azure Developer? Lots! (July 2013)
What's New for the Windows Azure Developer?  Lots! (July 2013)What's New for the Windows Azure Developer?  Lots! (July 2013)
What's New for the Windows Azure Developer? Lots! (July 2013)
Michael Collier
 
Stefan stolniceanu spritekit, 2 d or not 2d
Stefan stolniceanu   spritekit, 2 d or not 2dStefan stolniceanu   spritekit, 2 d or not 2d
Stefan stolniceanu spritekit, 2 d or not 2d
Codecamp Romania
 

Tendances (20)

Using Windows Azure for Solving Identity Management Challenges
Using Windows Azure for Solving Identity Management ChallengesUsing Windows Azure for Solving Identity Management Challenges
Using Windows Azure for Solving Identity Management Challenges
 
OGDC2012 A Practical Architecture Design For MMO Casual Game_Mr. An, Ngo Thai
OGDC2012 A Practical Architecture Design For MMO Casual Game_Mr. An, Ngo ThaiOGDC2012 A Practical Architecture Design For MMO Casual Game_Mr. An, Ngo Thai
OGDC2012 A Practical Architecture Design For MMO Casual Game_Mr. An, Ngo Thai
 
Windows Azure for Developers - Service Management
Windows Azure for Developers - Service ManagementWindows Azure for Developers - Service Management
Windows Azure for Developers - Service Management
 
Mobile Game Architectures on AWS (MBL201) | AWS re:Invent 2013
Mobile Game Architectures on AWS (MBL201) | AWS re:Invent 2013Mobile Game Architectures on AWS (MBL201) | AWS re:Invent 2013
Mobile Game Architectures on AWS (MBL201) | AWS re:Invent 2013
 
Using Packer to Migrate XenServer Infrastructure to CloudStack
Using Packer to Migrate XenServer Infrastructure to CloudStackUsing Packer to Migrate XenServer Infrastructure to CloudStack
Using Packer to Migrate XenServer Infrastructure to CloudStack
 
Cloud and Windows Azure
Cloud and Windows AzureCloud and Windows Azure
Cloud and Windows Azure
 
IaaS azure_vs_amazon
IaaS azure_vs_amazonIaaS azure_vs_amazon
IaaS azure_vs_amazon
 
A simple and powerful property system for C++ (talk at GCDC 2008, Leipzig)
A simple and powerful property system for C++ (talk at GCDC 2008, Leipzig)   A simple and powerful property system for C++ (talk at GCDC 2008, Leipzig)
A simple and powerful property system for C++ (talk at GCDC 2008, Leipzig)
 
User Transparent Service Migration to the Cloud
User Transparent Service Migration to the CloudUser Transparent Service Migration to the Cloud
User Transparent Service Migration to the Cloud
 
iOS5 开发新特性
iOS5 开发新特性iOS5 开发新特性
iOS5 开发新特性
 
Deterministic Simulation - What modern online games can learn from the Game B...
Deterministic Simulation - What modern online games can learn from the Game B...Deterministic Simulation - What modern online games can learn from the Game B...
Deterministic Simulation - What modern online games can learn from the Game B...
 
What's New for the Windows Azure Developer? Lots! (July 2013)
What's New for the Windows Azure Developer?  Lots! (July 2013)What's New for the Windows Azure Developer?  Lots! (July 2013)
What's New for the Windows Azure Developer? Lots! (July 2013)
 
From Ruby on Rails to RubyMotion - Writing your First iOS App with RubyMotion
From Ruby on Rails to RubyMotion - Writing your First iOS App with RubyMotionFrom Ruby on Rails to RubyMotion - Writing your First iOS App with RubyMotion
From Ruby on Rails to RubyMotion - Writing your First iOS App with RubyMotion
 
Running an openstack instance
Running an openstack instanceRunning an openstack instance
Running an openstack instance
 
Back to the 90s' - Revenge of the static website
Back to the 90s' - Revenge of the static websiteBack to the 90s' - Revenge of the static website
Back to the 90s' - Revenge of the static website
 
Using Windows Azure with your on-premise infrastructure
Using Windows Azure with your on-premise infrastructureUsing Windows Azure with your on-premise infrastructure
Using Windows Azure with your on-premise infrastructure
 
Rails as iOS Application Backend
Rails as iOS Application BackendRails as iOS Application Backend
Rails as iOS Application Backend
 
Citrix with Microsoft EMS
Citrix with Microsoft EMSCitrix with Microsoft EMS
Citrix with Microsoft EMS
 
Backup and Restore SQL Server Databases in Microsoft Azure
Backup and Restore SQL Server Databases in Microsoft AzureBackup and Restore SQL Server Databases in Microsoft Azure
Backup and Restore SQL Server Databases in Microsoft Azure
 
Stefan stolniceanu spritekit, 2 d or not 2d
Stefan stolniceanu   spritekit, 2 d or not 2dStefan stolniceanu   spritekit, 2 d or not 2d
Stefan stolniceanu spritekit, 2 d or not 2d
 

Similaire à Write retrogames in the web and add something more with Azure

Visug: Say Hello to my little friend: a session on Kinect
Visug: Say Hello to my little friend: a session on KinectVisug: Say Hello to my little friend: a session on Kinect
Visug: Say Hello to my little friend: a session on Kinect
Visug
 

Similaire à Write retrogames in the web and add something more with Azure (20)

Christian Corsano, Io Interactive
Christian Corsano, Io InteractiveChristian Corsano, Io Interactive
Christian Corsano, Io Interactive
 
Martin Simecek, Microsoft
Martin Simecek, Microsoft	Martin Simecek, Microsoft
Martin Simecek, Microsoft
 
Breaking through silos - From multi to true crossplatform using the cloud
Breaking through silos - From multi to true crossplatform using the cloudBreaking through silos - From multi to true crossplatform using the cloud
Breaking through silos - From multi to true crossplatform using the cloud
 
Deep Dive: Amazon Lumberyard & Amazon GameLift
Deep Dive: Amazon Lumberyard & Amazon GameLiftDeep Dive: Amazon Lumberyard & Amazon GameLift
Deep Dive: Amazon Lumberyard & Amazon GameLift
 
Game Programming - Cloud Development
Game Programming - Cloud DevelopmentGame Programming - Cloud Development
Game Programming - Cloud Development
 
[KGC 2012] Online Game Server Architecture Case Study Performance and Security
[KGC 2012] Online Game Server Architecture Case Study Performance and Security[KGC 2012] Online Game Server Architecture Case Study Performance and Security
[KGC 2012] Online Game Server Architecture Case Study Performance and Security
 
Sitecore 8.2 Update 1 on Azure Web Apps
Sitecore 8.2 Update 1 on Azure Web AppsSitecore 8.2 Update 1 on Azure Web Apps
Sitecore 8.2 Update 1 on Azure Web Apps
 
W3C HTML5 KIG-The complete guide to building html5 games
W3C HTML5 KIG-The complete guide to building html5 gamesW3C HTML5 KIG-The complete guide to building html5 games
W3C HTML5 KIG-The complete guide to building html5 games
 
Server 2016 sneak peek
Server 2016 sneak peekServer 2016 sneak peek
Server 2016 sneak peek
 
Tokyo Azure Meetup #4 - Build 2016 Overview
Tokyo Azure Meetup #4 -  Build 2016 OverviewTokyo Azure Meetup #4 -  Build 2016 Overview
Tokyo Azure Meetup #4 - Build 2016 Overview
 
IEEE VR-SEARIS 2014 Keynote - MiddleVR - Philosophy and architecture
IEEE VR-SEARIS 2014 Keynote - MiddleVR - Philosophy and architectureIEEE VR-SEARIS 2014 Keynote - MiddleVR - Philosophy and architecture
IEEE VR-SEARIS 2014 Keynote - MiddleVR - Philosophy and architecture
 
Programming Language Final PPT
Programming Language Final PPTProgramming Language Final PPT
Programming Language Final PPT
 
(GAM404) Hunting Monsters in a Low-Latency Multiplayer Game on EC2
(GAM404) Hunting Monsters in a Low-Latency Multiplayer Game on EC2(GAM404) Hunting Monsters in a Low-Latency Multiplayer Game on EC2
(GAM404) Hunting Monsters in a Low-Latency Multiplayer Game on EC2
 
Dev day serverless from a devs perspective
Dev day   serverless from a devs perspectiveDev day   serverless from a devs perspective
Dev day serverless from a devs perspective
 
Game development -session on unity 3d
Game development -session on unity 3d Game development -session on unity 3d
Game development -session on unity 3d
 
Twitch-ready 3D-Games with Amazon Lumberyard and GameLift
Twitch-ready 3D-Games with Amazon Lumberyard and GameLiftTwitch-ready 3D-Games with Amazon Lumberyard and GameLift
Twitch-ready 3D-Games with Amazon Lumberyard and GameLift
 
Windows Azure
Windows AzureWindows Azure
Windows Azure
 
Designing a pragmatic back-end service for mobile games
Designing a pragmatic back-end service for mobile gamesDesigning a pragmatic back-end service for mobile games
Designing a pragmatic back-end service for mobile games
 
AWS re:Invent 2016| GAM303 | Develop Games Using Lumberyard and Leverage AWS ...
AWS re:Invent 2016| GAM303 | Develop Games Using Lumberyard and Leverage AWS ...AWS re:Invent 2016| GAM303 | Develop Games Using Lumberyard and Leverage AWS ...
AWS re:Invent 2016| GAM303 | Develop Games Using Lumberyard and Leverage AWS ...
 
Visug: Say Hello to my little friend: a session on Kinect
Visug: Say Hello to my little friend: a session on KinectVisug: Say Hello to my little friend: a session on Kinect
Visug: Say Hello to my little friend: a session on Kinect
 

Plus de Marco Parenzan

Plus de Marco Parenzan (20)

Azure IoT Central per lo SCADA engineer
Azure IoT Central per lo SCADA engineerAzure IoT Central per lo SCADA engineer
Azure IoT Central per lo SCADA engineer
 
Azure Hybrid @ Home
Azure Hybrid @ HomeAzure Hybrid @ Home
Azure Hybrid @ Home
 
Static abstract members nelle interfacce di C# 11 e dintorni di .NET 7.pptx
Static abstract members nelle interfacce di C# 11 e dintorni di .NET 7.pptxStatic abstract members nelle interfacce di C# 11 e dintorni di .NET 7.pptx
Static abstract members nelle interfacce di C# 11 e dintorni di .NET 7.pptx
 
Azure Synapse Analytics for your IoT Solutions
Azure Synapse Analytics for your IoT SolutionsAzure Synapse Analytics for your IoT Solutions
Azure Synapse Analytics for your IoT Solutions
 
Power BI Streaming Data Flow e Azure IoT Central
Power BI Streaming Data Flow e Azure IoT Central Power BI Streaming Data Flow e Azure IoT Central
Power BI Streaming Data Flow e Azure IoT Central
 
Power BI Streaming Data Flow e Azure IoT Central
Power BI Streaming Data Flow e Azure IoT CentralPower BI Streaming Data Flow e Azure IoT Central
Power BI Streaming Data Flow e Azure IoT Central
 
Power BI Streaming Data Flow e Azure IoT Central
Power BI Streaming Data Flow e Azure IoT CentralPower BI Streaming Data Flow e Azure IoT Central
Power BI Streaming Data Flow e Azure IoT Central
 
Developing Actors in Azure with .net
Developing Actors in Azure with .netDeveloping Actors in Azure with .net
Developing Actors in Azure with .net
 
Math with .NET for you and Azure
Math with .NET for you and AzureMath with .NET for you and Azure
Math with .NET for you and Azure
 
Power BI data flow and Azure IoT Central
Power BI data flow and Azure IoT CentralPower BI data flow and Azure IoT Central
Power BI data flow and Azure IoT Central
 
.net for fun: write a Christmas videogame
.net for fun: write a Christmas videogame.net for fun: write a Christmas videogame
.net for fun: write a Christmas videogame
 
Building IoT infrastructure on edge with .net, Raspberry PI and ESP32 to conn...
Building IoT infrastructure on edge with .net, Raspberry PI and ESP32 to conn...Building IoT infrastructure on edge with .net, Raspberry PI and ESP32 to conn...
Building IoT infrastructure on edge with .net, Raspberry PI and ESP32 to conn...
 
Anomaly Detection with Azure and .NET
Anomaly Detection with Azure and .NETAnomaly Detection with Azure and .NET
Anomaly Detection with Azure and .NET
 
Deploy Microsoft Azure Data Solutions
Deploy Microsoft Azure Data SolutionsDeploy Microsoft Azure Data Solutions
Deploy Microsoft Azure Data Solutions
 
Deep Dive Time Series Anomaly Detection in Azure with dotnet
Deep Dive Time Series Anomaly Detection in Azure with dotnetDeep Dive Time Series Anomaly Detection in Azure with dotnet
Deep Dive Time Series Anomaly Detection in Azure with dotnet
 
Azure IoT Central
Azure IoT CentralAzure IoT Central
Azure IoT Central
 
Anomaly Detection with Azure and .net
Anomaly Detection with Azure and .netAnomaly Detection with Azure and .net
Anomaly Detection with Azure and .net
 
Code Generation for Azure with .net
Code Generation for Azure with .netCode Generation for Azure with .net
Code Generation for Azure with .net
 
Running Kafka and Spark on Raspberry PI with Azure and some .net magic
Running Kafka and Spark on Raspberry PI with Azure and some .net magicRunning Kafka and Spark on Raspberry PI with Azure and some .net magic
Running Kafka and Spark on Raspberry PI with Azure and some .net magic
 
Time Series Anomaly Detection with Azure and .NETT
Time Series Anomaly Detection with Azure and .NETTTime Series Anomaly Detection with Azure and .NETT
Time Series Anomaly Detection with Azure and .NETT
 

Dernier

introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 

Dernier (20)

A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
ManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide Deck
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
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
 
Pharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyPharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodology
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
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
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 

Write retrogames in the web and add something more with Azure

  • 1. MARCO PARENZAN Scrivere retrogames per il web e aggiungerci qualcosa di nuovo con Azure e il cloud WPC2018 1
  • 2. I’m not a game developer Less than an indie... VERY long lasting projects!  ...it means «unfinished»!
  • 3. «...Azure and the Cloud...»: a nice apologize for retrogaming WAF factor
  • 4. Wife Acceptance Factor (WAF)• Wikipedia: https://en.wikipedia.org/wiki/Wife_acceptance_factor • Scott Hanselman: https://www.hanselman.com/blog/TheStateOfMyDigitalMedia.aspx
  • 5. Retrogaming is just a scenario Objective: some takeaways, some failures, some fun with some Azure Services
  • 6. Agenda • Retro Fan • Recreating the original game on a PC • Identity for Serverless • Connecting with websocket and (Azure) SignalR • Serverless container....what? WPC2018 6
  • 8. Retro recovery from the dump (or garage)
  • 10. And then? MAKE IT AS A GAME ON A PC...
  • 11. Recreating the original game on a PC
  • 12. Make it different...and new! • Make it move in 4 directions • Then do something more, like adding shoots and obstacles like arkanoid (not yet implemented) • Play it on mobile phone (touch!) • Perheaps playing it remotly
  • 13. «Less than an indie means...» • ...no money • «I’d like to deploy to the cloud» • ...serverless!!! WPC2018 13
  • 14. Azure Serverless application platform • Serverless is not strictly a technology, but an approach
  • 15. Javascript • I like it • Used Phaser, powerful, but.... • ....too many feature for old legacy games... • ...and Phaser 3 required a rewrite... • So finding something lighter • Just abstraction to the canvas • And sprite management • Collisions and physics by myself • Kontra! • Implemented like the arduino version • Playfield is like Physical screen, device oriented (simple and easy...remember somewhere next in slides!) • Entirely JS no server side logic
  • 16. Building a Blob Storage centered Web App • From simple web page to web app • Delivering the app to users from Blob Storage • Client side Javascript to enrich the web app • Enhancing the Web App with AI and data services • Cloud AI services for a better end user experience • Serverless technologies for ease of deployment and scale
  • 17. Static Website Support • Static website hosting in Azure Storage • Default document • Custom error document • Custom domain SSL support with Azure CDN • During preview of static websites support in Azure Storage, select "custom origin" from the "origin type" drop down menu to add your storage web endpoint. In Azure Portal, you will need to do this from your CDN Profile instead of directly in your storage account. • Storage Explorer • Invites using Functions as a Backend
  • 18. DEMO
  • 19. Take away • Azure Storage Static WebSite • Azure CDN
  • 20. What I need now • Using the same JS base to allow two person playing remotely • With remote players you need to notify/be notified • No polling • For you, as a player • ...and someone needs to «move» the ball! • Web Sockets! • But before reaching players, you need to identify them!
  • 22. Requirements • All logic is hosted in javascript • No server-side logic • Remember ASP.NET Identity? • How to support social identities without it? • Use SaaS • Azure Active Directory B2C WPC2018 22
  • 23. Azure Active Directory B2C • Reach any user, on any platform • Select from a set of built-in, self-service identity experiences • Customize each pixel. It’s your brand, your HTML and CSS • Scale to 100s of millions of user accounts • Run on the same secure, highly available infrastructure that powers O365 authentications
  • 24. Production-ready MSAL • SDK for gaining access to API protected by Microsoft identities • Fully OSS, easy to use, full-featured, production-ready • Works with Azure AD v2 (work & school accounts, personal accounts) and B2C • Available on • .NET 4,5x, .NET Core, Xamarin (iOS, Android, UWP) • iOS (ObjC/Swift) • Android (Java) • Javascript
  • 25. DEMO
  • 26. Take away • Azure Storage Static WebSite • Azure CDN • Azure Active Directory B2C
  • 27. Now what? • Now it’s time to connected the two identified players
  • 29. WebSockets vs SignalR Core • For games, websockets as better as the raw protocol • SignalR is a layer on top of websockets, that becomes one of the protocols supported by SignalR • But you need to implement a backend logic • Ex ASP.NET Core SignalR • So what? WPC2018 29
  • 30. Azure SignalR Service • Fully managed service—without worrying about capacity provisioning, scaling or managing connections • Native ASP.NET Core SignalR development support • New possibilities when integrating with other Azure services • Available in growing global regions
  • 31. Initial feature sets for Azure SignalR Service   
  • 32. Azure SignalR pricing (just to understand) • It is not subsecond pricing, but it’s an optimal proposal in a (almost) serverless design
  • 34. Is everything fine? • No...because from signalr you cannot send messages to peers • So you need something like the hub • Argh! Asp.NET Core? App Services? • Any possibility for Serverless??
  • 35. SignalR is a new binding for Functions • SignalRConnectionInfo to associate the identity and connection endpoints • SignalR attribute to send messages to individual users or broadcast • …*sigh*…no sending to hub ….*sigh*…. • Hope improvements in the future • Let’s fall back to Functions
  • 36. Invitation • How connecting two players? • Web Sockets are useful to create web.whatsapp.com like links (QR codes are just ncoded urls for cameras!) • So • The first player generate the link (which contains his/her username, registered on the SignalR hub) • Send the link (example through message/FB) • The second player click on the link • The page send a welcome message to both players...and the game begins)
  • 37. What I wrote on the client side • The ball logic • It’s your responsibility to calculate boll position if ball goes to the other side • LeftSpeed.x>0 • RightSpeed.x<0 • Receive ball position and other player position • ...the ball...if is coming to you • ...still different coordinate issues exist...
  • 38. DEMO
  • 39. Take away • Azure Storage Static WebSite • Azure CDN • Azure Active Directory B2C • Azure SignalR • Azure Functions
  • 40. Peer-to-Peer WebSocket Solution Performances • Bad. Too slow (big roundtrip for two entities - ball and player) • Functions too slow • Too delay (not investigated too much...) • I needed something more • And another issue: • What about different screen sizes?
  • 41. What I need now • I need to rewrite because of world coordinates • But also I need to host server side logic for ball
  • 43. Server-side worker hosting • I don’t want to use a VM • No Web Jobs • It should be time for containers • But I don’t want IaaS • It should be time for Service Fabric • But I don’t want IaaS • Mesh! Serverless containers and service fabric it’s good for me • Pay per second • No IaaS
  • 44. Azure container ecosystem IaaSPaaS Azure services SQL Database Redis Cache CosmosDB And more! Partner services OpenShift Pivotal Cloud Foundry Docker Enterprise Edition Mesosphere DC/OS Azure Azure Container Registry (ACR) Service Broker Azure Kubernetes Service (AKS) ACS Engine Batch Azure Container Instances (ACI) Azure Virtual Machines Virtual Machine Scale Sets (VMSS) Service Fabric Virtual kubelet App Service
  • 45. Containers as the App Packaging Format …
  • 46. Azure Container Registry Manage a Docker private registry as a first-class Azure resource Use familiar, open- source Docker CLI tools Azure Container Registry geo-replication Manage images for all types of containers
  • 47. Azure Container Instances (ACI) Containers as a primitive billed per second Secure applications with hypervisor isolation Run containers without managing servers
  • 48. Service Fabric Mesh Dedicated Azure clusters Service Fabric Cluster Bring your own infrastructure Service Fabric Standalone On-premisesAny cloud Dev machine Dedicated Service Fabric Mesh Fully managed by Azure Serverless
  • 49. What I wrote on the backend • Game class which implements the game itself • World class with 0..1 coordinates for Game • Ball, Paddle classes which lives in World-sized game • GameHub that communicates from/to clients through websocket • Game that runs the game loop and send ball movements to users and receive users positions
  • 50. What I wrote on the client side • No more ball logic • Only send your position • Receive ball position and other player position • All in world coordinate: each client had to scale to physical as the current size • (no dynamic resizing yet)
  • 51. DEMO
  • 52. Take away • Azure Storage Static WebSite • Azure CDN • Azure Active Directory B2C • Azure SignalR • Azure Functions • Azure Container Registry • Azure Container Instances • Azure Service Fabric Mesh
  • 54. What I have learned • Distributed/cloud need abstraction from the physicalWorld • Containers are great if serverless!!!! • Nice to have an out-of-the-box solution scaling out web socket
  • 55. Costs • I haven’t done any cost analysis • Is serveless feasible with all these amount of messages and interaction? • ...click...
  • 56. Take away...just for a very simple game!!! • Azure Storage Static WebSite • Azure CDN • Azure Active Directory B2C • Azure SignalR • Azure Functions • Azure Container Registry • Azure Container Instances • Azure Service Fabric Mesh
  • 57. ...and make more fun with retrogaming! @MARCO_PARENZAN
  • 59. Q&A • Domande e risposte WPC2018 59
  • 60. Contatti • OverNet Education • Info@OverNetEducation.it • www.OverNetEducation.it • Rozzano (MI)+39 02 365738 • Bologna +39 051 269911 • www.wpc-overneteducation.it ROZZANO (MI) BOLOGNA ROMA GENOVA TORINO NAPOLI WPC2018 60