News for hackers. Stuff that matters.
Re:WebRTC for the Curious (2020) by deadbabe on Friday January 05, 2024 @12:05AM (#38875899)
It’s unfortunate that for browser based multiplayer gaming it’s not feasible to use something like WebRTC and we must stick to TCP based connections.
Re:WebRTC for the Curious (2020) by boushley on Friday January 05, 2024 @12:09AM (#38875923)
Really? WebRTC DataChannels seem like they could fulfill your needs. What is it that prevents using something like WebRTC Data Channels and forces you to use TCP based connections?
Re:WebRTC for the Curious (2020) by ssss11 on Friday January 05, 2024 @12:27AM (#38876027)
Agreed. I was using webrtc data channels for a messaging app and it’s great - the data sent could simply be multiplayer co-ord’s, actions etc instead.
Re:WebRTC for the Curious (2020) by deadbabe on Friday January 05, 2024 @08:55AM (#38879049)
Oh, you’re right!
Re:WebRTC for the Curious (2020) by mikhmha on Friday January 05, 2024 @09:45PM (#38887841)
So when I looked into it last month - its true DataChannels would be the answer. But I couldn't find any "nice" abstraction in the language i'm using for it. like I just can't get some standalone WebRTCDataChannels abstraction - many WebRTC libraries don't have implementation for this or its all very specialized for audio transfer. There is a route of using some standalone WebRTC gateway service that your application can send messages to (I think this is the purpose of Janus?) - blah blah point is: its not easily done. Not in Elixir so far anyways.

And the second part of it is - I'm sure its easily done but at this point there is some incentive to keep whatever implementation you have to yourself.

Or maybe I missed something and I should try looking into it again.

Re:WebRTC for the Curious (2020) by Sean-Der on Friday January 05, 2024 @10:22PM (#38888071)
There is an Elixir version of WebRTC available. It is still early days, but your feedback/asks would be monumental in making it better!

https://github.com/elixir-webrtc

Re:WebRTC for the Curious (2020) by ssss11 on Sunday January 07, 2024 @01:40AM (#38899072)
It is a minefield you’re right. I just implemented my own version of it with trial and error.
Re:WebRTC for the Curious (2020) by ninjin on Friday January 05, 2024 @12:25AM (#38876016)
I am pretty darn sure it is feasible:

https://github.com/nathhB/nbnet

In fact, I am on the hunt for a minimal C library to do exactly this for a hobby project and nbnet is the best candidate I have found so far. The only drawback so far is that I would love to have voice support and nbnet (rightfully so to keep it simple) does not provide it and I would have to roll it on my own.

Re:WebRTC for the Curious (2020) by pthatcherg on Friday January 05, 2024 @10:48AM (#38880284)
There's also WebTransport
Re:WebRTC for the Curious (2020) by mikhmha on Friday January 05, 2024 @09:36PM (#38887787)
Agreed. I really looked into if WebRTC would be possible for the game I'm trying to make but currently its not as easy as people make it out to be. fortunately - the communication channel is easily abstracted, so I wait for the day i finally get the abstraction i want.