2. MMO Architecture Design
Case Study from an MMO: Happy Me
•http://www.slideshare.net/actionstartup/a-practical-architecture-design-for- mmo-casual-game-mr-an-ngo-thai
•http://www.slideshare.net/AmazonWebServices/gdc2014-aws- gamearchitecturesfinal
3. Content
•Happy Me
•Architecture Overview
•Architecture Detail
–Object Management System
–Server-Client Data Synchronization
–Network Message Dispatching System
•Bonus: AWS Architecture
4. Happy Me
•What?
–MMO Casual Game
–Room-based active server
–Web-based Unity3D client
–Run on social platform
•Who?
–VNG from Vietnam
–Technical team
•3 System and framework developers
•4 Game developers
•12 Months development time
10. Design
•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 message and invoke handlers
12. Overview diagram Model View Controller (gameplay logic)
Database Network Messages View Controller (graphic logic)
Server Side
Client Side
Unity3D 3D Models
Database Model
13. MVC objects mapping Model View Controller Game Objects Object Views Game Logic Modules Rooms
14. Detail diagram Game Objects Object Views Game Logic
No-SQL
(Storage) Network Messages Object Views Graphic Logic
Server Side
Client Side
SQL
(Ranking, Log)
Database Game Objects Modules Modules Rooms Rooms
19. The object tree Object Unit GameObject DataObject Player DecoItem Pet UseItem ClothItem Item Quest Job PlayerView DecoView PetView ObjectView Module MainGame Authen HomeDeco SyncData Room Lobby Public Personal Object Manager
20. Result
Pros
•MVC design pattern practice
•Fully customizable property system
•Manage game world into one single system
Cons
•Challenge to manage huge number of objects
23. Duties of a room
Synchronization Scheduler
Other
Schedulers
Message
Processor
ROOM
•Process messages from clients
•Send or broadcast messages to clients
•Synchronize data changes between server and clients
•Update status
•Other duties…
24. Thread pool workers Personal Room Coffee Room Downtown Room
Sync
Other
Sync Thread Pool
Other
Sync
Other
Sync
Sync
Other
ROOMS
TASK QUEUES
WORKERS
25. Thread
Schedulers
1 second
SYNCHRONIZATION
SCHEDULER
OTHERS SCHEDULER
1/10 second Other Task Sync Task Sync Task Other Task
Sync Task
Other Task
TASK QUEUE
WORKER
26. Object change-set Object
Position
Energy
Gold
Change Set
SYNCHRONIZATION SCHEDULER
SetProperty(Position, (1, 2))
Sync Task
27. Result
Pros
•Automatic synchronization property changes
•Optimal data transfer
•Best use for active server game
Cons
•Overhead to determine what has changed since last sync.
31. Result
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
32. •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
Conclusion