SlideShare ist ein Scribd-Unternehmen logo
1 von 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

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Kürzlich hochgeladen

SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 

Kürzlich hochgeladen (20)

SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 

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