SlideShare una empresa de Scribd logo
1 de 42
Photon & Unity
Building Realtime Multiplayer Games
Part I: Introduction to Photon
Photon in a Nutshell

    •   Photon is a Socket Server & Framework
         –   Target: Realtime, Multiplayer, Cross Platform Games

    •   16k+ registered developers
         –   800 new devs every months and rising
         –   AAA customers: u4ia, Codemasters, Nival, Glu, ...
         –   Indies: CMUNE, Kogama, Bigbite, 3Sprockets, ...

    •   Transparent pricing, empower Indies
U4ia (= euphoria)




• Industry Veterans (Dusty Welch, Chris Archer & team)
• Free-to-play, AAA, Hardcore, Browser Based Games
• „The middleware that gave us the least headache ...“,
  Dan MacDonald, Lead Programmer
                                                          4
5
6
7
8
9
10
Photon Compared to „Social SDKs“


•   Leaderboards                  •   Matchmaking
•   Challenges                    •   Realtime gameplay
•
•
    Achievements
    Social Network Integr.   !=   •
                                  •
                                      Reliable UDP, TCP, Websockets
                                      FPS & MMO
•   News, Push                    •   Load Balancing
•   Gamestatesync

•   Payment                       vNEXT
•   Downloadable Content          • Least Ping Routing
•   Virtualgoods/-currency        • Private Clouds
•   Unlock                        • Custom Server Logic

•
•
    Cross platform
    Efficiency
                             =    •
                                  •
                                      iOS, Android, WP7, Unity, Flash, HTML5, ...
                                      „No fluff“
Unity Rules!




But we do more …
Type of Games

   •   Room based games (2-32 players)
        –   FPS, Racer, Casual Game
        –   Broadcast of Messages to all Players
        –   Framework: Lite, LiteLobby, Load Balancing
        –   U4ia: Offensive Combat, CMUNE: Überstrike,
            Codemasters: F1 Online, Kogama, ...


   •   MMO games
        –   Hundreds of People per Map/World/Region
        –   Interest Management
        –   Framework: MMO
        –   Innogames: Kartuga, FOX: Family Guy Online, ...
What Does it give You: Build vs Buy
What Does it give You: Build vs Buy
Rules of Thumb: CCU is Usually Overestimated

    •   CCU * 10 = DAU
    •   DAU * 10 = MAU
    •   MAU * x = Downloads (how many play connected?)


    •   100 CCU = 10,000 MAU
    •   1,000 CCU = 100,000 MAU


    •   Real World Sample (Mobile):
         –   4,000,000 downloads >> 3,000 CCU
Load Test: The Setup

    • Scenario
       – 25 rooms x 16 players = 400 CCU
       – 2 x 50 bytes reliable / s, 10 x 50 bytes unreliable / s

    • Server: Quad-Core, 8GB RAM, Win7 x64
       –   In: 4,500 msg/s (1,2 MB/s)
       –   Out: 65,000 msg/s (7.5 MB/s)
       –   CPU: ~30%
       –   NIC (100Mbit): 80% saturated
       –   Client RTT: ~40ms
Load Test: Traffic is the Cost Driver

    • Traffic (400CCU, per month)
       – Traffic = 8MB/s * 60 * 60 * 24 * 30 * 50% = ~10 TB


    • Cost
       –   Server Cost (HW, OS & traffic): $400
       –   Cost per CCU ~= $400/400CCU = $1
       –   400 CCU ~= 4,000 DAU ~= 40,000 MAU
       –   Cost per MAU ~= 1 Cent
Load Test: Realworld, our own Cloud

    •   Largest game has 13,000 CCUs
    •   800,000 msg/s (req, resp, ev)
    •   90 TB per month traffic
    •   40 Servers
        – US, Europe & Asia

    • Our „perfect“ Box
        – Single CPU, 4 Cores, 4GB RAM, 5TB traffic
    • Eat your own dogfood (deploy, stability, ops)
API/SDK Options

   • Plain APIs (full control)
       – Operation: Request/Response
       – Events: From the server

   • Photon Unity Networking (PUN)
       – API compatible to Unity Networking
       – Using Plain APIs under the hood
       – Get it in the Unity Asset Store

   • Playmaker (via PUN)
       – Using the PUN APIs
Photon Unity Networking (PUN)
• Unity Networking (UN) is very convenient, simple and
  powerful
• It is the entry point for most Indies to start Networking
  experiments

• BUT it has several major draw backs
   !   UN needs a Master Server to be hosted
   !   P2P leads to NAT/punch-through issues (especially in mobile
       networks)
   !   Dropped hosts kill the games and so frustrate players
   !   UN will (probably) never run on the new Unity exports Flash / Chrome
       NaCl
PUN Feature Coverage
Synchronization                            RPCs
2 Position, Rotation, Scale                2 From client to client
2 Serialization by script                  2 By method name
2 Buffered Instantiation
                                           2 Receiver selectable
- Animation
                                           2 Buffered

Grouping and Scope
- Not supported by server                  Callbacks
- Events are ignored accordingly           2 Player joins, leaves
                                           2 Connection states
Server Logic                               2 Instantiation
2 MasterClient replaces Host
(Remark: Photon is just used as „relay“)   Network Simulation
                                           2 Lag, Jitter, Loss
                                           - Bandwidth throtteling
Additional Features
Platform as a Service (PaaS)             Dashboard
+ No server installs with the Cloud      + See CCUs, Disconnects etc.
+ Transparent load balancing
                                         Host Transition
Properties (Rooms and Players)           + Remaining players select new
+ Key-Value collection for custom data   MasterClient
(name, etc.)
                                         Offline Mode
Runtime Scene GameObjects                + Same logic for offline gaming
+ Can be instantiated with owner
“scene“
Counters to Track Down Issues
              Overall:
              A peers disconnects every 2h (average)
              20k peers, 80msg/s per room, 800k msg/s



              Specific Game:
              A peers disconnects every 6-12min (average)

              Dig further in ...
Unite12 Announcement #1:


   • Cloud “forever free” plan
   • 20CCU
   • Unlimited apps
Unite12 Announcement #2:


   • Playmaker integration
   • Easy Unity Networking
Unite12 Announcement #3:


   For Indies
   • 1 Server: $99
   • 3 Server: $199
   Per title, unlimited CCUs
Part II: Photon Unite Networking (PUN)
                hands-on
Running a local Cloud

    •   Register and get app ID (cloud.exitgames.com)
    •   Download Photon Server
    •   Unpack it
    •   Run “MyCloud”
PUN Nuts & Bolts

   •   Lobby
       –   Matchmaking
       –   Properties can be synced

   •   Rooms
       –   Exchange data in realtime (text, positions ...)
       –   Set and get properties of Players and Rooms
Quick Usage Intro

    •   ConnectUsingSettings()
         –   US, EU or Asia

    •   Get from the Lobby into a Room quickly
         –   CreateRoom(), JoinRoom()

    •   Setup a Monster for network sync
         –   Add prefab
         –   Add PhotonView
         –   Add script for update
Properties & using them for Matchmaking

    •   Properties are a key-value storage for custom data
         –   Attached to Players or Rooms
         –   Sample: Attach the played map to a room (map=„Island“)

    •   Properties can be synced to the Lobby
         –   Synced properties are defined on creation
         –   Sample: Sync the map key-value to the Lobby

    •   JoinRandomRoom() can filter rooms by properties
         –   Pass in Hashtable of key-value pairs
         –   Sample: Match rooms with a certain map
Tips & Tricks: Loading a Level

    •   Two main Problems:
         –   Long loading time causes a timeout (update thread is not called)
         –   Updates getting lost during load (scene updates ...), e.g. objects do
             not exist yet



    •   Pause message queue and dispatch after load
         –   Creates a thread to keep connection alive

    •   Setting a prefix
         –   Detect quickly if message is for another level
Beyond PUN

   •   Operations, Responses and Events
   •   Calling operations
   •   Handling Events
   •   Event cache
Quality of Service (QoS)

    •   How to reduce messages
    •   How to read vital stats
Part III: References
39
40
41
42

Más contenido relacionado

La actualidad más candente

Amazon Web Services - An Overview
Amazon Web Services - An OverviewAmazon Web Services - An Overview
Amazon Web Services - An Overviewchregu
 
Solving Visibility and Streaming in The Witcher 3: Wild Hunt with Umbra 3
Solving Visibility and Streaming in The Witcher 3: Wild Hunt with Umbra 3Solving Visibility and Streaming in The Witcher 3: Wild Hunt with Umbra 3
Solving Visibility and Streaming in The Witcher 3: Wild Hunt with Umbra 3jasinb
 
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 ThaiBuff Nguyen
 
Building a minecraft server for a family using Auto Scaling Groups
Building a minecraft server for a family using Auto Scaling GroupsBuilding a minecraft server for a family using Auto Scaling Groups
Building a minecraft server for a family using Auto Scaling GroupsKazuhiro Ogura
 
OGDC2012 Lua In Game_Mr. Van, Nguyen Ngoc
OGDC2012 Lua In Game_Mr. Van, Nguyen NgocOGDC2012 Lua In Game_Mr. Van, Nguyen Ngoc
OGDC2012 Lua In Game_Mr. Van, Nguyen NgocBuff Nguyen
 
Multiplayer game with angular and firebase
Multiplayer game with angular and firebaseMultiplayer game with angular and firebase
Multiplayer game with angular and firebaseMichael Haberman
 
OGDC Datastorage Solution_Mr.Dung, Dinh Nguyen Anh
OGDC Datastorage Solution_Mr.Dung, Dinh Nguyen AnhOGDC Datastorage Solution_Mr.Dung, Dinh Nguyen Anh
OGDC Datastorage Solution_Mr.Dung, Dinh Nguyen AnhBuff Nguyen
 
Microsoft Azure Media Services
Microsoft Azure Media ServicesMicrosoft Azure Media Services
Microsoft Azure Media ServicesPavel Revenkov
 
Windows Azure Virtual Machines And Virtual Networks
Windows Azure Virtual Machines And Virtual NetworksWindows Azure Virtual Machines And Virtual Networks
Windows Azure Virtual Machines And Virtual NetworksKristof Rennen
 
Games with your head in the cloud
Games with your head in the cloudGames with your head in the cloud
Games with your head in the cloudJulien Ellie
 
Cluj.DevOps Meetup - Code your Infrastructure
Cluj.DevOps Meetup - Code your InfrastructureCluj.DevOps Meetup - Code your Infrastructure
Cluj.DevOps Meetup - Code your InfrastructureLiviu Damian
 
LocalSocial, Dial2Do and the Cloud
LocalSocial, Dial2Do and the CloudLocalSocial, Dial2Do and the Cloud
LocalSocial, Dial2Do and the CloudSean O'Sullivan
 
Server architecture & scaling strategy for a sports website
Server architecture & scaling strategy for a sports websiteServer architecture & scaling strategy for a sports website
Server architecture & scaling strategy for a sports websiteLeonidas Tsementzis
 
Albion Online - A Cross-Platform MMO (Unite Europe 2016, Amsterdam)
Albion Online - A Cross-Platform MMO (Unite Europe 2016, Amsterdam)Albion Online - A Cross-Platform MMO (Unite Europe 2016, Amsterdam)
Albion Online - A Cross-Platform MMO (Unite Europe 2016, Amsterdam)David Salz
 
Game Engine Architecture
Game Engine ArchitectureGame Engine Architecture
Game Engine ArchitectureAttila Jenei
 

La actualidad más candente (20)

Amazon Web Services - An Overview
Amazon Web Services - An OverviewAmazon Web Services - An Overview
Amazon Web Services - An Overview
 
Solving Visibility and Streaming in The Witcher 3: Wild Hunt with Umbra 3
Solving Visibility and Streaming in The Witcher 3: Wild Hunt with Umbra 3Solving Visibility and Streaming in The Witcher 3: Wild Hunt with Umbra 3
Solving Visibility and Streaming in The Witcher 3: Wild Hunt with Umbra 3
 
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
 
Building a minecraft server for a family using Auto Scaling Groups
Building a minecraft server for a family using Auto Scaling GroupsBuilding a minecraft server for a family using Auto Scaling Groups
Building a minecraft server for a family using Auto Scaling Groups
 
OGDC2012 Lua In Game_Mr. Van, Nguyen Ngoc
OGDC2012 Lua In Game_Mr. Van, Nguyen NgocOGDC2012 Lua In Game_Mr. Van, Nguyen Ngoc
OGDC2012 Lua In Game_Mr. Van, Nguyen Ngoc
 
Docker ppt
Docker pptDocker ppt
Docker ppt
 
Multiplayer game with angular and firebase
Multiplayer game with angular and firebaseMultiplayer game with angular and firebase
Multiplayer game with angular and firebase
 
OGDC Datastorage Solution_Mr.Dung, Dinh Nguyen Anh
OGDC Datastorage Solution_Mr.Dung, Dinh Nguyen AnhOGDC Datastorage Solution_Mr.Dung, Dinh Nguyen Anh
OGDC Datastorage Solution_Mr.Dung, Dinh Nguyen Anh
 
Microsoft Azure Media Services
Microsoft Azure Media ServicesMicrosoft Azure Media Services
Microsoft Azure Media Services
 
Windows Azure Virtual Machines And Virtual Networks
Windows Azure Virtual Machines And Virtual NetworksWindows Azure Virtual Machines And Virtual Networks
Windows Azure Virtual Machines And Virtual Networks
 
AWS KSS
AWS  KSSAWS  KSS
AWS KSS
 
Games with your head in the cloud
Games with your head in the cloudGames with your head in the cloud
Games with your head in the cloud
 
Amazon EC2
Amazon EC2Amazon EC2
Amazon EC2
 
Cluj.DevOps Meetup - Code your Infrastructure
Cluj.DevOps Meetup - Code your InfrastructureCluj.DevOps Meetup - Code your Infrastructure
Cluj.DevOps Meetup - Code your Infrastructure
 
LocalSocial, Dial2Do and the Cloud
LocalSocial, Dial2Do and the CloudLocalSocial, Dial2Do and the Cloud
LocalSocial, Dial2Do and the Cloud
 
Server architecture & scaling strategy for a sports website
Server architecture & scaling strategy for a sports websiteServer architecture & scaling strategy for a sports website
Server architecture & scaling strategy for a sports website
 
Albion Online - A Cross-Platform MMO (Unite Europe 2016, Amsterdam)
Albion Online - A Cross-Platform MMO (Unite Europe 2016, Amsterdam)Albion Online - A Cross-Platform MMO (Unite Europe 2016, Amsterdam)
Albion Online - A Cross-Platform MMO (Unite Europe 2016, Amsterdam)
 
Chugalug
ChugalugChugalug
Chugalug
 
Patch Maps
Patch MapsPatch Maps
Patch Maps
 
Game Engine Architecture
Game Engine ArchitectureGame Engine Architecture
Game Engine Architecture
 

Similar a Photon Session / Unite12 Conference

Massively Social != Massively Multiplayer
Massively Social != Massively MultiplayerMassively Social != Massively Multiplayer
Massively Social != Massively MultiplayerPaul Furio
 
Puppet at DemonWare - Ruaidhri Power - Puppetcamp Dublin '12
Puppet at DemonWare - Ruaidhri Power - Puppetcamp Dublin '12Puppet at DemonWare - Ruaidhri Power - Puppetcamp Dublin '12
Puppet at DemonWare - Ruaidhri Power - Puppetcamp Dublin '12Puppet
 
(GAM402) Turbine: A Microservice Approach to 3 Billion Game Requests
(GAM402) Turbine: A Microservice Approach to 3 Billion Game Requests(GAM402) Turbine: A Microservice Approach to 3 Billion Game Requests
(GAM402) Turbine: A Microservice Approach to 3 Billion Game RequestsAmazon Web Services
 
Albion Online - Software Architecture of an MMO (talk at Quo Vadis 2016, Berlin)
Albion Online - Software Architecture of an MMO (talk at Quo Vadis 2016, Berlin)Albion Online - Software Architecture of an MMO (talk at Quo Vadis 2016, Berlin)
Albion Online - Software Architecture of an MMO (talk at Quo Vadis 2016, Berlin)David Salz
 
Online games: a real-time problem for the network
Online games: a real-time problem for the networkOnline games: a real-time problem for the network
Online games: a real-time problem for the networkJose Saldana
 
Harlan Beverly Lag The Barrier to innovation gdc austin 2009
Harlan Beverly Lag The Barrier to innovation gdc austin 2009Harlan Beverly Lag The Barrier to innovation gdc austin 2009
Harlan Beverly Lag The Barrier to innovation gdc austin 2009Harlan Beverly
 
Harlan beverly gaming levels up networking ieee 10 2009
Harlan beverly gaming levels up networking ieee 10 2009Harlan beverly gaming levels up networking ieee 10 2009
Harlan beverly gaming levels up networking ieee 10 2009Harlan Beverly
 
Supersize Your Production Pipe
Supersize Your Production PipeSupersize Your Production Pipe
Supersize Your Production Pipeslantsixgames
 
GamingAnywhere: An Open Cloud Gaming System
GamingAnywhere: An Open Cloud Gaming SystemGamingAnywhere: An Open Cloud Gaming System
GamingAnywhere: An Open Cloud Gaming SystemAcademia Sinica
 
Building fast,scalable game server in node.js
Building fast,scalable game server in node.jsBuilding fast,scalable game server in node.js
Building fast,scalable game server in node.jsXie ChengChao
 
GDC 2015 - Low-latency Multiplayer Gaming with AWS
GDC 2015 - Low-latency Multiplayer Gaming with AWS GDC 2015 - Low-latency Multiplayer Gaming with AWS
GDC 2015 - Low-latency Multiplayer Gaming with AWS Nate Wiger
 
Supersize your production pipe enjmin 2013 v1.1 hd
Supersize your production pipe    enjmin 2013 v1.1 hdSupersize your production pipe    enjmin 2013 v1.1 hd
Supersize your production pipe enjmin 2013 v1.1 hdslantsixgames
 
Catan world and Churchill
Catan world and ChurchillCatan world and Churchill
Catan world and ChurchillGrant Goodale
 
New Commodore 64 Network Game Developments
New Commodore 64 Network Game DevelopmentsNew Commodore 64 Network Game Developments
New Commodore 64 Network Game DevelopmentsLeif Bloomquist
 
Deploying a Low-Latency Multiplayer Game Globally: Loadout
Deploying a Low-Latency Multiplayer Game Globally: Loadout Deploying a Low-Latency Multiplayer Game Globally: Loadout
Deploying a Low-Latency Multiplayer Game Globally: Loadout Amazon Web Services
 
Large-scale Media Processing on Cloud - Cloud Asia 2016 PANEL DISCUSSION
Large-scale Media Processing on Cloud - Cloud Asia 2016 PANEL DISCUSSIONLarge-scale Media Processing on Cloud - Cloud Asia 2016 PANEL DISCUSSION
Large-scale Media Processing on Cloud - Cloud Asia 2016 PANEL DISCUSSIONAnand Bhojan
 
Igniting the Spark: Building Online Services for Borderlands 2
Igniting the Spark: Building Online Services for Borderlands 2Igniting the Spark: Building Online Services for Borderlands 2
Igniting the Spark: Building Online Services for Borderlands 2Jimmy Sieben
 

Similar a Photon Session / Unite12 Conference (20)

Massively Social != Massively Multiplayer
Massively Social != Massively MultiplayerMassively Social != Massively Multiplayer
Massively Social != Massively Multiplayer
 
Lets Play Together
Lets Play TogetherLets Play Together
Lets Play Together
 
Gdc13
Gdc13Gdc13
Gdc13
 
Puppet at DemonWare - Ruaidhri Power - Puppetcamp Dublin '12
Puppet at DemonWare - Ruaidhri Power - Puppetcamp Dublin '12Puppet at DemonWare - Ruaidhri Power - Puppetcamp Dublin '12
Puppet at DemonWare - Ruaidhri Power - Puppetcamp Dublin '12
 
(GAM402) Turbine: A Microservice Approach to 3 Billion Game Requests
(GAM402) Turbine: A Microservice Approach to 3 Billion Game Requests(GAM402) Turbine: A Microservice Approach to 3 Billion Game Requests
(GAM402) Turbine: A Microservice Approach to 3 Billion Game Requests
 
Albion Online - Software Architecture of an MMO (talk at Quo Vadis 2016, Berlin)
Albion Online - Software Architecture of an MMO (talk at Quo Vadis 2016, Berlin)Albion Online - Software Architecture of an MMO (talk at Quo Vadis 2016, Berlin)
Albion Online - Software Architecture of an MMO (talk at Quo Vadis 2016, Berlin)
 
Online games: a real-time problem for the network
Online games: a real-time problem for the networkOnline games: a real-time problem for the network
Online games: a real-time problem for the network
 
Harlan Beverly Lag The Barrier to innovation gdc austin 2009
Harlan Beverly Lag The Barrier to innovation gdc austin 2009Harlan Beverly Lag The Barrier to innovation gdc austin 2009
Harlan Beverly Lag The Barrier to innovation gdc austin 2009
 
Harlan beverly gaming levels up networking ieee 10 2009
Harlan beverly gaming levels up networking ieee 10 2009Harlan beverly gaming levels up networking ieee 10 2009
Harlan beverly gaming levels up networking ieee 10 2009
 
Supersize Your Production Pipe
Supersize Your Production PipeSupersize Your Production Pipe
Supersize Your Production Pipe
 
GamingAnywhere: An Open Cloud Gaming System
GamingAnywhere: An Open Cloud Gaming SystemGamingAnywhere: An Open Cloud Gaming System
GamingAnywhere: An Open Cloud Gaming System
 
Building fast,scalable game server in node.js
Building fast,scalable game server in node.jsBuilding fast,scalable game server in node.js
Building fast,scalable game server in node.js
 
GDC 2015 - Low-latency Multiplayer Gaming with AWS
GDC 2015 - Low-latency Multiplayer Gaming with AWS GDC 2015 - Low-latency Multiplayer Gaming with AWS
GDC 2015 - Low-latency Multiplayer Gaming with AWS
 
Supersize your production pipe enjmin 2013 v1.1 hd
Supersize your production pipe    enjmin 2013 v1.1 hdSupersize your production pipe    enjmin 2013 v1.1 hd
Supersize your production pipe enjmin 2013 v1.1 hd
 
Catan world and Churchill
Catan world and ChurchillCatan world and Churchill
Catan world and Churchill
 
New Commodore 64 Network Game Developments
New Commodore 64 Network Game DevelopmentsNew Commodore 64 Network Game Developments
New Commodore 64 Network Game Developments
 
Deploying a Low-Latency Multiplayer Game Globally: Loadout
Deploying a Low-Latency Multiplayer Game Globally: Loadout Deploying a Low-Latency Multiplayer Game Globally: Loadout
Deploying a Low-Latency Multiplayer Game Globally: Loadout
 
SJNC13.pptx
SJNC13.pptxSJNC13.pptx
SJNC13.pptx
 
Large-scale Media Processing on Cloud - Cloud Asia 2016 PANEL DISCUSSION
Large-scale Media Processing on Cloud - Cloud Asia 2016 PANEL DISCUSSIONLarge-scale Media Processing on Cloud - Cloud Asia 2016 PANEL DISCUSSION
Large-scale Media Processing on Cloud - Cloud Asia 2016 PANEL DISCUSSION
 
Igniting the Spark: Building Online Services for Borderlands 2
Igniting the Spark: Building Online Services for Borderlands 2Igniting the Spark: Building Online Services for Borderlands 2
Igniting the Spark: Building Online Services for Borderlands 2
 

Último

Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
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
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - 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
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
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
 

Último (20)

Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
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
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - 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
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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...
 

Photon Session / Unite12 Conference

  • 1. Photon & Unity Building Realtime Multiplayer Games
  • 3. Photon in a Nutshell • Photon is a Socket Server & Framework – Target: Realtime, Multiplayer, Cross Platform Games • 16k+ registered developers – 800 new devs every months and rising – AAA customers: u4ia, Codemasters, Nival, Glu, ... – Indies: CMUNE, Kogama, Bigbite, 3Sprockets, ... • Transparent pricing, empower Indies
  • 4. U4ia (= euphoria) • Industry Veterans (Dusty Welch, Chris Archer & team) • Free-to-play, AAA, Hardcore, Browser Based Games • „The middleware that gave us the least headache ...“, Dan MacDonald, Lead Programmer 4
  • 5. 5
  • 6. 6
  • 7. 7
  • 8. 8
  • 9. 9
  • 10. 10
  • 11. Photon Compared to „Social SDKs“ • Leaderboards • Matchmaking • Challenges • Realtime gameplay • • Achievements Social Network Integr. != • • Reliable UDP, TCP, Websockets FPS & MMO • News, Push • Load Balancing • Gamestatesync • Payment vNEXT • Downloadable Content • Least Ping Routing • Virtualgoods/-currency • Private Clouds • Unlock • Custom Server Logic • • Cross platform Efficiency = • • iOS, Android, WP7, Unity, Flash, HTML5, ... „No fluff“
  • 12. Unity Rules! But we do more …
  • 13.
  • 14.
  • 15. Type of Games • Room based games (2-32 players) – FPS, Racer, Casual Game – Broadcast of Messages to all Players – Framework: Lite, LiteLobby, Load Balancing – U4ia: Offensive Combat, CMUNE: Überstrike, Codemasters: F1 Online, Kogama, ... • MMO games – Hundreds of People per Map/World/Region – Interest Management – Framework: MMO – Innogames: Kartuga, FOX: Family Guy Online, ...
  • 16. What Does it give You: Build vs Buy
  • 17. What Does it give You: Build vs Buy
  • 18. Rules of Thumb: CCU is Usually Overestimated • CCU * 10 = DAU • DAU * 10 = MAU • MAU * x = Downloads (how many play connected?) • 100 CCU = 10,000 MAU • 1,000 CCU = 100,000 MAU • Real World Sample (Mobile): – 4,000,000 downloads >> 3,000 CCU
  • 19. Load Test: The Setup • Scenario – 25 rooms x 16 players = 400 CCU – 2 x 50 bytes reliable / s, 10 x 50 bytes unreliable / s • Server: Quad-Core, 8GB RAM, Win7 x64 – In: 4,500 msg/s (1,2 MB/s) – Out: 65,000 msg/s (7.5 MB/s) – CPU: ~30% – NIC (100Mbit): 80% saturated – Client RTT: ~40ms
  • 20. Load Test: Traffic is the Cost Driver • Traffic (400CCU, per month) – Traffic = 8MB/s * 60 * 60 * 24 * 30 * 50% = ~10 TB • Cost – Server Cost (HW, OS & traffic): $400 – Cost per CCU ~= $400/400CCU = $1 – 400 CCU ~= 4,000 DAU ~= 40,000 MAU – Cost per MAU ~= 1 Cent
  • 21. Load Test: Realworld, our own Cloud • Largest game has 13,000 CCUs • 800,000 msg/s (req, resp, ev) • 90 TB per month traffic • 40 Servers – US, Europe & Asia • Our „perfect“ Box – Single CPU, 4 Cores, 4GB RAM, 5TB traffic • Eat your own dogfood (deploy, stability, ops)
  • 22. API/SDK Options • Plain APIs (full control) – Operation: Request/Response – Events: From the server • Photon Unity Networking (PUN) – API compatible to Unity Networking – Using Plain APIs under the hood – Get it in the Unity Asset Store • Playmaker (via PUN) – Using the PUN APIs
  • 23. Photon Unity Networking (PUN) • Unity Networking (UN) is very convenient, simple and powerful • It is the entry point for most Indies to start Networking experiments • BUT it has several major draw backs ! UN needs a Master Server to be hosted ! P2P leads to NAT/punch-through issues (especially in mobile networks) ! Dropped hosts kill the games and so frustrate players ! UN will (probably) never run on the new Unity exports Flash / Chrome NaCl
  • 24. PUN Feature Coverage Synchronization RPCs 2 Position, Rotation, Scale 2 From client to client 2 Serialization by script 2 By method name 2 Buffered Instantiation 2 Receiver selectable - Animation 2 Buffered Grouping and Scope - Not supported by server Callbacks - Events are ignored accordingly 2 Player joins, leaves 2 Connection states Server Logic 2 Instantiation 2 MasterClient replaces Host (Remark: Photon is just used as „relay“) Network Simulation 2 Lag, Jitter, Loss - Bandwidth throtteling
  • 25. Additional Features Platform as a Service (PaaS) Dashboard + No server installs with the Cloud + See CCUs, Disconnects etc. + Transparent load balancing Host Transition Properties (Rooms and Players) + Remaining players select new + Key-Value collection for custom data MasterClient (name, etc.) Offline Mode Runtime Scene GameObjects + Same logic for offline gaming + Can be instantiated with owner “scene“
  • 26. Counters to Track Down Issues Overall: A peers disconnects every 2h (average) 20k peers, 80msg/s per room, 800k msg/s Specific Game: A peers disconnects every 6-12min (average) Dig further in ...
  • 27. Unite12 Announcement #1: • Cloud “forever free” plan • 20CCU • Unlimited apps
  • 28. Unite12 Announcement #2: • Playmaker integration • Easy Unity Networking
  • 29. Unite12 Announcement #3: For Indies • 1 Server: $99 • 3 Server: $199 Per title, unlimited CCUs
  • 30. Part II: Photon Unite Networking (PUN) hands-on
  • 31. Running a local Cloud • Register and get app ID (cloud.exitgames.com) • Download Photon Server • Unpack it • Run “MyCloud”
  • 32. PUN Nuts & Bolts • Lobby – Matchmaking – Properties can be synced • Rooms – Exchange data in realtime (text, positions ...) – Set and get properties of Players and Rooms
  • 33. Quick Usage Intro • ConnectUsingSettings() – US, EU or Asia • Get from the Lobby into a Room quickly – CreateRoom(), JoinRoom() • Setup a Monster for network sync – Add prefab – Add PhotonView – Add script for update
  • 34. Properties & using them for Matchmaking • Properties are a key-value storage for custom data – Attached to Players or Rooms – Sample: Attach the played map to a room (map=„Island“) • Properties can be synced to the Lobby – Synced properties are defined on creation – Sample: Sync the map key-value to the Lobby • JoinRandomRoom() can filter rooms by properties – Pass in Hashtable of key-value pairs – Sample: Match rooms with a certain map
  • 35. Tips & Tricks: Loading a Level • Two main Problems: – Long loading time causes a timeout (update thread is not called) – Updates getting lost during load (scene updates ...), e.g. objects do not exist yet • Pause message queue and dispatch after load – Creates a thread to keep connection alive • Setting a prefix – Detect quickly if message is for another level
  • 36. Beyond PUN • Operations, Responses and Events • Calling operations • Handling Events • Event cache
  • 37. Quality of Service (QoS) • How to reduce messages • How to read vital stats
  • 39. 39
  • 40. 40
  • 41. 41
  • 42. 42