Live data from Hacker News

Make any site multiplayer in a few lines. Serverless WebRTC matchmaking

oxism.com

31–40 of 71 posts

Re: Make any site multiplayer in a few lines. Serverless WebRTC matchmaking

#33
post #30
post #19

Earlier quoted context omitted.

I've always been obsessed with true P2P WebRTC with QR codes but, at least back in the day, Firefox fails the offer under a very short timeout (~5 secs IIRC) which made out of band signaling completely impossible.

I have done this a couple of weeks ago on firefox and it worked fine even with a 1 minute delay. An even easier way to share the SDP offer, at laest when the clients are in physical proximity, is using a data over sound library like ggwave.

We've circled back to dial-up modems :D

Re: Make any site multiplayer in a few lines. Serverless WebRTC matchmaking

#34

It'd be cool if you could easily publish multiplayers games to itch.io or similar websites from Godot or Unity and have automatic matchmaking: the first player to visit the game pages gets matched automatically with the next, and so on. Is there anything like that?

I used Trystero in exactly this way for https://www.farmhand.life/!

Re: Make any site multiplayer in a few lines. Serverless WebRTC matchmaking

#35
post #10

Just a reminder that this kind of user-to-user interaction feature makes your website a "social network" according to UK regulation (and Mississippi's, and more jurisdictions coming soon), and therefore you must get copies of government ID of your users so that you can deny them access if they are underage, and rattle them to the police if you suspect they are committing thought crime by sending certain fruits. Obey…

how are these laws enforced outside of the UK and Mississippi?

Re: Make any site multiplayer in a few lines. Serverless WebRTC matchmaking

#36
post #6

WOW this is cool! I love this, but as a nitpick, how scalable is it to do each connection peer to peer? Doesn't that mean that I have to keep a stream connection open for everyone who I want to include in the room?

> how scalable is it to do each connection peer to peer?

I can tell you roughly how it works for webrtc video calls.

If you're in a 5-person peer-to-peer webrtc video call where you receive 4 streams of video, you also need to send 4 streams of video. This is scalable in a sense; the uplink and downlink requirements are equal.

The problem comes if you're in a 100-person meeting, and the application logic has hidden 95 people's video to save on bandwidth. In that case, while you'd only receive 4 streams of video you'd have to send 99.

In practice, webrtc video calling often uses an 'SFU' or 'Selective Forwarding Unit' where you send one video stream to the vendor's cloud server and they forward it to the other people in the meeting. This also benefits people on asymmetric connections, and mobile users where uploading costs battery life, and users behind highly restrictive firewalls where webrtc's NAT traversal fails to work.

Re: Make any site multiplayer in a few lines. Serverless WebRTC matchmaking

#39
post #6

WOW this is cool! I love this, but as a nitpick, how scalable is it to do each connection peer to peer? Doesn't that mean that I have to keep a stream connection open for everyone who I want to include in the room?

> how scalable is it to do each connection peer to peer? I can tell you roughly how it works for webrtc video calls. If you're in a 5-person peer-to-peer webrtc video call where you receive 4 streams of video, you also need to send 4 streams of video. This is scalable in a sense; the uplink and downlink requirements are equal. The problem comes if you're in a 100-person meeting, and the application logic has hidden 9…

> This is scalable in a sense; the uplink and downlink requirements are equal.

But don't most home connections have a slower uplink than downlink? Mine certainly does.

Re: Make any site multiplayer in a few lines. Serverless WebRTC matchmaking

#40
post #10

Just a reminder that this kind of user-to-user interaction feature makes your website a "social network" according to UK regulation (and Mississippi's, and more jurisdictions coming soon), and therefore you must get copies of government ID of your users so that you can deny them access if they are underage, and rattle them to the police if you suspect they are committing thought crime by sending certain fruits. Obey…

Agree, with caveat - Obey the law, unless that law is made by a tyrant!
Post reply on HN