Talk about online game synchronization

xiaoxiao2021-03-06  62

Oh, I have sent a series of posts to discuss online game synchronizations a series of posts. Today, today, re-discuss this problem. . .

I don't know if you have encountered this situation, when a player issues a fireball, this fireball has its own sports trajectory, so how can it judge whether the fireball is hit? Most of the situation, when planning this request, it is generally denyed because: it is too much trouble, huh, huh. There is also something that includes two fireball collisions.

Then, is it true to simulate this simulation?

First let's take a look at what kind of trouble will simulate this operation: 2, the network is delayed, there is a delay, passing over, delay, delay is still unstable, trouble. 3, there are two points to solve it, then I don't want to think about it again.

Oh, in fact, the simulation of the fireball is relaxed than the simulation of the characters, the reason is very simple, the direction of the fireball will not change. Let's take a look at what the structure is used.

I don't know if I still remember the Dead Reckoning algorithm mentioned at this time last year. We want to simulate a fireball is that a server program called Moving Objects Tracing Server. What is this server? This server receives information about the registration event sent by the main game server. For example, there is a player, start moving, then the main game server will send the player's sports PDU, including the direction, speed, acceleration, starting point to MOS (Moving Objects Tracing) Server, then MOTS starts simulating it, when the game server is sent to the second PDU package, the position of each object is corrected and the simulation is restarted. So what is the purpose of our simulation? Of course, some events, such as collision, or a trap that falls into the map, will return the event to the primary logical server. The logical server is then processed to process the event.

Then, for the process of fireball, as synchronization with other players, after receiving the game's command, a fireball is generated, and its PDU information is specified, and the moving object is registered on the MOT. When MOTS is simulated to generate collisions from this object and other players or NPC objects, inform the primary logical server, then the primary logical server generates a corresponding action.

So about delay? Some people may say, for example, there is a fireball in front, and the villain that I have manipulated locally is hiding, but because the network is delayed, I didn't hide on the server, so how did you calculate? Oh, I don't know if you haven't played in the stars. When I found a multi-person connection mode in the interstel, there is a little very special place to control a small soldier, point some position on the map, but the soldiers It doesn't start moving immediately, but there is a certain delay, but this little delay does not cover the classics of the interstellar, and the same theory is also established here. For the control of the client, when the player manipulated the protagonist to change the PDU information, ensure that the information is sent to the server, then start processing the local operating instruction, so that the local prediction and server prediction is almost none, even There is a small error generation, and the server is the Lord, so that players will not have too much complaint.

转载请注明原文地址:https://www.9cbs.com/read-118896.html

New Post(0)