pik ko server erlang conference

Upload: mrchwet-aum

Post on 03-Jun-2018

214 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/12/2019 Pik Ko Server Erlang Conference

    1/27

    Pikko Server

    Scalability when using Erlang on the server sidefor massive multiplayer game servers.

    David AlmrothCTO, PikkoTekk

  • 8/12/2019 Pik Ko Server Erlang Conference

    2/27

    Agenda

    1. David & PikkoTekk2. Normal game servers

    3. The scalability problem4. A more scalable solution Pikko Server5. World record attempt for game servers

    6. Questions & Answers

  • 8/12/2019 Pik Ko Server Erlang Conference

    3/27

    David Almroth & PikkoTekk

    Did 10 years of Enterprise Java(Banking & Finance)

    Now Erlang architect Started PikkoTekk 2009 together with Reep, a

    group of talented game programmers inUppsala

    PikkoTekk is a company producing scalablesoftware for multiplayer computer games

  • 8/12/2019 Pik Ko Server Erlang Conference

    4/27

    Blade Server

    Gameserver 1

    (forest area)

    Gameserver 16

    Gameserver 16

    Gameserver 16

    Gameserver 16

    Gameserver 16

    Gameserver 16

    Gameserver 16

    Gameserver 16

    Game

    server 16

    Gameserver 16

    Gameserver 16

    Gameserver 16

    Gameserver 5

    Gameserver 4

    Gameserver 3

    Gameserver 2

    (city area)

    Clients

    Normal Zoned MMO Game Servers(For example: World of Warcraft, Eve Online)

    DB(SQL)

    MMO = Massive Multiplayer Online

  • 8/12/2019 Pik Ko Server Erlang Conference

    5/27

    Scalability Problems forNormal Game Server

    Can not utilize the power of modern multicore processors

    Game servers usually have one single thread = not scalableThe result is:

    No big crowds can be handled (not without challenges) No big battlefields can be handled

    Database gets overloaded is another problem(not the focus today)

  • 8/12/2019 Pik Ko Server Erlang Conference

    6/27

    Normal Solutions tothe Server Overload Problem

    1. Limit the number of players per server(World of Warcraft) > they make instances

    2. Allow many players, but server will getslower and slower (Eve Online)

    3. Turn off fighting and other realtime activitesin crowded areas. (Cities in WoW)

    THIS IS BORING! Gamers want higher

    player density !

  • 8/12/2019 Pik Ko Server Erlang Conference

    7/27

    Normal MultiplayerGame Development

    The game developer usually works in a singleeditor (called a Game Engine)

    Client and server is often programmed withthe same language

    The developer uses a lot of middleware thatdemands C++ (currently the game industrystandard).

    Their focus is fun games, not scalable servers

  • 8/12/2019 Pik Ko Server Erlang Conference

    8/27

    The Unity Game Engine

    (GUI screenshot)

  • 8/12/2019 Pik Ko Server Erlang Conference

    9/27

    How should they build more

    scalable game servers that can use multicore? Use multicore power with a bunch of C++

    threads? - Scary! Multicore with Java ? - Scary too! Make a complete game server in Erlang ?

  • 8/12/2019 Pik Ko Server Erlang Conference

    10/27

    Why not make a completegame server in Erlang ?

    Can not use C++ middleware on the server Have to use different platforms for client and

    server How do you make game logic scripting easy? Erlang is a new programming paradigm for game

    developers It can be done, yes, but there are big challenges !

  • 8/12/2019 Pik Ko Server Erlang Conference

    11/27

    A more scalable solution:Pikko Server

    Keep the game servers the way they are andlimit the number of players per game server toaround 50-100.

    Put an intelligent router = an Application LevelGateway (ALG) based on Erlang in front ofthem.

    Move players dynamically between gameservers to avoid overload.

  • 8/12/2019 Pik Ko Server Erlang Conference

    12/27

    multi-core server

    The Pikko Server Solution

    multi-core server

    Gameserver 1

    Gameserver 16

    Gameserver 16

    Gameserver 16

    Gameserver 16

    Gameserver 16

    Gameserver 16

    Gameserver 16

    Gameserver 16

    Game

    server 16

    Gameserver 16

    Gameserver 16

    Gameserver 16

    Gameserver 5

    Gameserver 4

    Gameserver 3

    Gameserver 2Pikko Server

    = ALG(Erlang)

    1000 +Clients= players

    Can route network trafficbased on players position

    in the virtual world.

  • 8/12/2019 Pik Ko Server Erlang Conference

    13/27

    How can Pikko Server dynamicallyroute the traffic to the correct

    game server?

  • 8/12/2019 Pik Ko Server Erlang Conference

    14/27

    Pikko Server divides the virtual world

    like a cell phone network !

    Every player is a cell phone. Every game server is a mobile network

    antenna (we call them masts) Cell phones (players) can be handed over

    between masts (game servers)

    The masts can move (!)

  • 8/12/2019 Pik Ko Server Erlang Conference

    15/27

    The PikkoServer view of a virtual world

    Mast1 Mast2

    Mast3

    Mast4 Mast5

    players

  • 8/12/2019 Pik Ko Server Erlang Conference

    16/27

    Client viewPlayers can see all opponents (in their line of sight)

  • 8/12/2019 Pik Ko Server Erlang Conference

    17/27

    Live Demo Game

    Servers hosted by Game-Hosting GH AB in Uppsala.

  • 8/12/2019 Pik Ko Server Erlang Conference

    18/27

    zxdfg

    Game server view- The view of one game server

    Mast3

    Note: It is not overloaded !

  • 8/12/2019 Pik Ko Server Erlang Conference

    19/27

    Game server view- The view of another game server

    Mast1

    Every game server (mast) has loaded the complete map of the virtual world

  • 8/12/2019 Pik Ko Server Erlang Conference

    20/27

    One Player Moves:This movement will trigger a handover

    Mast1 Mast2

    Mast3

    Mast4 Mast5

    players

  • 8/12/2019 Pik Ko Server Erlang Conference

    21/27

    Handovers

    The Mast algorithm in Pikko Server decideswhen a player object needs to be transferredfrom one game server to another.

    Player state is serialized and transferred fromone game servers to another (via Pikko Server) .

    The game server has to implement our API tobe able to participate in handovers.

  • 8/12/2019 Pik Ko Server Erlang Conference

    22/27

    Massive movements affectpositions of masts

    Mast1

    Mast2

    Mast3

    Mast4Mast5

  • 8/12/2019 Pik Ko Server Erlang Conference

    23/27

    Mast Algorithm - Demo

  • 8/12/2019 Pik Ko Server Erlang Conference

    24/27

    Pikko Server Now Available

    We have a solution for scaling game serversbased on Elrang

    Game developers do not have to learn Erlang,instead they can use Pikko Server to get scalablemany-core power now.

    Pikko Server can be used in any game engine.(Our current demo game is based on the Unity Game Engine)

    Marketing and sales starts today.

  • 8/12/2019 Pik Ko Server Erlang Conference

    25/27

    Current Performance

    We can handle at least 1000 players when gameservers send 15 updates (for all moving objets)every second.

    We can multicast 500,000 game actions persecond per core.

    Close to linear scalability up to 8 cores. We havenot tested more yet.

    1000 active UDP sockets sending 1 Megabit/seach = 1 Gb/s totalt server bandwidthdownstream from Pikko Server.

    Test lab hosted by Game-Hosting GH AB in Uppsala.

  • 8/12/2019 Pik Ko Server Erlang Conference

    26/27

    World record attempt soon

    PikkoTekk will soon make a world recordattempt with 1000 real players with a fastpaced action demo game.

    Please send me an email now if you want tobe part of this [email protected]

    Subject: World record

    mailto:[email protected]:[email protected]
  • 8/12/2019 Pik Ko Server Erlang Conference

    27/27

    Questions & Answers

    David Almrothwww.pikkotekk.com