34 points by webrtc_gaming 5 months ago flag hide 13 comments
jaukia 5 months ago next
Nice job! I've been curious about building multiplayer games with WebRTC. Any resources you'd recommend for someone just starting out?
richard 5 months ago next
I'd suggest checking out 'WebRTC for Game Developers' by Sam Dutton. It's a great starting point for understanding how WebRTC can be used for multiplayer gaming. Some other resources to look into include: 1. WebRTC samples on GitHub (<https://github.com/webrtc/samples>), 2. WebRTC webinars by Peer5 (<https://peer5.com/webinars/>), and 3. 'Building Multiplayer Games with WebRTC' by Dominic Engel on YouTube.
gorilla 5 months ago prev next
WebRTC is definitely an interesting technology to build multiplayer games. We use it for our Gorilla Game Engine and it has been fantastic from a performance perspective. I'd suggest taking a look at the ARTICLEREF_Gorilla_Engine_link to get started with a solid foundation.
jaukia 5 months ago next
That's great to hear. I'll check out the Gorilla Game Engine. Thanks!
adarsh 5 months ago prev next
Have you looked into implementing matchmaking within your game? It could make it easier for users to find one another and start playing.
jaukia 5 months ago next
Yes, that's on my to-do list. I plan to try and implement matchmaking using a WebRTC signaling server. Do you have any additional recommendations on that front?
adarsh 5 months ago next
Some signaling server options to look into include: 1. EasyRTC (<https://easyrtc.com/>), 2. Socket.IO (<https://socket.io/>) with the WebRTC adapter, and 3. signalmaster (<https://github.com/fippo/signalmaster>). I'd suggest setting aside a bit of time to look into each and find which one suits your needs best.
carol 5 months ago prev next
I'm curious about scaling with WebRTC. Have you run into any issues as you've tested your game?
jaukia 5 months ago next
As long as you've set up a TURN server for fallback relaying, WebRTC should scale quite well. It's best if you implement autoscaling for your signalling/STUN/TURN servers depending on the load. I'm also considering adding IPv6 support to my game for additional scalability.
amit 5 months ago prev next
How much control did you have over the latency in your game? I'd think minimizing latency is one of the main use cases for real-time gaming.
jaukia 5 months ago next
You can definitely implement techniques to reduce latency in a WebRTC-based game. Some options include using local IP address instead of NAT traversal, using WebRTC's PeerConnection API (<https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API/PeerConnection>), or using a UDP transport layer protocol like KCP (<https://github.com/KCP-Project/libkcp>). I go into detail about these options in my blog post.
rohan 5 months ago prev next
Do you have plans to make your multiplayer game SDK available to other developers? I've been looking for something similar to get a head start on a project I'm working on.
jaukia 5 months ago next
I haven't quite considered making it into an SDK yet, but I will be making the codebase available open-source, so you and others can fork it and build upon it. I'll provide a link once I've got the source code uploaded to GitHub.