P2P Multiplayer Gaming
          Dan Byers
      Manic Networks Inc.

      September 29th, 2009
Introduction

• Manic?
 • Startup
 • Solutions for Game Developers
Gaming Today

• Single player
• Multiplayer
    • real-time
    • non real-time
• Real-time and game play
Mobile Multiplayer

• Picking up steam
 • Wireless networks are improving
 • Smartphones: faster, feature rich
 • Social aspects, interactivity
App Store games

• Play ‘n forget
• Need to improve ‘stickiness’
• Make the user feel that they can’t stop
  playing
Social Factors

• More apt to join if you have friends also
  playing the game
• The out-of-game experience
• Communities can build upon themselves
Architectures
                          Server
• Client-server                         clients
                  A         B           C



                      A             B
• Peer-to-peer            clients

                      C             D
Client-Server
                 Server
                             clients
          A         B        C


• Persistent connections
• Game management in server
• Loads increase ... scaling issues
A             B
  Peer-to-Peer                        clients

                                 C              D

• Direct communication between clients
• Server still required for player matching
• Reduces load off of a central server
• Be careful with game state
• “Local” peer to peer with Gamekit
Multiplayer Gaming -
   No Small Task

• For small teams, multiplayer can lead
  to months of added development &
  test effort
• Where do the difficulties lie?
Hurdles
• Player synchronization, game state
• Network latency
• Server infrastructure - costly
• Connectivity - firewalls
Firewalls Shmirewalls

Player A             Internet             Player B
           firewall              firewall




 • The main issue: NAT
Firewalls & NAT
             Private IP and port:           Public IP and port:
             192.168.1.10:2000              64.26.92.166:653


  iPod/iPhone,
                                     Firewall
     or PC
                                    with NAT
                                                      Internet


• Multiple devices share one public IP
• Devices are assigned private IP’s
• Firewall blocks inbound traffic by default
Firewall Hole Punching
                (NAT Traversal)


• External mediator assistance required
• Mediator helps each peer punch through to
  other peers
• Not always sucessful - need to be able to
  fallback to server-based traffic relays
Working on a multiplayer
            game?
Requirements
 • Back-end servers for player matching, hole
   punching and traffic relay fallback
 • Player database and player profiles
 • Scores, ranks, achievements - submission
   and storing
 • Game invites, challenges, game profiles
 • Notifications, alerts, messaging, chat
The Solution

• Nothing that really fit the bill previously
• Until now...
The Solution

• Nothing that really fit the bill previously
• Until now...

 The Manic Gaming Network
The Manic
      Gaming Network

•   Currently in beta

•   A community for both developers and gamers

•   Services available for single player and multiplayer
    games
Service Features
•   Robust API for peer-to-peer player matching

•   Multiple player matching options - random
    matches, friend matches, rank-based matches, game
    lobbies

•   Firewall hole punching & traffic relaying

•   Game profiles - global high score lists, player
    rankings, achievements

•   In-game match invites / challenges
Service Features (cont’d)
•   Support for turn based games with storage of
    game states and turn notifications

•   Notification sending (APNS, SMS, email, RSS)

•   Private Developer Sandbox

•   Marketing and promotion of your games

•   API is Objective C
Player Features
•   One profile to play    •   Friend lists and
    any Manic-enabled         Ignore lists
    game
                          •   Compare scores
•   Personal profile for       with friends
    sharing
                          •   Friend messaging
•   View and share
                          •   Gaming
    scores, ranks,
                              notifications
    achievement history
Development Roadmap

• Manic Dashboard for service management
• Tournament support
• Chat rooms
• Internationalization
• Other client platforms
Sample Code

• Demo game - Finger Wars!
 • 2-4 player - random & friend matches
 • results submission
 • in-game account registration
Thank you!

• dan.byers@manicgaming.com
 • twitter.com/coffeedan
• randy.byers@manicgaming.com

       www.manicgaming.com

P2P Multiplayer Gaming

  • 1.
    P2P Multiplayer Gaming Dan Byers Manic Networks Inc. September 29th, 2009
  • 2.
    Introduction • Manic? •Startup • Solutions for Game Developers
  • 3.
    Gaming Today • Singleplayer • Multiplayer • real-time • non real-time • Real-time and game play
  • 4.
    Mobile Multiplayer • Pickingup steam • Wireless networks are improving • Smartphones: faster, feature rich • Social aspects, interactivity
  • 5.
    App Store games •Play ‘n forget • Need to improve ‘stickiness’ • Make the user feel that they can’t stop playing
  • 6.
    Social Factors • Moreapt to join if you have friends also playing the game • The out-of-game experience • Communities can build upon themselves
  • 7.
    Architectures Server • Client-server clients A B C A B • Peer-to-peer clients C D
  • 8.
    Client-Server Server clients A B C • Persistent connections • Game management in server • Loads increase ... scaling issues
  • 9.
    A B Peer-to-Peer clients C D • Direct communication between clients • Server still required for player matching • Reduces load off of a central server • Be careful with game state • “Local” peer to peer with Gamekit
  • 10.
    Multiplayer Gaming - No Small Task • For small teams, multiplayer can lead to months of added development & test effort • Where do the difficulties lie?
  • 11.
    Hurdles • Player synchronization,game state • Network latency • Server infrastructure - costly • Connectivity - firewalls
  • 12.
    Firewalls Shmirewalls Player A Internet Player B firewall firewall • The main issue: NAT
  • 13.
    Firewalls & NAT Private IP and port: Public IP and port: 192.168.1.10:2000 64.26.92.166:653 iPod/iPhone, Firewall or PC with NAT Internet • Multiple devices share one public IP • Devices are assigned private IP’s • Firewall blocks inbound traffic by default
  • 14.
    Firewall Hole Punching (NAT Traversal) • External mediator assistance required • Mediator helps each peer punch through to other peers • Not always sucessful - need to be able to fallback to server-based traffic relays
  • 15.
    Working on amultiplayer game? Requirements • Back-end servers for player matching, hole punching and traffic relay fallback • Player database and player profiles • Scores, ranks, achievements - submission and storing • Game invites, challenges, game profiles • Notifications, alerts, messaging, chat
  • 16.
    The Solution • Nothingthat really fit the bill previously • Until now...
  • 17.
    The Solution • Nothingthat really fit the bill previously • Until now... The Manic Gaming Network
  • 18.
    The Manic Gaming Network • Currently in beta • A community for both developers and gamers • Services available for single player and multiplayer games
  • 19.
    Service Features • Robust API for peer-to-peer player matching • Multiple player matching options - random matches, friend matches, rank-based matches, game lobbies • Firewall hole punching & traffic relaying • Game profiles - global high score lists, player rankings, achievements • In-game match invites / challenges
  • 20.
    Service Features (cont’d) • Support for turn based games with storage of game states and turn notifications • Notification sending (APNS, SMS, email, RSS) • Private Developer Sandbox • Marketing and promotion of your games • API is Objective C
  • 21.
    Player Features • One profile to play • Friend lists and any Manic-enabled Ignore lists game • Compare scores • Personal profile for with friends sharing • Friend messaging • View and share • Gaming scores, ranks, notifications achievement history
  • 22.
    Development Roadmap • ManicDashboard for service management • Tournament support • Chat rooms • Internationalization • Other client platforms
  • 23.
    Sample Code • Demogame - Finger Wars! • 2-4 player - random & friend matches • results submission • in-game account registration
  • 24.
    Thank you! • dan.byers@manicgaming.com • twitter.com/coffeedan • randy.byers@manicgaming.com www.manicgaming.com