Reliable vs Unreliable, Ordered vs Unordered
You have now seen both extremes. TCP makes every byte reliable and ordered, whether you need that or not. Plain UDP makes nothing reliable and nothing ordered. A game server lives in between, and it chooses message by message.
The rule
If a newer message replaces it, send it unreliable; if not, reliable.
Two questions decide every message:
- Reliable? Must it arrive? It must if nothing sent later makes it pointless.
- Ordered? Must it be applied in the order it was sent, relative to other messages? Chat lines must be; independent events may not care.
The answers map onto the channels most game networking libraries offer:
| Manja Arena message | Replaced by a newer one? | Channel |
|---|---|---|
| Kite positions (snapshot) | Yes, next tick | Unreliable, sequenced: keep only the newest |
| Player inputs | No, but each goes stale within a few ticks | Unreliable, with the last few repeated in every packet |
| "Kite 9 cut by kite 4" | No | Reliable |
| Chat line | No, and order matters | Reliable, ordered |
| Buying coins in the shop | No, and money is involved | TCP, over HTTPS to the shop service |
Sequenced means: if a packet arrives that is older than the newest one already seen, throw it away. It costs nothing, and it stops a late snapshot from yanking kites backwards.
Inputs deserve a closer look. Each one matters, but waiting a round trip for a resend would make it arrive too late to be useful. So every input packet also repeats the previous three inputs. If one packet is lost, the next one, only a tick later, still delivers everything it carried, with no waiting at all.
TCP offers exactly one combination: reliable and ordered, for everything on the connection. That suits the shop and the lobby, and it is wrong for kite positions.
The shortcut
Ask the two questions in order, "Replaced?" then "Does order matter?", and the channel falls out.
Replaced?
No later message makes the result pointless, so it must be reliable.
Drills
Answer fast — trust the rule.
Which channel suits the kite-position snapshots?
Which channel suits in-match chat lines?
What does an unreliable, sequenced channel do with a packet older than the newest one it has already seen?
Why does Manja Arena repeat the last three inputs in every input packet instead of resending lost ones?
What combination does TCP give every message on a connection?
Remember
- If a newer message replaces it, send it unreliable; if not, reliable.
- Ask "Replaced?" and then "Does order matter?".
- Trap: one channel for everything. All-reliable adds delay; all-unreliable loses events.
