11.Traffic auto-control function (Throttling)

ProudNet features an automatic traffic control function (throttling) that helps limit network congestion and server crashes even at the severe networking condition and secures the most pleasant networking experience when signaling speed is good.

ProudNet provides 11.2 Transmitting the latest message only and 11.1 Prioritizing message transmission functions.

Besides, 6.11 Detecting transmission overflows can be a good alternative solution too.

11.1Prioritizing message transmission

ProudNet provides a function that prioritizes message transmission.

The policies around prioritizing message transmission are as followed.

11.1 Prioritizing message transmission can be used at the following events.

Voice Chatting

Realtime Content Downloadable Game

그림 11-1If you wisely use the realtime content download, you can reduce the cost of software distribution and installation. One of good examples is Guild Wars.

Synchronizing the position of massive numbers of characters

그림 11-2Massive character objects in one screen, Ikusagami (offline single game from Genki)

The parameter that calls for RMI, Proud.RmiContext has a member variable, Proud.RmiContext.m_priority. All it takes is to set the priority of message transmission in this variable. The priority of message transmission is one of values of Proud.MessagePriority.

Proud.RmiContext.ReliableSend,Proud.RmiContext.UnreliableSend is a global variable. It is recommended to separately create Proud.RmiContext object instead of editing m_priority directly.

11.2Transmitting the latest message only

Transmitting the latest message only of ProudNet is a function that only transmits the latest message and cancels out all other useless messages.

This function becomes useful when sending the position of game character to other hosts in online game.

The below picture shows the case which the position of character(Pos) is already transmitted when t=1. And, when t=2 and t=3, the character's position are not transmitted and they are piled in host's memory as pending.

And at t=4, the character's position of t=2 and 3 become meaningless and don't need to be transmitted to other hosts since only the position at t=4 would matter. When this happens, it is better to cancel sending the position of t=2 and 3 then just send the position of t=4.

그림 11-3Example for sending the latest message only

To use Transmitting the latest message only function, all you need to do is setting the value other than 0 for Proud.RmiContext.m_uniqueID, which is a member variable of Proud.RmiContext that you get when RMI is called. Before the message gets piled in sending queue by RMI call, it automatically deletes other messages with the same Proud.RmiContext.m_uniqueID then places only the latest message. Most commonly used case would be inserting a character's ID at Proud.RmiContext.m_uniqueID.

Since Proud.RmiContext.UnreliableSend is frequently used, we don't recommend you to use it directly. It is much efficient to assign Proud.RmiContext.m_uniqueID after separately creating Proud.RmiContext object.

Below is the example of using Proud.RmiContext.m_uniqueID.

// Bring the copy of RmiContext object for the basic unreliable send.
Proud::RmiContext rctx = Proud::RmiContext::UnreliableSend;

// Insert Player ID of character being controlled by local host at m_uniqueID.
rctx.m_uniqueID = MyPlayerPetID;

// Transmit message through RMI.
C2CProxy.MyRmiFunction(PeerHostID, rctx, blahblah);