In a massively multiplayer online game or MMO, normally a massive number of game clients play their game in a single game world. In a game like this, sending character information to every client via P2P excessively increases the amount of network traffic and most of all, it doesn't have to be transmitted to every client in the first place since client doesn't have to see characters of other clients out of sight.
Therefore, it is much efficient to send character information to only clients within your sight in the gameplay. In the screenshot below, client B sends the status of character under control to server. Then server shows the position of character only to the ones within the sight. At this case, it is client A and C. And client D doesn't receive the information since he is out of sight range. By doing this, you can save the amount of network traffic against client D. This process is called area filtering.
Visible area filtering of MMO via server”
Visible area filtering can be summarized as followed.
- Sends your character information from client to server.
- Server stores the status of each character and sends the information only to the clients who can only see your character.
Above is a traditional way of visible area filtering which uses server. The disadvantage of using this method is that server must Multicast for every client thus it most likely causes overload. But ProudNet can enhance the performance with its high performance P2P grouping and communication technology. Together it is called Hybrid Phase Networking Method (Registered patent No. 10-0812019). And this method can only be used in a project using ProudNet.
To briefly explain Hybrid Phase Networking, it is a method that doesn't Multicast through server but directly transmits data to other clients via P2P as limiting the range of Multicast to visible area.
Visible area filtering in MMO (Hybrid Phase Networking)
Synchronization method applied from ProudNet and Hybrid Phase Networking is as followed. To help your understanding better, we will explain it along with source location in Character synchronization in 3D world.
- Server must have a space to save character's information of each client. (Refer to CRemoteHero, server source of Character synchronization in 3D world)
- Client must have its own character (Refer to CLocalHero, server source of (Character synchronization in 3D world) and other clients' synchronized characters (Refer to CLocalHero, server source of Character synchronization in 3D world). And server must have Proud.HostID variable that ties all ‘clients who can see the character' as P2P group for each character. (Refer to CRemoteHero.m_viewersGroupID, server source of Character synchronization in 3D world)
- Client sends its character's position to server in a timed manger. And server saves it. (Refer to CLocalHero::FrameMove, client source of Character synchronization in 3D world)
- Server timely checks whether or not the character under control of client is within the visible area. (Refer to CRemoteClient::FrameMove, server source of Character synchronization in 3D world) When server confirms in or out of character from visible area, it sends RMI containing message of apprearance or disappearance of character to its associated client and adds or removes the client to or from the group of ‘clients who can see the character'.
- If the character is indeed within visible area from the client then it sends appearance RMI (Refer to RemoteHero_Appear RMI of synch_world_sample의 RemoteHero_Appear RMI) and adds the client to the group of ‘clients who can see the character'. (Refer to CRemoteClient::FrameMove, server source of Character synchronization in 3D world).
- If the character is out of visible area from the client then it sends disappearance RMI (Refer to RemoteHero_Disappear RMI of Character synchronization in 3D world) and removes the client from the group of ‘clients who can see the character' (Refer to CRemoteClient::FrameMove, server source of Character synchronization in 3D world)
- When a client enters the game world for the first time, client must obtain P2P group ID of ‘clients who can see the character'. (Refer to NotifyLocalHeroViewersGroupID RMI of Character synchronization in 3D world) Based on this value, client timely sends its character's position to P2P. Dead Reckoning will come handy to handle this. (Refer to CClient::P2P_LocalHero_Move, client source of Character synchronization in 3D world)
- If the character of client appears in the game world then its condition is same as ‘character is within the visible area of client.' (Refer to CSynchWorldServerDlg::RequestLocalHeroSpawn, server source of Character synchronization in 3D world) On the contrary, when the client leaves the game world then it would be considered as ‘character is out of the visible area of client'. (Refer to CSynchWorldServerDlg::OnClientLeave , server source of Character synchronization in 3D world)
When using Hybrid Phase Networking, there could be excessive amount of transmission from one client to another. In order to prevent this, please refer to Traffic auto-control function (Throttling) or Performance difference between Direct P2P and relay communication.