• Happy Me
• Architecture Overview
• Architecture Detail
  Object Management System
  Server-Client Data Synchronization
  Network Message Dispatching System
•   MMO casual game
•   Room-based active server
•   Web-based Unity3D client
•   Run on social platform
• 3 system and framework developers
• 4 game developers
• 12 months of development
Internet

Database
                                     Client




           Game Servers
Player
              Data




                  Player
                   Data


Game Logic

             Player
              Data



    Server Side            Client Side
Object                            Network Message
Management                            Dispatching
  System                                System




                      Auto
             MAKESynchronization
                  OUR LIFE EASIER
                   Framework
• Object management system
   MVC design pattern
   Dynamic data


• Auto synchronization framework
   Truly automatic («Set» and forget style)
   Synchronize the delta difference only


• Network message dispatching system
   Custom structure message
   Easy to register messages and invoke handlers
Database



 Database




  Model                                 Model



Controller            Network         Controller
(gameplay logic)      Messages        (graphic logic)




                                                         3D
   View                                  View
                                                        Models


        Server Side              Client Side            Unity3D
Game
 Model
             Objects



             Object
  View                 Rooms
             Views



             Game
Controller             Modules
             Logic
Database



No-SQL          SQL
(Storage)   (Ranking, Log)




 Game                                                      Game
Objects                                                   Objects


Game                         Network                      Graphic
                   Modules              Modules
Logic                        Messages                      Logic


Object                                                    Object
                     Rooms              Rooms
Views                                                     Views


            Server Side                     Client Side
Object
           Views




 Game
Objects   Object    Modules




           Rooms
• A container of properties
• Serialize to and deserialize from JSON
• Hierarchy relationship (parent-child)
Property Meta Data

                      • Tags
                          • Persistent
                          • Client transfer
         Guid
                      • Type
Object   Property 1       • Long
         Property 2
                      • Name
                         • “property 2”

                      • Version
                         • 568
Object
                                               Manager


    DecoView    PetView     PlayerView                            Player
                                                         Unit
                                                                   Pet
               ObjectView
MainGame                                       GameObject
                                                                 DecoItem

 Authen                                                  Item    UseItem
               Module         Object
HomeDeco                                                         ClothItem

                                                                  Quest
SyncData                       Room
                                                    DataObject

                                                                   Job
                    Lobby      Public    Personal
Pros
• MVC design pattern practice
• Fully customizable property system
• Manage game world into one single
  system

Cons
• Challenge to manage huge number of
  objects
Server
Player.Position = (10, 20)        Room




Player.OnUpdatePosition(10, 20)
{
                                           Client
    model.MoveTo(10, 20);
}
• Process messages
• Update status                                          from clients
• Other duties…                                        • Send or broadcast
                               Message                   messages to clients
                               Processor




                    Other
                  Schedulers



                                     Synchronization
                                           Scheduler




                                                       • Synchronize data
                                                         changes between
                                                         server and clients
                                ROOM
Coffee     Downtown    Personal
 ROOMS
          Room         Room       Room




           Sync        Other       Sync
   TASK
           Other       Sync        Sync
 QUEUES    Sync        Other       Other




WORKERS            Thread Pool
1 second

                                               Other
OTHERS SCHEDULER
                                               Task

SYNCHRONIZATION                  Sync
      SCHEDULER                  Task

                   1/10 second

                                        Other Task

                                        Sync Task
      TASK QUEUE
                                        Other Task
                                        Sync Task



         WORKER                           Thread
Position
SetProperty(Position, (1, 2))   Object          Energy
                                                 Gold

                                           Change Set




SYNCHRONIZATION                          Sync
      SCHEDULER                          Task
Pros
• Automatic synchronization property changes
• Optimal data transfer
• Best use for active server game

Cons
• Overhead to determine what has changed
  since last sync.
Login        Synchronize    Buy Item
                                            Chat           RequestFriend
 - Username   - Type         - ItemType
                                            - Message      - FriendGuid
 - Password   - Properties   - Quantity




Encryption

                                                        Network package
                               Serializer
                    (Thrift, Protobuf, Json, XML)
Login                        Server
- Username
- Password
                                                          OnLogin
                                               Message
 Send
                                               Handlers
                 Serialize
                                               Login      OnAuthen
                                               Authen
                                               Move
                                               Run        OnMove

              Deserialize
                                                           OnRun

                                  Login
             Client               - Username
                                  - Password


                                  Receive
Pros
• Meaningful message by define custom
  structure
• Familiar usage as common GUI system
  (MFC, WinForm)
• Share message definition between server
  and client
• Easy to apply encryption
Cons
• Unknown
• Seamless MVC framework across server
  and client
• Address the most common difficulty in
  design active server : the synchronization
• Base framework environment for adapting
  any gameplay
A Practical Architecture Design for MMO Casual Game
A Practical Architecture Design for MMO Casual Game

A Practical Architecture Design for MMO Casual Game

  • 2.
    • Happy Me •Architecture Overview • Architecture Detail Object Management System Server-Client Data Synchronization Network Message Dispatching System
  • 4.
    MMO casual game • Room-based active server • Web-based Unity3D client • Run on social platform
  • 6.
    • 3 systemand framework developers • 4 game developers • 12 months of development
  • 8.
    Internet Database Client Game Servers
  • 9.
    Player Data Player Data Game Logic Player Data Server Side Client Side
  • 11.
    Object Network Message Management Dispatching System System Auto MAKESynchronization OUR LIFE EASIER Framework
  • 12.
    • Object managementsystem  MVC design pattern  Dynamic data • Auto synchronization framework  Truly automatic («Set» and forget style)  Synchronize the delta difference only • Network message dispatching system  Custom structure message  Easy to register messages and invoke handlers
  • 14.
    Database Database Model Model Controller Network Controller (gameplay logic) Messages (graphic logic) 3D View View Models Server Side Client Side Unity3D
  • 15.
    Game Model Objects Object View Rooms Views Game Controller Modules Logic
  • 16.
    Database No-SQL SQL (Storage) (Ranking, Log) Game Game Objects Objects Game Network Graphic Modules Modules Logic Messages Logic Object Object Rooms Rooms Views Views Server Side Client Side
  • 17.
    Object Views Game Objects Object Modules Rooms
  • 18.
    • A containerof properties • Serialize to and deserialize from JSON • Hierarchy relationship (parent-child)
  • 19.
    Property Meta Data • Tags • Persistent • Client transfer Guid • Type Object Property 1 • Long Property 2 • Name • “property 2” • Version • 568
  • 21.
    Object Manager DecoView PetView PlayerView Player Unit Pet ObjectView MainGame GameObject DecoItem Authen Item UseItem Module Object HomeDeco ClothItem Quest SyncData Room DataObject Job Lobby Public Personal
  • 22.
    Pros • MVC designpattern practice • Fully customizable property system • Manage game world into one single system Cons • Challenge to manage huge number of objects
  • 24.
    Server Player.Position = (10,20) Room Player.OnUpdatePosition(10, 20) { Client model.MoveTo(10, 20); }
  • 25.
    • Process messages •Update status from clients • Other duties… • Send or broadcast Message messages to clients Processor Other Schedulers Synchronization Scheduler • Synchronize data changes between server and clients ROOM
  • 26.
    Coffee Downtown Personal ROOMS Room Room Room Sync Other Sync TASK Other Sync Sync QUEUES Sync Other Other WORKERS Thread Pool
  • 27.
    1 second Other OTHERS SCHEDULER Task SYNCHRONIZATION Sync SCHEDULER Task 1/10 second Other Task Sync Task TASK QUEUE Other Task Sync Task WORKER Thread
  • 28.
    Position SetProperty(Position, (1, 2)) Object Energy Gold Change Set SYNCHRONIZATION Sync SCHEDULER Task
  • 29.
    Pros • Automatic synchronizationproperty changes • Optimal data transfer • Best use for active server game Cons • Overhead to determine what has changed since last sync.
  • 31.
    Login Synchronize Buy Item Chat RequestFriend - Username - Type - ItemType - Message - FriendGuid - Password - Properties - Quantity Encryption Network package Serializer (Thrift, Protobuf, Json, XML)
  • 32.
    Login Server - Username - Password OnLogin Message Send Handlers Serialize Login OnAuthen Authen Move Run OnMove Deserialize OnRun Login Client - Username - Password Receive
  • 33.
    Pros • Meaningful messageby define custom structure • Familiar usage as common GUI system (MFC, WinForm) • Share message definition between server and client • Easy to apply encryption Cons • Unknown
  • 34.
    • Seamless MVCframework across server and client • Address the most common difficulty in design active server : the synchronization • Base framework environment for adapting any gameplay

Editor's Notes