A Practical Architecture Design for MMO Casual Game
1.
2. • Happy Me
• Architecture Overview
• Architecture Detail
Object Management System
Server-Client Data Synchronization
Network Message Dispatching System
3.
4. • MMO casual game
• Room-based active server
• Web-based Unity3D client
• Run on social platform
5.
6. • 3 system and framework developers
• 4 game developers
• 12 months of development
9. Player
Data
Player
Data
Game Logic
Player
Data
Server Side Client Side
10.
11. Object Network Message
Management Dispatching
System System
Auto
MAKESynchronization
OUR LIFE EASIER
Framework
12. • 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
13.
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 container of 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
20.
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 design pattern practice
• Fully customizable property system
• Manage game world into one single
system
Cons
• Challenge to manage huge number of
objects
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
29. Pros
• Automatic synchronization property changes
• Optimal data transfer
• Best use for active server game
Cons
• Overhead to determine what has changed
since last sync.
33. 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
34. • 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