Sie sind auf Seite 1von 36

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

MODEL

VIEW

CONTRO
-LLER

Network Message
Dispatching
System

Object
Management
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

Controller
(gameplay logic)

View

Server Side

Model

Network
Messages

Controller
(graphic logic)

View

Client Side

3D
Models
Unity3D

Model

Game
Objects

View

Object
Views

Rooms

Controller

Game
Logic

Modules

Database

No-SQL

(Storage)

SQL

(Ranking, Log)

Game
Objects

Game
Objects

Game
Logic

Modules

Object
Views

Rooms

Server Side

Network
Messages

Modules

Graphic
Logic

Rooms

Object
Views

Client Side

Object
Views

Game
Objects

Object

Rooms

Modules

A container of properties
Serialize to and deserialize from JSON
Hierarchy relationship (parent-child)

Property Meta Data

Guid

Object

Property 1

Property 2

Tags
Persistent
Client transfer
Type
Long
Name
property 2

Version
568

Object
Manager
DecoView

PetView

Player

PlayerView

Unit

Pet

ObjectView

GameObject

MainGame

Authen

Item
Module

Object

UseItem
ClothItem

HomeDeco

Quest

Room

SyncData

DecoItem

DataObject

Lobby

Public

Personal

Job

Pros
MVC design pattern practice
Fully customizable property system
Manage game world into one single
system
Cons
Challenge to manage huge number of
objects

Player.Position = (10, 20)

Player.OnUpdatePosition(10, 20)
{
model.MoveTo(10, 20);
}

Server
Room

Client

Process messages
from clients
Send or broadcast
messages to clients

Update status
Other duties
Message
Processor

Other
Schedulers

Synchronization
Scheduler

ROOM

Synchronize data
changes between
server and clients

ROOMS

Coffee
Room

Downtown
Room

Personal
Room

TASK
QUEUES

Sync
Other
Sync

Other
Sync
Other

Sync
Sync
Other

WORKERS

Thread Pool

1 second
Other
Task

OTHERS SCHEDULER
Sync
Task

SYNCHRONIZATION
SCHEDULER
1/10 second

Other Task
TASK QUEUE

Sync Task
Other Task
Sync Task

WORKER

Thread

SetProperty(Position, (1, 2))

Position

Object

Energy
Gold

Change Set

SYNCHRONIZATION
SCHEDULER

Sync
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
- Username
- Password

Synchronize
- Type
- Properties

Buy Item
- ItemType
- Quantity

Chat
- Message

RequestFriend
- FriendGuid

Encryption

Serializer
(Thrift, Protobuf, Json, XML)

Network package

Server

Login
- Username
- Password

Message
Handlers

Send
Serialize

Login
Authen
Move
Run

OnLogin
OnAuthen
OnMove

Deserialize

OnRun

Client

Login
- 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

Das könnte Ihnen auch gefallen