Good protocol for communication in the game? lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- kmk68 · 2017-11-06 10:17 400/5000 ... and one more question: I have a FPC game server. Console program. View and communication with server only from external program. Many queries about the answer the size of several hundred bytes. Transmitted data of the type of the condition and the state of the objects. What protocol to use? Right now I'm using Synapse and websocket. It works, But I do not know what the performance is ... are there better methods? Best regards, Kajetan ---------------------------------------------------------------------- Ñuño_Martínez · 2017-11-06 11:37 There's no "game network protocol".  I mean, it depends on the game.  It is not the same for action games, simulation, turn based strategy...  Each one has different needs. If the one you're using works, then work on it.  You can trace the net traffic and see if there are parts that can be optimized, specially the most common messages. Also a "prediction algorithm" will help a lot to speed up things as it allows to reduce the frequency and number of messages needed. Also, if you're interested on games, then you should join the Pascal Game Development community. ---------------------------------------------------------------------- Leledumbo · 2017-11-06 14:55 Real time games usually use UDP, because it doesn't matter if you miss a status update that can be updated in the next millisecond. Compression may also add benefit if your data size is somewhat "big", you need to experiment to decide whether this applies to you or not. ---------------------------------------------------------------------- User137 · 2017-11-07 14:06 Quote from: kmk68 on November 06, 2017, 11:17:20 amMany queries about the answer the size of several hundred bytes. Transmitted data of the type of the condition and the state of the objects.That is still small packet, but i hope you are using packed records? Should also optimize int types for fitting size. Depends on the game you are making, but default way should be TCP. Packet loss can be a real nuisance to deal with if using UDP. The TCP protocol should do what you don't need to do then, keeping backup of packets in memory to resend them. You can also use 2 ports simultaneously; 1 for TCP for the structurally critical data such as text messages or events and fast data with UDP. And that is also why your protocol implementation should be threaded from beginning.