RakNet has a nice concept of how to order packets (check out ordering streams for more info)
So what are those
You can think of
ordering streams as something to separate the ordering of packets that have totally no relations to one and another.
So when a game-developer sends data to all the clients it might want to send some data ordered; some data unordered while other data needs to be send sequenced etc.
Let’s take a look at the following data the dev might be sending:
- Player movement, we want to order player movement because we don’t care about old positions.
- Bullet movement, we want to order bullet movement because we don’t care about old positions of bullets.
- Chat messages, we want to order chat messages because it is nice to see text in the correct order.
Player movement and chat messages are totally not related to one and another. You don’t want the movement packets to be disturbed if chat messages are dropped.
It would be nice if we can order player movement, chat messages separated from each other.
This is exactly where
ordering streams are for.
We should let the user specify on which stream their packets should be ordered.
The user can, for example, say: "Let me put all chat messages on
ordering stream 1 and all movement packets on
ordering stream 2".
This way you can have different types of packets ordered separately from each other.
Why let the user control streams?
- Let’s take for example a player who is shooting bullets at something.
It makes absolute sense to order both player movement and bullet position in the same
You wouldn’t want the shot to originate from the wrong position.
So you’d put player firing packets on the same stream as movement packets (stream 1),
and that if a movement packet arrived later than a firing packet but was actually sent earlier the firing packet would not be given to you until the movement packet arrived.
- We can’t interpreter what the contents of packets are whereon we decide where to order packets
Those ordering stream should be implemented so that both reliable and unreliable channels can make use of this. If this is implemented we support all delivery methods we have in our enum.
Please let us here your option on this subject by commenting below.