1 mmorpg servers. 2 mmorpgs features avatar avatar levels levels rpg elements rpg elements mission...
TRANSCRIPT
1
MMORPG ServersMMORPG Servers
2
MMORPGs FeaturesMMORPGs Features AvatarAvatar LevelsLevels RPG ElementsRPG Elements MissionMission ChattingChatting Society & CommunitySociety & Community FriendsFriends CombatCombat NPCs / MonstersNPCs / Monsters Experience PointsExperience Points Extended Game ContentsExtended Game Contents Online Customer Services (GM)Online Customer Services (GM)
3
MMORPGs Technical ElementsMMORPGs Technical Elements
Client-server ArchitectureClient-server Architecture ServersServers Network BandwidthNetwork Bandwidth Network Data PacketNetwork Data Packet Network SecurityNetwork Security GraphicsGraphics DatabaseDatabase
4
MMORPG ServersMMORPG Servers
Stand Alone ServersStand Alone Servers Distributed SystemDistributed System
5
Standalone ServerStandalone Server
Using a Set of Large Servers as the Game Using a Set of Large Servers as the Game ServersServers
Each Server Plays as a Single FunctionEach Server Plays as a Single Function
Login server
internet
Game play CommunityDatabase
6
Distributed System - ConceptDistributed System - Concept
Distributed PC ClustersDistributed PC Clusters
servers
internet
Game play servers
servers
Database servers
Login servers
7
Distributed PC ClustersDistributed PC Clusters
1-U1-U Web Server Based on PC ArchitectureWeb Server Based on PC Architecture Two CPUsTwo CPUs Two Network IPsTwo Network IPs
1U server
Net IP 1 Net IP 2Internal LAN Internet
8
Distributed System - FeaturesDistributed System - Features
Distributed PC ClustersDistributed PC Clusters– Two IPsTwo IPs
ScalabilityScalability Fault ToleranceFault Tolerance Load BalanceLoad Balance Dynamic ZoningDynamic Zoning ““Blade Servers”Blade Servers”
9
Distributed System - ScalabilityDistributed System - Scalability
Serve concurrent 500 users
Serve concurrent 1000 users
Regional Operation ConsiderationRegional Operation Consideration Cost EffectiveCost Effective Flexible CapacityFlexible Capacity
10
Distributed System – Fault ToleranceDistributed System – Fault Tolerance
All Servers Can Not Be Down in AnytimeAll Servers Can Not Be Down in Anytime For Distributed Servers, Every Job Must Be For Distributed Servers, Every Job Must Be
Transferred Between ServersTransferred Between Servers For Standalone Server, Use Redundant PolicyFor Standalone Server, Use Redundant Policy
11
Master server
Slave server A
Slave server B
!
!
Inte
rnal
LAN
Inte
rne
t
12
Master server
Slave server A
Slave server B
X
Inte
rnal
LAN
Inte
rne
t
13
Server on duty
Server off dutyZZZ
!
!
Redundant PolicyRedundant Policy
14
Server off duty
Server on duty
X
Redundant policyRedundant policy
15
Master servers
Slave server A
Slave server B
Inte
rnal
LAN
Inte
rne
t
.
.
16
Distributed System – Load BalanceDistributed System – Load Balance Distributed MMOGs Always Do the Load Distributed MMOGs Always Do the Load
Balance by In-house ApproachBalance by In-house Approach Load ?Load ?
– CPU boundCPU bound– Memory boundMemory bound– Network bandwidthNetwork bandwidth
1 1 server = 500 concurrent playersserver = 500 concurrent players
10 servers = 5000 concurrent players10 servers = 5000 concurrent playersX
!! It’s very important to move the jobsIt’s very important to move the jobs on a crowded server to another oneson a crowded server to another ones
17
Master server
Slave server A
Slave server B
Inte
rnal
LAN
Inte
rne
t
Load balance – case 1
18
Master server
Slave server A
Slave server B
!
!
Inte
rnal
LAN
Inte
rne
t
Load balance case 2
19
Master server
Slave server A
Slave server B
Inte
rnal
LAN
Inte
rne
t
Load balance case 2
20
Zone ConceptZone Concept A “Zone” is Logically a Region of Game A “Zone” is Logically a Region of Game
Happening on ServersHappening on Servers We Always Map the “Zone” to a Physical 3D We Always Map the “Zone” to a Physical 3D
SceneScene A Zone is Not Really a Physical Hardware A Zone is Not Really a Physical Hardware
ServerServer But a Software Region that the Players But a Software Region that the Players
Communicating Directly (in the same Communicating Directly (in the same memory block)memory block)
21
Master server
Slave server A
Slave server B
Inte
rnal
LAN
Inte
rne
t
22
messaging
Server A
Server B
combating
transaction
Zone X
Zone Y
Zone Z
NPC
messaging
Server C
23
Interaction within/between Zones (Game Play)Interaction within/between Zones (Game Play)
Within ZoneWithin Zone– CombatingCombating– ChattingChatting– TransactionTransaction
Between ZonesBetween Zones– MessagingMessaging– Transaction (remote)Transaction (remote)– BankingBanking
24
Server A
Server B
Zone X
Zone Y
Zone Z
NPCServer C
If server B is over-loaded,move the “Zone Y” or “Zone Z” to an available server C
Zone Z
25
Load Balance Using Zone MovingLoad Balance Using Zone Moving Under the Concept of “Zone Moving”, We Under the Concept of “Zone Moving”, We
Can Move the Zones Between Hardware Can Move the Zones Between Hardware Server to Achieve the Load BalanceServer to Achieve the Load Balance
But is This a Total Solution to Solve the Load But is This a Total Solution to Solve the Load Balance ?Balance ?
Condition : Condition :
Server A
Server B
Server C
If server A is over-loaded,the whole server is over-loadeddue that server A is occupied onlyone zone.
Thinking :
“Can we divide the zone into two or more ? “
Zone X
Zone Y
Zone Z
26
Dynamic ZoningDynamic Zoning
Dynamically Adjust the Zones to Meet the Dynamically Adjust the Zones to Meet the Loading RequirementLoading Requirement
Moving Zones between HardwareMoving Zones between Hardware Divide the Zone into Small Ones According to Divide the Zone into Small Ones According to
the Load and Move the Small Ones to the Load and Move the Small Ones to Different HardwareDifferent Hardware
27
My Suggestion about Dynamic Zoning (1)My Suggestion about Dynamic Zoning (1)
A “Zone” is Mapping to a Physical Scene or A “Zone” is Mapping to a Physical Scene or Map (geometry)Map (geometry)
A Zone is Composed by Several GroupsA Zone is Composed by Several Groups A “Group” is a Collection of Players A “Group” is a Collection of Players
((PopulationPopulation)) All Players in the Same Group Running in One All Players in the Same Group Running in One
Same ProcessSame Process Players in Different Group Communicate Players in Different Group Communicate
between Processesbetween Processes– Inter-process communication (IPC) ?Inter-process communication (IPC) ?
28
My Suggestion about Dynamic Zoning (2)My Suggestion about Dynamic Zoning (2)
Group is More Dynamically Due to Based on Group is More Dynamically Due to Based on the Concept of the Concept of PopulationPopulation– CreateCreate– DeleteDelete– MoveMove
29
Zone = A 3D SceneZone = A 3D Scene A 3D SceneA 3D Scene
– 3D models3D models– Moving objectsMoving objects– NPCsNPCs– ……
Zones are Physically Neighboring TogetherZones are Physically Neighboring Together Using Portals to Connect the RelationshipUsing Portals to Connect the Relationship Player Travels between ZonesPlayer Travels between Zones
– Logout current scene and login to another Logout current scene and login to another neighboring zone when stepping on the zone neighboring zone when stepping on the zone portalportal
– Player in client will feel a little hanging during the Player in client will feel a little hanging during the movingmoving
30
Zone PortalsZone Portals
Zone X
Zone YPortal
Portal
31
Zone PortalsZone Portals
Zone X
Zone YPortal
Portal
32
Population GroupPopulation Group
A Data Structure to Contain the PlayersA Data Structure to Contain the Players When a Player Logins into one Zone, He When a Player Logins into one Zone, He
Should Be Assigned into One Available Should Be Assigned into One Available Population Group and Got the IDPopulation Group and Got the ID
Players Should Not Be Moved Between Players Should Not Be Moved Between Population Groups When He Is Staying in this Population Groups When He Is Staying in this ZoneZone
A Zone Can Be Divided into Several GroupsA Zone Can Be Divided into Several Groups Group can be Created/Deleted/Moved by the Group can be Created/Deleted/Moved by the
Servers for Load BalanceServers for Load Balance
33
Players in a ZonePlayers in a Zone
Zone X
P1G1
P5G1
P2G2
P7G2
P12G2
P6G3
P5G3
34
Server A
Server B
Zone X
Group 1Group 2
When a new playerlogins into Zone X, insertthe player into group 2 whichhas space for new comer
35
Server A
Server B
Zone X
Group 1Group 2
But if there are no groups with available space, create a new group for new comers
Group 3
36
Server A
Server B
Zone X
Group 1Group 2Group 3Group 4Group 5Group 6
If the Zone X on Server A is full for new comer, duplicate Zone X on Server B and create a new group for new players
Zone X (2)
Group 7
37
Server A
Server B
Zone X
Group 1Group 2Group 3Group 4Group 5Group 6
Zone X (2)
Group 7Group 8
IPC
Network communication
38
The Challenge of Dynamic ZoningThe Challenge of Dynamic Zoning Physical Terrain and Models Are not Easy to Physical Terrain and Models Are not Easy to
Divide DynamicallyDivide Dynamically– If your zones are coupling with the physical scenes, If your zones are coupling with the physical scenes,
to divide the geometric data in runtime needs some to divide the geometric data in runtime needs some specific algorithms for 3D scenesspecific algorithms for 3D scenes
– From my suggestion, don’t do itFrom my suggestion, don’t do it– Find a mechanism that makes the zone dividableFind a mechanism that makes the zone dividable– And that is the “Population Group”And that is the “Population Group”
One Server Can Have Multiple Zones RunningOne Server Can Have Multiple Zones Running One Zone Can Run on Several Servers One Zone Can Run on Several Servers
– Hard to codeHard to code– Duplicated memory on serversDuplicated memory on servers– Synchronization between serversSynchronization between servers– Data communication overheadData communication overhead
39
The Challenge of Dynamic Zoning (2)The Challenge of Dynamic Zoning (2) Game Play SensitiveGame Play Sensitive Running Players in the Same Zone by Running Players in the Same Zone by
Multiple ProcessesMultiple Processes– Duplicated memory on the same serverDuplicated memory on the same server– Synchronization between processesSynchronization between processes– Data communication between processesData communication between processes
Players’ Attribute Data Should Be Classified Players’ Attribute Data Should Be Classified as :as :– Frequently used between playersFrequently used between players
» Must be duplicated between processesMust be duplicated between processes
– Seldom used between playersSeldom used between players» Send between players when necessarySend between players when necessary
– Locally used by player himselfLocally used by player himself Cross-platform Server API Design*Cross-platform Server API Design*
* Hand drawing on white board