Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: P2P game with VOIP/Teamspeak?  (Read 6140 times)

0 Members and 1 Guest are viewing this topic.

Mr. Moon

  • Newbie
  • *
  • Posts: 15
    • View Profile
P2P game with VOIP/Teamspeak?
« on: October 14, 2010, 05:03:14 am »
I'm currently working on a 2-player peer-to-peer action game where one player is designated as the host and the other as the client player.  I'm using UDP to transmit the client's movement data to the server player.

I'd like to have some form of built-in voice communication in the game.  Do I need to set up a separate connection to send the audio streams, or should I use the same one that's used for sending movement data?  I've heard that a separate TCP connection will interfere with the UDP one; is this true for separate UDP connections as well?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
P2P game with VOIP/Teamspeak?
« Reply #1 on: October 14, 2010, 08:05:56 am »
Quote
I've heard that a separate TCP connection will interfere with the UDP one

What do you mean? Separate connections are... separate ;)
Laurent Gomila - SFML developer

Mr. Moon

  • Newbie
  • *
  • Posts: 15
    • View Profile
P2P game with VOIP/Teamspeak?
« Reply #2 on: October 15, 2010, 01:44:55 am »
Quote from: "Laurent"
Quote
I've heard that a separate TCP connection will interfere with the UDP one

What do you mean? Separate connections are... separate ;)


I'm going off this article:

Quote
The problem is that since TCP and UDP are both built on top of IP, the underlying packets sent by each protocol will affect each other. Exactly how they affect each other is quite complicated and relates to how TCP performs reliability and flow control, but fundamentally you should remember that TCP tends to induce packet loss in UDP packets. ...Don’t mix TCP and UDP, instead learn how to implement the specific pieces of TCP that you wish to use inside your own custom UDP based protocol.

(http://gafferongames.com/networking-for-game-programmers/udp-vs-tcp/)

Assuming he means separate UDP/TCP connections (is there any other option?), I wasn't aware of such a thing.  I just didn't want to rush in and make that kind of mistake.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
P2P game with VOIP/Teamspeak?
« Reply #3 on: October 15, 2010, 08:14:29 am »
Honestly, I think a lot of apps mix TCP and UDP, and I've never heard of this issue before. And even between different apps, some use TCP and some use UDP -- and they all use the same network adapter in the end...

So maybe you should do some tests before making any decision ;)
Laurent Gomila - SFML developer

Mindiell

  • Hero Member
  • *****
  • Posts: 1261
    • ICQ Messenger - 41484135
    • View Profile
P2P game with VOIP/Teamspeak?
« Reply #4 on: October 15, 2010, 03:58:34 pm »
I didn't know this kind of "error"...

I did read the paper that this guy is talking about :
- They tested with 6 TCP connections
- They have hte problem when UDP packets are 160 bytes or more

They said :
Quote
In this paper, a single UDP stream with some parameters is dealt with, but we have done the simulations in the case where more than one UDP stream exists and the obtained results are almost the same as shown here, although some UDP streams often affect each other

Quote
From our simulation results, we conclude that, when the real-time applications use UDP as a transport protocol, the best performance can be obtained using small packet sizes at a rather high transmission rate.

Quote
However, it should be noted that packets of small size require a relatively large overhead due to UDP and IP headers. This results in the inefficiency of network use. In this sense, in order to send traffic from real-time applications with good quality, much more bandwidth than that generated by the applications will be required, whereas the quality required is not yet guaranteed.


I really think there is no problem using both a TCP and a UDP stream ;)
Mindiell
----

Mr. Moon

  • Newbie
  • *
  • Posts: 15
    • View Profile
P2P game with VOIP/Teamspeak?
« Reply #5 on: October 18, 2010, 01:41:49 am »
Okay, thanks for the words of wisdom, fellas!  Unfortunately I'm too behind schedule to include the voice chat in this version of my game, but I will definitely take that into account :) .

 

anything