SFML community forums

Help => Network => Topic started by: AlexAUT on October 28, 2012, 01:31:24 pm

Title: Realtime server client conversation
Post by: AlexAUT on October 28, 2012, 01:31:24 pm
Hello,

i´m currently working on multiplayer modes for my further programmed games like Ping Pong Tetris etc.

I have a debain based root Server so I´m using it as Server, (my router doesnt support portforwarding, so I have to use it).

First i started with Tetris and it was no Problem i used TCP, the Clients only send the information from their blocks to the Server and he spread this Informations to the other Clients, all no Problem.

But now I´m trying to do the same with Ping Pong. At the Moment the Server does all the Work, the Clients only send their keyinputs and the Server send all the information about the positions etc (every frame). The Problem is, it´s lagging and i have no idea how to make it better.

Should i use UDP? Or is there a better way to manage the informations?


P.S sry for my English but i´m not a native speaker
Title: Re: Realtime server client conversation
Post by: StormWingDelta on October 28, 2012, 06:39:16 pm
TCP is good for turn based and slow games while UDP is good for real time and fast games. That's about all I know since I have yet to get a multiplayer game up and running.
Title: Re: Realtime server client conversation
Post by: AlexAUT on October 28, 2012, 09:01:36 pm
K, thanks for your answer, i will try it with UDP and post my results later
Title: Re: Realtime server client conversation
Post by: Azaral on November 05, 2012, 06:49:51 pm
From my limited knowledge, UDP is a lot faster than TCP, but it is also less safe and could cause errors. If you are doing anything realtime, use UDP.
Title: Re: Realtime server client conversation
Post by: egyware on November 06, 2012, 03:20:06 am
Hi

Read this:
https://developer.valvesoftware.com/wiki/Source_Multiplayer_Networking (https://developer.valvesoftware.com/wiki/Source_Multiplayer_Networking)

Has a some tips for UDP