I'm currently working on a fast-paced multiplayer sports game using Godot. The players' movements and actions are already being synchronized with WebSockets and Channels using a Node.js server. I now want to replace (part of) the WebSocket communication and synchronization between the clients by WebRTC to lower latency. I have been looking at this demo project by Godot as I think it may provide what I need.
However, I'm a bit confused about how to proceed and I have two questions based on the assumed knowledge I currently have:
- Can I re-use the same WebSocket Channel to send WebRTC messages or do I need to create a separate WebRTC Channel for that?
- How do I know the "address" of other players that I want to send WebRTC messages to? Should I get their id from the channel or use an IP address, or how does that generally work?
If possible, please also let me know whether some my assumptions are wrong and why.
PS. I wanted to add the webrtc
tag to this question but it does not exist yet and I don't have enough reputation to add it. If there is anyone with enough reputation to add it that would be great.