How to send information quickly, like many games do?

I think game methods like Counter Sstrike, WoW, etc. In CS you often have the same thing as 50 ping, is there a way to send information to the online MySQL database at that speed?

I am currently using the online version of the PHP script that my program requests, but this is very slow because the program must first send headers and post information to it, and then retrieve the result as a regular web page.

Is there really supposed to be some simpler and faster way to do this? I heard about TCP / IP, is that what I should use here? Is this possible for a faster connection to the database than indirectly through a PHP script?

+3
source share
3 answers

TCP / IP consists of three protocols:

  • TCP
  • UDP
  • ICMP

ICMP is what you use when you ping another computer on the network.

Games like CounterStrike don't care about what you previously did. Thus, there is no need for completeness in order to be able to reconstruct what you have done (therefore, competitors must tape what they do). This is what UDP is used for - there is no guarantee that data will be delivered or received. That's why lagging can be such a problem - you are already dead, you just did not know that.

TCP ensures that data is sent and received. Slower than UDP.

There are many things you need to know about fast connectivity - fewer hops, etc.

+3
source

- ? UDP.

, , TCP, , (select(), ..).

UDP - , - , , .

, - . ( ) .

Counterstrike - http.

+3

, , , UDP ( TCP/IP). UDP TCP , , , TCP .

, , C ++. , HTTP, , cookie. Tornado . HTML5 WebSockets, - .

If you are targeting a browser plugin such as Flash, Java, SilverLight, then you can use UDP, but I don’t know enough about these platforms to confirm.

Edit:

It's also worth mentioning: once your network code and protocol are optimized enough, there are still things you can do to improve the experience for players with high peaks.

+2
source

Source: https://habr.com/ru/post/1734504/


All Articles