Source http://blog.csdn.net/skywind/article/details/392461
-----------------------------
Network hardware is also limited, while human creation is unlimited. Under the latency of an average of MS on the public network, there is no "full" synchronization. How can users be brought into a fast interactive real-time game by eliminating/hiding latency to experience perfect interactive entertainment?
The following six points will help you identify what we can work on and what we are not worth doing. It will help you understand the key to the synchronization problem in real-time games, and cleverly resolve and circumvent the game, finally, in a network environment suitable for common users (200 ms), real-time and fast interactive games are achieved:
1. Basic information:
(A) Network Performance Indicator 1: bandwidth, limits the number of real-time games
(B) Network Performance Indicator 2: latency determines the minimum response time of real-time games
2. two basic principles:
(A) There is no problem in making all the user screens show completely different appearances.
(B) It is no problem to soften these completely different appearances in a unified logic.
3. Twelve Synchronous Response policies:
(A) Data Transmission in the game is minimized
(B) Put blocking communication in the thread pool for implementation
(C) Never let the game go without waiting for Data
(D) Use prediction and interpolation to improve Game Performance
(E) When using predictive interpolation, the transmitted data not only includes coordinates, but also requires speed and acceleration.
(F) bind or queue the input data (such as the Keyboard Message Queue) until the next time the data is sent, the traditional method is to detect the keyboard at a fixed time (before sending the data, hiding latency in the principle of the game
(G) Use the event scheduling table to broadcast events that need to occur simultaneously on all user clients to all users in advance.
(H) multiple attacks are used to kill an Genie and minimize one-time, deterministic, and delayed sensitive events.
(I) extend the time for a bullet or rocket to fly in the air (prediction and interpolation at all clients while flying)
(J) It takes time for all objects to move from one place to another, avoiding design such as "instant movement ".
(K) Try to make all the genie, spacecraft, or other objects in the game run according to predictable tracks, such as adding inertia to the movement.
(L) Make full use of creativity, merge events in the game to the maximum extent possible, and merge latencies in the game, we also need to plan and pay attention to the technical improvement while avoiding some designs with great impact and cleverly hiding "latency"
4. Synchronization status quo:
(A) Insufficient attention: many people have not yet realized the existence of this problem. Some companies have spent half a year planning to create an online version of "squirrel wars.
(B) no technical solutions: For most programmers, stand-alone games are in a hurry to enter the Internet era if they are not mature.
(C) Research on this technology requires the ability of a competent company to provide, without which, even competent programmers cannot succeed.
5. Three major technical difficulties of online games:
(A) Server Response question: how can the server provide the highest response when an increasing number of people are supported.
(B) synchronization problem: how to implement fast real-time games with limited network response to provide the most perfect interaction.
(C) distributed server: How to unify the scattered "world" into a "world" by means of dividing user data.
Who can really solve the above three problems, combined with the planning breakthrough in design, will make other people within at least two years.
6. Supplement:
(A) The grid technology is still being copied and used in games. There are still many technical difficulties to break through (for example, the current Unit computing time of the grid is calculated in seconds ).
(B) In fact, contrary to the ideas of many people, 3D technology is no longer the main contradiction. At present, the above three problems can be said to be on the same starting line at home and abroad, and there is a full opportunity to take the lead.
(C) Now it is very urgent to solve the synchronization problem, and the required environment is also mature. As long as you pay attention to it, you can draw more mature conclusions within half a year.
How can we solve this problem? What should I do next?
So I have to practice it myself. I only want to say so much, haha. Otherwise, I will be lazy who will search for solutions online all day long.
[Reposted from csdn] online game synchronization rules