Reputation: 3044
I'm trying to create a real-time 3d multiplayer game that should update all connected players' movement every frame.
So far, I used socket.io for sharing data between players but other players look kind of skippy and not smooth when they move.
I basically use socket.emit()
to send my movement(position, rotation) data to the server and then the server sends back all other players' movement data using client.emit()
.
Will the performance improve if I use WebRTC's RTCDataChannel
instead which allows the P2P communication between players?
Upvotes: 2
Views: 1291
Reputation: 1419
An RTCDataChannel setup for unreliable communication (UDP) will be faster than socket.io (TCP) since dropped packets do not need to be waited for. There are no additional security risks.
Upvotes: 1