This article is from WeChat public account: machine core (ID: gamecores) , author: van spirit guide me

The recently released Nintendo Switch game “Gather!” As a recent popular “social” game, “Animal Friends Club” is an important function of online. And the official design of the game also encourages players to communicate with each other online, whether it is more expensive than the kohlrabi that can be sold, whoever sells it, or who has a visiting special merchant, selling carpets or antiques, can be a great extent Broaden the types of game resources available to players and enhance the fun of playing.

However, there are some seemingly undesirable designs in this online function.

One question is about the “grand” farewell ceremony when players enter and leave other people’s islands. It takes players dozens of seconds to store and wait for other players to connect. If the island owner opens the island, other players frequently enter and leave the island, which means that the players on the island must be interrupted frequently, which greatly affects the game experience.

What ’s more frustrating is that there will still be “fried islands” (will be discussed in detail later) , on some scoring sites, players give this game a lot of negative evaluations from this.

Dongsen ’s online myths

In simple terms, These situations are all due to the game ’s archive and synchronization mechanism . When the player is playing in a single player, which is the so-called stand-alone mode, the save function is just like a traditional game: players can manually save, and the game will automatically save regularly. However, when connecting with other players, that is, the multiplayer mode, things start to get complicated.

The current multiplayer save mode is that when opening an island and when other players enter and leave the island, both players will automatically save. In addition, the game will not be automatically archived in the middle. This means that if any player suddenly drops the line during the game, (the fried island that players often say) , all of them on the island The player’s game progress will be reset to the time of the last save.

This is undoubtedly very frustrating, especially during this period, some players have achieved great achievements (such as catching rare fish) .

So why are these design reasons that affect the game experience? Let ’s take a look at a simple scenario: Player B connects to player A ’s island via the Internet, and then generously throws 99,000 bells to the ground (GameCurrency unit) , if Player B did not save and left the island in an abnormal way (such as pulling the network cable) , Player B obviously can only revert to the previous archive: the state before entering player A’s island, which means that player B’s 99,000 ringtones are still in hand.

If you do n’t reset everyone ’s progress at this moment, Player A ’s island still has the money left by Player B. In this way … the money is copied! This scenario is a classic data synchronization problem.

It may be strange to see readers here: we have also played so many online games, but have n’t heard of any game who lost the game and others will let others copy or lose files? The reason is because most of the online games we usually play are users directly connected to the server of the game operator, namely: master-slave mode (Client–server model) .

Most important game data, such as props and money held by players, are stored on the game server and are only being changed on the server. The player ’s client, game console, computer or mobile phone is just a ” “Terminal” is responsible for the interaction with the server, receiving the player’s operation, and displaying the results to the player.

So any problems in the player ’s gaming terminal will not affect the data on the server, nor will it affect other players. And “Assembly!” Games such as “Animal Forest Friends Association”, as a “single-player game” with their own archives to a certain extent, will be very different from the online games mentioned above online.

Each player has their own local archive, and in order to ensure that the player ’s data is synchronized before and after the connection, and there will be no vulnerabilities such as replication, this leads us to the next topic to discuss: The problem of synchronization of distributed data.

Data synchronization issues

The concept of distributed may be familiar and unfamiliar to modern people, or some people will call this concept “cloud” in a broad sense.

But in fact, the concept and technology of this aspect have been deeply studied in the computer field for decades. Among them, data synchronization is a subdivided technical field, and many problems have not been completed so far.Beautiful solution.

We will not discuss these complex computer science technologies in this article, but we can take this opportunity to take a peek at Leopard and discuss whether there is a better online solution. In the following content, I will simplify the online model as much as possible, and the actual operation mechanism will definitely have more detailed steps.

Synchronization of distributed data will lead to some problems that are not available on a single machine. The main problems are:

  1. Whether the data synchronized between hosts is accurate and consistent;


  2. Time delay caused by data communication between hosts;


  3. How to deal with data out of sync or errors.



    Let ’s take a look at “Collection!” How to solve these problems in the online mode of Animal Friends Association.

    In the simplest case, player A opens the island, player B enters later, and player B leaves the island after a while. Let me use a chart to represent the process of data archiving.

    Player A will enter the “online mode” after opening the island, the data generated at this moment will not be automatically saved until the next save event happened. When player B applies to enter player A ’s island, player A will save the current data and send the information of the island to player B, then player B will also automatically save and receive the islandAfter the data, enter player A’s island.

    At this time, Player A and Player B have synchronized data on the island. During this period, although the players can interact and the data is also exchanged in real time, it is not written to the players’ local archives. It was not until Player B applied to leave the island that the hosts on both sides officially saved the data and put a stop to this outing.

    So, is the saved data synchronized accurately? Since both parties are updating data in real time, as long as there are no errors and no one tampers with local data to cheat, then the data is theoretically synchronized, and of course the game will also check to ensure that what happened to both parties on the island is the same. .

    Let ’s take a look at the second point of delay. Because of the inevitable delay in network transmission, this may cause errors in the saved data. Specifically, for example, player B just threw a large bag of bell money on the ground. If at this moment both players save at the same time, player A has not received the information that player B dropped the money due to network delay. There is no money on the ground in the saved data.

    In Player B’s saved data, he has already thrown money on the ground. So in the data collection of both sides, this bag of money disappeared out of thin air. In order to avoid similar situations, the simplest way is to set up a delay time before saving to give the information enough time to transmit.

    Yes, you must have thought, This is why there are so grand “ceremonies” when someone enters and exits the island, this is to give the necessary delay time to synchronize before archiving, including data time stamp check : Determine which player ’s record to keep is the latest time, data verification, etc. After making sure that everything is safe, the hosts of each player will be officially saved.

    So what happens if the data fails to sync or other errors, such as which player is offline? Very simple, as everyone knows, is “blast island”, the archives of all players return to the last save point, and all the data in the middle is lost.

    After more players join, the operation mechanism is the same. It can be seen that this mechanism does not mention the game experience of players, at least it has completed the task of synchronizing data archives between different player hosts. There will be no loopholes such as copy loss, which is qualified in function.

    Possible to solve the problem

    Nintendo is known for making games with high-quality experiences, but the current multiplayer online experience obviously cannot satisfy everyone, even if such a design may be the result of the right and left of the engineers of the game development team. But is it possible for us to design an online mechanism that satisfies the above basic functions and takes into account the game experience of players as much as possible?

    Let ’s try to directly solve the pain points of current players.

    Can I omit the “welcome / sale farewell ceremony” when players enter and leave the island: As mentioned earlier, this time is not just It is used to load the data of the target island, and it is also used to synchronize and store the data between players. If it is cancelled or shortened, it may affect the successful synchronization of the data, especially for the online environment where the network environment is harsh. especially important.

    However, when a player enters the island, the player on the island will display “It seems that someone has come to play”. After this short waiting period, the player on the island will save it at the same time. Theoretically, the data synchronization between players has been completed at this moment, and the period of time after waiting for the new players to load the data should be omitted.

    If the other players can play the game normally after saving, the new players need to have a period of time to load the island data. After this period of time, they need to synchronize the other players during this period. data. If some players are still on the island and still loading the island data, there are new players applying for the island, etc., which is a series of new problems.

    Is it possible to avoid “blasting islands”: When a player accidentally disconnects, in order to prevent data from being out of sync, all players may return to the last archive point in the current online mechanism. Is the only option.

    But maybe we can try to reduce the player’s losses as much as possible, such as how to turn on the automatic timing archive? It sounds like a simple and easy way, but a little thought will make it clear that this has the same problem as the previously mentioned why players have a farewell ceremony when entering and leaving the island: Archives need to be synchronized .

    It takes a period of synchronization and prevents players from generating any data modification behavior during this period. Simply put, if there is a regular automatic archive, the players on the island may be interrupted from time to time and paused, waiting for all players to save and complete before continuing the activity. It cannot be done in stand-alone mode as automatic archiving will not affect the game.

    Looking further, if the save interval is set short, pauses from time to time will greatly affect the fluency of the game. After a long interval, the loss and frustration after the “blasting island” will increase again.

    Try online game-style online mode

    Since the usual master-slave mode of online games does not cause this problem, can the online mechanism of Dongsen also have aA public server to handle the content on the island, become a master-slave? In theory, this is feasible, but it is not practical. The core root cause is that Animal Forest is not a real online game, and you do n’t have to be online before playing.

    Try to imagine what will happen with this model. When the island owner opened the door of the island, the data on the island was uploaded to the official server, and the server was ready to provide public online services.

    The island owner also logged into his own island as one of the users, and all the data generated by the interaction was saved on the server. It is the same for other players to log in to the island, enter and exit the island at any time, and save it after synchronizing with the server when leaving the island. There is no longer a synchronization problem between players. Everything looks so beautiful.

    So what if someone goes offline? There seems to be no problem, right? The answer is no. Some players are offline. Although there is no direct impact on other players, there is a local archive on the offline player’s host. This means that the archive is not synchronized with the server.

    So in order to synchronize the data, the player must connect to this island again, and then leave normally after synchronizing the data. Until then, offline stand-alone games are not allowed.

    More troublesome, if the island owner wants to close the door after a player drops, does the island end the service on the server? What should the players who have been offline before do they have to wait for the opponent to go online before they can end? These problems make this model unrealistic, not to mention how much pressure this online model puts on the server, and it will not be a good choice for cost reasons.

    Conclusion

    Because of “Assembly!” “Animal Friends” is an inherent property of a stand-alone game with local archives, and it needs to face various challenges in multiplayer connection. I hope this article can give you a simple answer to all the inconveniences of the current online mode. Behind these seemingly imperfect models may be the compromise and helplessness of engineers and developers.

    Finally, since I do n’t know the actual operation mechanism and details of the Dyson network connection, the above principle is based on the assumptions about the characteristics displayed during the operation of the game and related knowledge. If there are errors, please advise.

    This article comes from the WeChat public account: machine core (ID: gamecores) , author: van spirit guide me