Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Related Books

Free with a 30 day trial from Scribd

See all

Related Audiobooks

Free with a 30 day trial from Scribd

See all

A Practical Architecture Design for MMO Casual Game

  1. 1. • Happy Me • Architecture Overview • Architecture Detail Object Management System Server-Client Data Synchronization Network Message Dispatching System
  2. 2. • MMO casual game • Room-based active server • Web-based Unity3D client • Run on social platform
  3. 3. • 3 system and framework developers • 4 game developers • 12 months of development
  4. 4. Internet Database Client Game Servers
  5. 5. Player Data Player Data Game Logic Player Data Server Side Client Side
  6. 6. Object Network Message Management Dispatching System System Auto MAKESynchronization OUR LIFE EASIER Framework
  7. 7. • 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
  8. 8. Database Database Model Model Controller Network Controller (gameplay logic) Messages (graphic logic) 3D View View Models Server Side Client Side Unity3D
  9. 9. Game Model Objects Object View Rooms Views Game Controller Modules Logic
  10. 10. 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
  11. 11. Object Views Game Objects Object Modules Rooms
  12. 12. • A container of properties • Serialize to and deserialize from JSON • Hierarchy relationship (parent-child)
  13. 13. Property Meta Data • Tags • Persistent • Client transfer Guid • Type Object Property 1 • Long Property 2 • Name • “property 2” • Version • 568
  14. 14. 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
  15. 15. Pros • MVC design pattern practice • Fully customizable property system • Manage game world into one single system Cons • Challenge to manage huge number of objects
  16. 16. Server Player.Position = (10, 20) Room Player.OnUpdatePosition(10, 20) { Client model.MoveTo(10, 20); }
  17. 17. • 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
  18. 18. Coffee Downtown Personal ROOMS Room Room Room Sync Other Sync TASK Other Sync Sync QUEUES Sync Other Other WORKERS Thread Pool
  19. 19. 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
  20. 20. Position SetProperty(Position, (1, 2)) Object Energy Gold Change Set SYNCHRONIZATION Sync SCHEDULER Task
  21. 21. Pros • Automatic synchronization property changes • Optimal data transfer • Best use for active server game Cons • Overhead to determine what has changed since last sync.
  22. 22. Login Synchronize Buy Item Chat RequestFriend - Username - Type - ItemType - Message - FriendGuid - Password - Properties - Quantity Encryption Network package Serializer (Thrift, Protobuf, Json, XML)
  23. 23. Login Server - Username - Password OnLogin Message Send Handlers Serialize Login OnAuthen Authen Move Run OnMove Deserialize OnRun Login Client - Username - Password Receive
  24. 24. 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
  25. 25. • 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

Editor's Notes

  • Review lại flow
  • ×