mmo design architecture by andrew
TRANSCRIPT
![Page 1: MMO Design Architecture by Andrew](https://reader034.vdocuments.site/reader034/viewer/2022050803/58ee660c1a28ab2c648b462f/html5/thumbnails/1.jpg)
@agatestudio
MMO Architecture
Design Andrew
Publishing
Agate Studio
![Page 2: MMO Design Architecture by Andrew](https://reader034.vdocuments.site/reader034/viewer/2022050803/58ee660c1a28ab2c648b462f/html5/thumbnails/2.jpg)
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
![Page 3: MMO Design Architecture by Andrew](https://reader034.vdocuments.site/reader034/viewer/2022050803/58ee660c1a28ab2c648b462f/html5/thumbnails/3.jpg)
Content
• Happy Me
• Architecture Overview
• Architecture Detail
– Object Management System
– Server-Client Data Synchronization
– Network Message Dispatching System
• Bonus: AWS Architecture
![Page 4: MMO Design Architecture by Andrew](https://reader034.vdocuments.site/reader034/viewer/2022050803/58ee660c1a28ab2c648b462f/html5/thumbnails/4.jpg)
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
![Page 5: MMO Design Architecture by Andrew](https://reader034.vdocuments.site/reader034/viewer/2022050803/58ee660c1a28ab2c648b462f/html5/thumbnails/5.jpg)
![Page 6: MMO Design Architecture by Andrew](https://reader034.vdocuments.site/reader034/viewer/2022050803/58ee660c1a28ab2c648b462f/html5/thumbnails/6.jpg)
ARCHITECTURAL OVERVIEW
![Page 7: MMO Design Architecture by Andrew](https://reader034.vdocuments.site/reader034/viewer/2022050803/58ee660c1a28ab2c648b462f/html5/thumbnails/7.jpg)
Physical Architecture
![Page 8: MMO Design Architecture by Andrew](https://reader034.vdocuments.site/reader034/viewer/2022050803/58ee660c1a28ab2c648b462f/html5/thumbnails/8.jpg)
Game Data, Logic, and Presentation
![Page 9: MMO Design Architecture by Andrew](https://reader034.vdocuments.site/reader034/viewer/2022050803/58ee660c1a28ab2c648b462f/html5/thumbnails/9.jpg)
DESIGN
![Page 10: MMO Design Architecture by Andrew](https://reader034.vdocuments.site/reader034/viewer/2022050803/58ee660c1a28ab2c648b462f/html5/thumbnails/10.jpg)
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
![Page 11: MMO Design Architecture by Andrew](https://reader034.vdocuments.site/reader034/viewer/2022050803/58ee660c1a28ab2c648b462f/html5/thumbnails/11.jpg)
OBJECT MANAGEMENT SYSTEM (MVC DESIGN)
![Page 12: MMO Design Architecture by Andrew](https://reader034.vdocuments.site/reader034/viewer/2022050803/58ee660c1a28ab2c648b462f/html5/thumbnails/12.jpg)
Overview diagram
Model
View
Controller (gameplay logic)
Database
Network Messages
View
Controller (graphic logic)
Server Side Client Side Unity3D
3D Models
Database
Model
![Page 13: MMO Design Architecture by Andrew](https://reader034.vdocuments.site/reader034/viewer/2022050803/58ee660c1a28ab2c648b462f/html5/thumbnails/13.jpg)
MVC objects mapping
Model
View
Controller
Game Objects
Object Views
Game Logic Modules
Rooms
![Page 14: MMO Design Architecture by Andrew](https://reader034.vdocuments.site/reader034/viewer/2022050803/58ee660c1a28ab2c648b462f/html5/thumbnails/14.jpg)
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
![Page 15: MMO Design Architecture by Andrew](https://reader034.vdocuments.site/reader034/viewer/2022050803/58ee660c1a28ab2c648b462f/html5/thumbnails/15.jpg)
General purpose base object
Object
Rooms
Object Views
Modules Game
Objects
![Page 16: MMO Design Architecture by Andrew](https://reader034.vdocuments.site/reader034/viewer/2022050803/58ee660c1a28ab2c648b462f/html5/thumbnails/16.jpg)
The “Object” requirements
• A container of properties
• Serialize to and deserialize from JSON
• Hierarchy relationship (parent-child)
![Page 17: MMO Design Architecture by Andrew](https://reader034.vdocuments.site/reader034/viewer/2022050803/58ee660c1a28ab2c648b462f/html5/thumbnails/17.jpg)
Object dynamic properties
Object
Guid
Property 1
Property 2
Property Meta Data • Tags
• Persistent • Client transfer
• Type
• Long
• Name • “property 2”
• Version
• 568
![Page 18: MMO Design Architecture by Andrew](https://reader034.vdocuments.site/reader034/viewer/2022050803/58ee660c1a28ab2c648b462f/html5/thumbnails/18.jpg)
Define the properties
![Page 19: MMO Design Architecture by Andrew](https://reader034.vdocuments.site/reader034/viewer/2022050803/58ee660c1a28ab2c648b462f/html5/thumbnails/19.jpg)
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
![Page 20: MMO Design Architecture by Andrew](https://reader034.vdocuments.site/reader034/viewer/2022050803/58ee660c1a28ab2c648b462f/html5/thumbnails/20.jpg)
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
![Page 21: MMO Design Architecture by Andrew](https://reader034.vdocuments.site/reader034/viewer/2022050803/58ee660c1a28ab2c648b462f/html5/thumbnails/21.jpg)
AUTO SYNCHRONIZATION FRAMEWORK (SERVER <-> CLIENT)
![Page 22: MMO Design Architecture by Andrew](https://reader034.vdocuments.site/reader034/viewer/2022050803/58ee660c1a28ab2c648b462f/html5/thumbnails/22.jpg)
Synchronization concept
Server Room Player.Position = (10, 20)
Player.OnUpdatePosition(10, 20) { model.MoveTo(10, 20); }
Client
![Page 23: MMO Design Architecture by Andrew](https://reader034.vdocuments.site/reader034/viewer/2022050803/58ee660c1a28ab2c648b462f/html5/thumbnails/23.jpg)
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…
![Page 24: MMO Design Architecture by Andrew](https://reader034.vdocuments.site/reader034/viewer/2022050803/58ee660c1a28ab2c648b462f/html5/thumbnails/24.jpg)
Thread pool workers
Personal Room
Coffee Room Downtown
Room
Sync
Other
Sync
Thread Pool
Other
Sync
Other
Sync
Sync
Other
ROOMS
TASK
QUEUES
WORKERS
![Page 25: MMO Design Architecture by Andrew](https://reader034.vdocuments.site/reader034/viewer/2022050803/58ee660c1a28ab2c648b462f/html5/thumbnails/25.jpg)
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
![Page 26: MMO Design Architecture by Andrew](https://reader034.vdocuments.site/reader034/viewer/2022050803/58ee660c1a28ab2c648b462f/html5/thumbnails/26.jpg)
Object change-set
Object Position
Energy
Gold
Change Set
SYNCHRONIZATION SCHEDULER
SetProperty(Position, (1, 2))
Sync Task
![Page 27: MMO Design Architecture by Andrew](https://reader034.vdocuments.site/reader034/viewer/2022050803/58ee660c1a28ab2c648b462f/html5/thumbnails/27.jpg)
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.
![Page 28: MMO Design Architecture by Andrew](https://reader034.vdocuments.site/reader034/viewer/2022050803/58ee660c1a28ab2c648b462f/html5/thumbnails/28.jpg)
NETWORK MESSAGE DISPATCHING SYSTEM
![Page 29: MMO Design Architecture by Andrew](https://reader034.vdocuments.site/reader034/viewer/2022050803/58ee660c1a28ab2c648b462f/html5/thumbnails/29.jpg)
Custom message structure
Login
- Username - Password
Synchronize
- Type - Properties
Buy Item
- ItemType - Quantity
Chat
- Message
RequestFriend
- FriendGuid
Serializer (Thrift, Protobuf, Json, XML)
Network package
Encryption
![Page 30: MMO Design Architecture by Andrew](https://reader034.vdocuments.site/reader034/viewer/2022050803/58ee660c1a28ab2c648b462f/html5/thumbnails/30.jpg)
Message factory
Server
Send
Client
Receive
Serialize
Deserialize
Login
- Username - Password
Login
- Username - Password
OnAuthen
OnMove
OnRun
Login
Authen
Move
Run
Message Handlers
OnLogin
![Page 31: MMO Design Architecture by Andrew](https://reader034.vdocuments.site/reader034/viewer/2022050803/58ee660c1a28ab2c648b462f/html5/thumbnails/31.jpg)
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
![Page 32: MMO Design Architecture by Andrew](https://reader034.vdocuments.site/reader034/viewer/2022050803/58ee660c1a28ab2c648b462f/html5/thumbnails/32.jpg)
• 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
![Page 33: MMO Design Architecture by Andrew](https://reader034.vdocuments.site/reader034/viewer/2022050803/58ee660c1a28ab2c648b462f/html5/thumbnails/33.jpg)
SCALABLE GAMING WITH AWS
![Page 34: MMO Design Architecture by Andrew](https://reader034.vdocuments.site/reader034/viewer/2022050803/58ee660c1a28ab2c648b462f/html5/thumbnails/34.jpg)
Pay as you Scale
![Page 35: MMO Design Architecture by Andrew](https://reader034.vdocuments.site/reader034/viewer/2022050803/58ee660c1a28ab2c648b462f/html5/thumbnails/35.jpg)
Core Game Backend
![Page 36: MMO Design Architecture by Andrew](https://reader034.vdocuments.site/reader034/viewer/2022050803/58ee660c1a28ab2c648b462f/html5/thumbnails/36.jpg)
Scale It Way Out
![Page 37: MMO Design Architecture by Andrew](https://reader034.vdocuments.site/reader034/viewer/2022050803/58ee660c1a28ab2c648b462f/html5/thumbnails/37.jpg)
Amazon Elastic Beanstalk
![Page 38: MMO Design Architecture by Andrew](https://reader034.vdocuments.site/reader034/viewer/2022050803/58ee660c1a28ab2c648b462f/html5/thumbnails/38.jpg)
Thank You
![Page 39: MMO Design Architecture by Andrew](https://reader034.vdocuments.site/reader034/viewer/2022050803/58ee660c1a28ab2c648b462f/html5/thumbnails/39.jpg)
Thank You ^_^