r/linuxmemes • • May 07 '26 • Popcorn 1

linux not in meme Why Though?!

Post image
3.7k Upvotes

393 comments sorted by

View all comments

Show parent comments

321

u/Outrageous-Log9238 May 07 '26 edited May 07 '26

And TCP's guarantees are just useless for some applications. In a multiplayer game for example, by the time you figure out a packet was dropped, it's no longer relevant and not worth sending again.

68

u/jondbarrow May 07 '26

You can also just add your own reliability system at the application layer if you really want to. This is what Nintendo used for the Wii U/3DS, games connect to the game server with UDP which has a custom reliability system that lets some packets act more-or-less like TCP, while selectively allowing some packets to remain unreliable

33

u/Sexy_McSexypants May 07 '26

even sadder that nintendo's multiplayer is famously super laggy

11

u/jondbarrow May 07 '26

Unfortunately you can only get so far with p2p connections. They definitely could have improved things (and the multiplayer software they use DOES have the ability to use dedicated servers instead of p2p connections, they just never used it for some reason) but if the p2p host has terrible connections then the whole lobby suffers

Also to make matters worse, for early games on the Wii U/3DS the p2p software they were using wasn’t even made by them, it was licensed and originally designed in the early 2000s. They only somewhat recently (as in, later editions to Nintendo Network) started using their own in-house p2p software (though it still borrows concepts from the original one they used)

3

u/bittercripple6969 May 07 '26

There are extremely niche ways to get better performance, like the deterministic lockstep architecture that Factorio uses, but that will not work for the vast majority of online games.

→ More replies (2)

2

u/Laughing_Orange Arch BTW May 07 '26

You want lag in your platformer because someone else is using McDonald's WiFi? No? Well tough luck.

1

u/shamboozles420 May 08 '26

It's pretty much what HTTP3/QUIC does

1

u/Spare-Plum May 12 '26

Yup, this is the way for a lot of real-time systems. Most packets will get there, some packet loss is acceptable, and important packets are verified

12

u/sup3r_hero May 07 '26

That’s funnily the same case for Radar data in air traffic management systems. All UDP because the data becomes useless very quickly

4

u/drillbit7 May 08 '26

same with streaming video. Just drop the frame (or group of frames), deal with the artifacts. Better than lagging/buffering while waiting for the retransmission.

1

u/dmills_00 May 13 '26

Broadcast video in the production domain is often UDP multicast at 12Gb/s per flow, sometimes we have dual redundant links on physically separate infrastructure for fault tolerance, and dropped packet resilience. The fact that every camera might be outputting a 12Gb/s multicast flow, and expect no packet loss tends to make IT department (And some switch vendors) heads explode.

Lots of PtP timing in that space as well.

On the audio side (actually MORE critical), we do much the same thing, but will sometimes operate over unreliable WAN networks with each packet being sent twice with a few milliseconds of delay. At the receiver we reconstruct based on sequence number (which is tied to time), it actually works well with a local GPS derived time at each end of the link.

Then you have SRT, which is UDP with an application specific layer on top for retry.

4

u/Kevdog824_ May 08 '26

Voice chat is another good example. Not worth replaying the packet for 0.5 seconds of voice

2

u/Devatator_ May 08 '26

So fun fact, Minecraft does use TCP for its multiplayer https://minecraft.wiki/w/Java_Edition_protocol/Packets

1

u/IWillBeNobodyPerfect May 08 '26

bedrock uses raknet. tcp is much easier to work with though on java edition.

1

u/tomysshadow May 08 '26

You just reminded me of the stupid "Minecraft registries" hoax https://youtu.be/XUw3vNcsh6k?si=gR_00oA46vFD6DVP

→ More replies (1)

2

u/Opposite_Mall4685 May 08 '26

TCP is really great for turn based strategy games though

1

u/Outrageous-Log9238 May 08 '26

Yeah and probably RTS too if it's not too fast pased.

2

u/Chrazzer May 08 '26

Or video calls. No point in re-delivering old frames that got lost. Just send the next frame, whatever arrives arrives.

2

u/flipperipper May 09 '26

Half true, I currently work on a multiplayer game at a AA company and though it's true that UDP is used for most things, movement and moment to moment gameplay is usually UDP, Taco is also used for some things. Chat messages in game is a good example, as is authentication. For important single moment gameplay events you can also use Reliable UDP which aims to keep the guarantee of receiving the packet while being slightly more flexible and being faster than tcp, used for things like sending calls to play effects or letting a client know they've been stunned. You don't want a stun to not register or an effect to be missing if you drop a package.

1

u/Outrageous-Log9238 May 09 '26

Cool! That's pretty much how I expected it to go but haven't looked into it. Nice to hear from someone who actually knows.

1

u/Exatex May 09 '26

for some things, like „round is over“ or „you lost health“ you probably want to ensure the message gets delivered, even if its 1000ms delayed?

1

u/Outrageous-Log9238 May 09 '26

I really have not looked into this but my guess is that the packets just include player and round states, including health, location and so on. Gets more complicated when you want to include things like who shot who. Of course a seperate TCP connection is an option too, or implementing your own reliability on top of UDP.

1

u/mad_cheese_hattwe May 10 '26

Also RTOS control. If the CRC check fails just wait for the next control cycle update in a few ms.

1

u/lolslim May 10 '26

Thanks I just commented asking if multiplayer games are mainly udp packets

1

u/Inevitable-Switch-13 May 12 '26

Even just fundamentals of udp for dns. Vpn access easier with udp and faster. Video streaming would love to see a frame from 30 seconds ago randomly becauae it went a differing path.

→ More replies (10)